引用第3073楼蛋卷强于2008-06-17 23:15发表的 :害得老子一眼雀过切......尿都差点抖出来
引用第3楼月夜狼歌于2009-03-24 16:51发表的 :老子设计的入gate级CPU
引用第3楼月夜狼歌于2009-03-24 16:51发表的 : 老子设计的入gate级CPU
引用第7楼funny_cn于2009-03-24 16:54发表的 : 现什么宝,边上凉快去。
引用第8楼西北狼于2009-03-24 16:54发表的 :大哥发话,狼歌你快闪
int counter = 0long ll_vchno, li_posinteger li_FileNumdecimal{2} ld_amountstring ls_output, ls_filenamestring ls_acct, ls_curr, ls_cd, ls_remark, ls_tran_dt, ls_vchno, ls_instiddatetime ld_tran_dtstring ls_tran_code, ls_ref_first, ls_ref_second, ls_v_flag, ls_cust_no, ls_ledger_code string ls_gl_trans_no, ls_branch_id, ls_currency, ls_user_id, ls_reverse_flagstring ls_bank_nm, ls_payer, ls_payer_account, ls_brach_nm, ls_cust_nmdate as_datedate as_date1 = date('2006-08-10')date as_date2 = date('2007-07-16')ls_filename = "c:\fbs\ftp\FBS_15289_20060810-20070716.txt" //卸载文件li_FileNum = FileOpen(ls_filename, StreamMode!, Write!, LockWrite!, Replace!)if li_FileNum= -1 then messagebox('提示','打开输出文件失败!') returnend ifDECLARE lcs_voitems CURSOR FOR SELECT "TRAN_DT", "VOUCH_NO", "ACCOUNT_NO", "AMOUNT", "CR_DR", "BRANCH_ID", "CURR", "LEDGER_CODE" FROM "FBS_VOITEMS" WHERE "FBS_VOITEMS"."TRAN_DT" >= :as_date1 AND "FBS_VOITEMS"."TRAN_DT" <= :as_date2 AND ("FBS_VOITEMS"."ACCOUNT_NO" like '11%' ) and "FBS_VOITEMS"."CUST_NO" = '15289'; OPEN lcs_voitems; FETCH lcs_voitems INTO :ld_tran_dt, :ll_vchno, :ls_acct, :ld_amount, :ls_cd, :ls_branch_id, :ls_currency, :ls_ledger_code ; DO WHILE SQLCA.sqlcode = 0 ls_tran_dt = string( ld_tran_dt , 'YYYYMMDD') as_date = date(ls_tran_dt) ls_vchno = trim( string( ll_vchno ) ) ls_branch_id = left( trim( ls_branch_id ) , 9 ) SELECT "REF_FIRST", "REF_SECOND", "VOUCHER_FLAG", "TRAN_CODE" INTO :ls_ref_first, :ls_ref_second, :ls_v_flag, :ls_tran_code FROM "FBS_VOHEAD" WHERE ( "TRAN_DT" = :ld_tran_dt ) AND ( "VOUCH_NO" = :ll_vchno ) ; SELECT "BRANCH_NM" INTO :ls_brach_nm FROM "FBS_BRANCH" WHERE "BRANCH_ID" = :ls_branch_id ; ls_brach_nm = wf_formatstr(ls_brach_nm,120) string ls_acct_2, ls_cd_2, ls_remark_2, ls_branch_id_2, ls_currency_2 string ls_instid_2, ls_ledger_code_2, ls_brach_nm_2 decimal{2} ld_amount_2 SELECT "ACCOUNT_NO", "AMOUNT", "CR_DR", "BRANCH_ID", "CURR", "LEDGER_CODE" INTO :ls_acct_2, :ld_amount_2, :ls_cd_2, :ls_branch_id_2, :ls_currency_2, :ls_ledger_code_2 FROM "FBS_VOITEMS" WHERE "FBS_VOITEMS"."TRAN_DT" = :ld_tran_dt AND ( ("FBS_VOITEMS"."LEDGER_CODE" LIKE '511%' ) OR ("FBS_VOITEMS"."LEDGER_CODE" like '512%' ) ) AND ("FBS_VOITEMS"."VOUCH_NO" = :ll_vchno); if SQLCA.sqlcode <> 100 then SELECT "BRANCH_NM" INTO :ls_brach_nm_2 FROM "FBS_BRANCH" WHERE "BRANCH_ID" = :ls_branch_id_2 ; ls_branch_id = wf_formatstr(ls_branch_id, 20) ls_brach_nm = wf_formatstr(ls_brach_nm, 180) ls_acct = wf_formatstr(ls_acct, 56) ls_cust_nm = wf_formatstr(ls_cust_nm, 180) ls_brach_nm_2 = wf_formatstr(ls_brach_nm_2, 180) ls_acct_2 = wf_formatstr(ls_acct_2, 56) ls_currency = wf_formatstr(ls_currency, 3) ls_currency_2 = wf_formatstr(ls_currency_2, 3) FileWrite(li_FileNum, ls_tran_dt +'|$|') FileWrite(li_FileNum, ls_brach_nm + '|$|' ) FileWrite(li_FileNum, ls_acct + '|$|' ) FileWrite(li_FileNum, ls_cust_nm + '|$|') FileWrite(li_FileNum, ls_brach_nm_2 + '|$|' ) FileWrite(li_FileNum, ls_acct_2 + '|$|' ) FileWrite(li_FileNum, '收费帐户' + '|$|') FileWrite(li_FileNum, string(ld_amount_2) + '|$|' + ls_currency_2 + '|$|' + ls_cd_2 + '~r~n') else SELECT "BANK_NM", "PAYER", "CUST_NM" INTO :ls_bank_nm, :ls_payer, :ls_cust_nm FROM "FBS_APPLY" WHERE ( "REF_FIRST" = :ls_ref_first ) ; if left( trim(ls_bank_nm), 1) = '"' then //去除非法字符 ls_bank_nm = trim( right( ls_bank_nm, len(ls_bank_nm) - 1) ) if right(ls_bank_nm, 1) = '"' then ls_bank_nm = trim( left( ls_bank_nm, len(ls_bank_nm) - 1) ) end if else ls_bank_nm = trim( ls_bank_nm ) end if if left(ls_bank_nm, 1) = "/" then li_pos = pos( ls_bank_nm, "~r~n", 1) ls_bank_nm = trim( right(ls_bank_nm, len(ls_bank_nm) - li_pos) ) end if if left( trim(ls_payer), 1) = '"' then //截取帐号 - -# ls_payer_account = trim( right( ls_payer, len(ls_payer) - 1) ) if right(ls_payer_account, 1) = '"' then ls_payer_account = trim( left( ls_payer_account, len(ls_payer_account) - 1) ) end if else ls_payer_account = trim( ls_payer ) end if if left(ls_payer_account, 1) = "/" then li_pos = pos( ls_payer_account, "~r~n", 1) if li_pos <> 0 then ls_payer_account = left(ls_payer_account, li_pos) ls_payer_account = right(ls_payer_account, len(ls_payer_account) - 1) end if else li_pos = pos( ls_payer_account, "ADD:", 1) if li_pos <> 0 then ls_payer_account = left(ls_payer_account, li_pos - 1) else ls_payer_account = "" end if end if if left( trim(ls_payer), 1) = '"' then //截取帐户名 --# ls_payer = trim( right( ls_payer, len(ls_payer) - 1) ) if right(ls_payer, 1) = '"' then ls_payer = trim( left( ls_payer, len(ls_payer) - 1) ) end if else ls_payer = trim( ls_payer ) end if if left(ls_payer, 1) = "/" then li_pos = pos( ls_payer, "~r~n", 1) ls_payer = trim( right(ls_payer, len(ls_payer) - li_pos) ) end if ls_branch_id = wf_formatstr(ls_branch_id, 20) ls_user_id = wf_formatstr(ls_user_id, 20) ls_brach_nm = wf_formatstr(ls_brach_nm, 180) ls_bank_nm = wf_formatstr(ls_bank_nm, 180) ls_payer_account = wf_formatstr(ls_payer_account, 56) ls_acct = wf_formatstr(ls_acct, 56) ls_cust_nm = wf_formatstr(ls_cust_nm, 180) ls_payer = wf_formatstr(ls_payer, 180) ls_brach_nm_2 = wf_formatstr(ls_brach_nm_2, 180) ls_acct_2 = wf_formatstr(ls_acct_2, 56) ls_currency = wf_formatstr(ls_currency, 3) ls_currency_2 = wf_formatstr(ls_currency_2, 3) IF ls_cd="C" THEN FileWrite(li_FileNum, ls_tran_dt + '|$|') FileWrite(li_FileNum, ls_bank_nm + '|$|' ) FileWrite(li_FileNum, ls_payer_account + '|$|' ) FileWrite(li_FileNum, ls_payer + '|$|') FileWrite(li_FileNum, ls_brach_nm + '|$|' ) FileWrite(li_FileNum, ls_acct + '|$|' ) FileWrite(li_FileNum, ls_cust_nm + '|$|') FileWrite(li_FileNum, string(ld_amount) + '|$|' + ls_currency + '|$|' + ls_cd + '~r~n') ELSE if left(ls_tran_code, 2) = "0F" then SELECT "REMITTEE_ACCT" INTO :ls_payer_account FROM "OR_HANDLE" WHERE "OR_NO" = :ls_ref_first; ls_payer_account = wf_formatstr(ls_payer_account, 32) end if FileWrite(li_FileNum, ls_tran_dt + '|$|' ) FileWrite(li_FileNum, ls_brach_nm + '|$|' ) FileWrite(li_FileNum, ls_acct + '|$|' ) FileWrite(li_FileNum, ls_cust_nm + '|$|') FileWrite(li_FileNum, ls_bank_nm + '|$|' ) FileWrite(li_FileNum, ls_payer_account + '|$|' ) FileWrite(li_FileNum, ls_payer + '|$|') FileWrite(li_FileNum, string(ld_amount) + '|$|' + ls_currency + '|$|' + ls_cd + '~r~n') END IF END IF setnull(ll_vchno) setnull(ld_amount) setnull(ls_acct) setnull(ls_curr) setnull(ls_cd) setnull(ls_remark) setnull(ls_tran_dt) setnull(ls_vchno) setnull(ld_tran_dt) setnull(ls_tran_code) setnull(ls_ref_first) setnull(ls_ref_second) setnull(ls_v_flag) setnull(ls_cust_no) setnull(ls_ledger_code) setnull(ls_gl_trans_no) setnull(ls_branch_id) setnull(ls_currency) setnull(ls_user_id) setnull(ls_reverse_flag) setnull(ls_bank_nm) setnull(ls_payer) setnull(ls_payer_account) setnull(ls_brach_nm) setnull(ls_cust_nm) setnull(ls_acct_2) setnull(ls_cd_2) setnull(ls_remark_2) setnull(ls_branch_id_2) setnull(ls_currency_2) setnull(ls_ledger_code_2) setnull(ls_brach_nm_2) setnull(ld_amount_2) counter = counter + 1//if counter > 15 then exit FETCH lcs_voitems INTO :ld_tran_dt, :ll_vchno, :ls_acct, :ld_amount, :ls_cd, :ls_branch_id, :ls_currency, :ls_ledger_code ; LOOPFileClose(li_FileNum)CLOSE lcs_voitems;messagebox('提示','输出结束!')
多少次,流云飞舞,恍惚重现,你当年青春曼妙一瞬间,情意满天,纷飞笼罩,深不见底的寂寥