I have a consultant working for me and he is working on my Alpha program. He asked me why he could not see the CDX file. He can open the DBF.
He is writing an interface to another program. Here is the code he used.
I am not a xbasic programmer so I do not know if this code will work. Thank you in advance.
Art
* Open the exception table
use ex_debt in 0
* Opend the notes table
use debt_note order acct_no in 0
* Opend the debtor table
use 's:\debtor card' order 4 alias debtcard excl in 0
* Set environment variables.
* Set filename of DialPower database to open based on date.
lcPath = '\\svr-user\group\groupdata\dialpower\from_dp\'
lcDate = dtoc(Date() - 1)
lcDPDate = 'NCG20' + Substr(lcDate,7,2) + substr(lcDate,1,2) + substr(lcDate,4,2)
*lcDPDate = 'NCG20050304a'
lcFile = lcPath + lcDPDate
* Open Dial Power database
select 0
use &lcFile alias DPFile
* Loop through all records, seek account number.
select DPFile
go top
x = 1
xtot = reccount()
scan while !EOF()
wait 'processing: ' + alltrim(str(x)) + ' of ' + alltrim(str(xtot)) window nowait
* Set variables for Notes
lcAcct = Our_File_N
lcHPhone = Hphone
lcCallPhone = 'PH:' + alltrim(Call1_Phon)
lcCallDate = DTOC(Call1_dt)
lcCallDispo = str(Disp1_id,2,0)
lcCallAgent = Agent1_c
* Concatenate notes components
lcNotes = lcCallPhone + ' ' + lcCallDate + ' ' + lcCallDispo + ' ' + lcCallAgent
select debtcard
if seek(lcAcct)
if (hphone = lcHphone) and lcCallDispo = 'OI'
* Remove the home phone, change status to 'OI' from debtcard
endif
* Save notes
select debt_note
append blank
replace acct_no with lcAcct, debt_note with lcNotes, ;
date with date(), time with time()
else
* Account not found.
select ex_debt
append blank
replace acct_no with lcAcct, date with date(), time with time()
endif
* next record
select DPFile
x = x + 1
endscan
* close databases
use in ex_debt
use in dpfile
use in debtcard
use in debt_note
return
He is writing an interface to another program. Here is the code he used.
I am not a xbasic programmer so I do not know if this code will work. Thank you in advance.
Art
* Open the exception table
use ex_debt in 0
* Opend the notes table
use debt_note order acct_no in 0
* Opend the debtor table
use 's:\debtor card' order 4 alias debtcard excl in 0
* Set environment variables.
* Set filename of DialPower database to open based on date.
lcPath = '\\svr-user\group\groupdata\dialpower\from_dp\'
lcDate = dtoc(Date() - 1)
lcDPDate = 'NCG20' + Substr(lcDate,7,2) + substr(lcDate,1,2) + substr(lcDate,4,2)
*lcDPDate = 'NCG20050304a'
lcFile = lcPath + lcDPDate
* Open Dial Power database
select 0
use &lcFile alias DPFile
* Loop through all records, seek account number.
select DPFile
go top
x = 1
xtot = reccount()
scan while !EOF()
wait 'processing: ' + alltrim(str(x)) + ' of ' + alltrim(str(xtot)) window nowait
* Set variables for Notes
lcAcct = Our_File_N
lcHPhone = Hphone
lcCallPhone = 'PH:' + alltrim(Call1_Phon)
lcCallDate = DTOC(Call1_dt)
lcCallDispo = str(Disp1_id,2,0)
lcCallAgent = Agent1_c
* Concatenate notes components
lcNotes = lcCallPhone + ' ' + lcCallDate + ' ' + lcCallDispo + ' ' + lcCallAgent
select debtcard
if seek(lcAcct)
if (hphone = lcHphone) and lcCallDispo = 'OI'
* Remove the home phone, change status to 'OI' from debtcard
endif
* Save notes
select debt_note
append blank
replace acct_no with lcAcct, debt_note with lcNotes, ;
date with date(), time with time()
else
* Account not found.
select ex_debt
append blank
replace acct_no with lcAcct, date with date(), time with time()
endif
* next record
select DPFile
x = x + 1
endscan
* close databases
use in ex_debt
use in dpfile
use in debtcard
use in debt_note
return
Comment