CALLed table erase DECLARE EXTERN values after lookup
Tyler
tyler.style at gmail.com
Thu May 4 14:47:54 PDT 2006
Well, this is a nasty one. I think it must be a bug.
I DECLARE GLOBAL in one processing table (temp), which then calls another
with a DECLARE EXTERN(temp2).
The DECLARED value in CALLed table temp2 is just fine until the line I do a
lookup. The value of all DECLARED EXTERN variables are then blanked. Can
anyone explain why this should be? I'm using v5.0.14r4 on SCO.
Below are the relevant processing tables. The values for all DECLAREds
disappear after the first lookup in the CALLed table, right after the debug
on statement. Can anyone tell me why it does this?
Tyler
:'---in-----------------------------:DECLARE GLOBAL ccCustNum(6,.0):
::DECLARE GLOBAL ccCardNum(16,*):
::DECLARE GLOBAL ccAmntReq(9,.2):
::DECLARE GLOBAL ccInvcNum(6,.0):
::DECLARE GLOBAL ccCustName(34,uplow):
::DECLARE GLOBAL ccVNumber(8,.0) 'must be 8 digits; add a leading 7 if
only 7 digits:
::DECLARE GLOBAL ccShowProgress(1,yesno):
:'---out-----------------------:DECLARE GLOBAL ccAuthCode(8,allup):
::DECLARE GLOBAL ccAmntRsp(9,.2):
::ccCustNum="433594"; ccCardNum="4185865892920419":
::ccAmntReq="1.99"; ccInvcNum="999999":
::ccCustName="Joe Test"; ccVNumber="71234567":
::ccShowProgress="N":
::CALL ("/hd1/hd1/appl/filepro/ccfile/auth"):
authit:'==============================================================:'Tyler
042406 Authorize a credit card in real time.:
:'NOTE ccfile must have already been generated externally.::
:'---in-----------------------------:DECLARE EXTERN ccCustNum:
::DECLARE EXTERN ccCardNum:
::DECLARE EXTERN ccAmntReq:
::DECLARE EXTERN ccInvcNum:
::DECLARE EXTERN ccCustName:
::DECLARE EXTERN ccVNumber 'must be 8 digits; add a leading 7 if only
7 digits:
::DECLARE EXTERN ccShowProgress:
:'---out-----------------------:DECLARE EXTERN ccAuthCode:
::DECLARE EXTERN ccAmntRsp:
::ccAuthCode="":
:ccAmntReq eq "" or ccAmntReq le "0":ccAuthCode="Bad_Amnt"; goto rauthit:
:ccCardNum eq "":ccAuthCode="No_CC#"; goto rauthit:
::debug on:
:ccCustNum ne "":lookup ccfile k=(ccCustNum&ccCardNum) i=B -nx:
:not ccfile:ccAuthCode="No_CFile"; goto rauthit:
:ccfile(4) eq "":ccAuthCode="No_Addr"; goto rauthit:
:ccfile(7) eq "":ccAuthCode="No_Expry"; goto rauthit:
::lookup control r=("493") -np:
:not control:ccAuthCode="No_Cntrl"; goto rauthit:
::i=control(10); control(10)=i+"1"; write control; close control:
::ccfile(9)=ccInvcNum:
::f(6,mdy)=@TD:
::n(6,*)=mid(@tm,"1","2"){mid(@tm,"4","2"){mid(@tm,"7","2"):
::fp="/hd1/hd1/appl/fpmerge/pospartnerhh":
::fn=""{ccInvcNum{"_"{ccCustNum{"_"{f{"_"{n{"_":
::jsfile cr (fp{"/POSTMP/"{fn{".xml"):
::jsfile tx "<?xml version=\"1.0\" ?>":
::z="<File xmlns=\"x-schemaCNPCaptureRequestSchema.sch\"
UniqueFileName=\""{fn{".xml\"":
::z=z<"UseEncryption=\"False\" TransactionCode=\"CNP\" RecordType=\"RQ\"
ProcessingCode=\"CA\" VNumber=\""{ccVNumber{"\">":
::jsfile tx ""{z{"":
::jsfile tx "<Transaction>":
::jsfile tx "<AccountDataSource>@</AccountDataSource>":
::jsfile tx "<AccountNumber>"{ccCardNum{"</AccountNumber>":
::jsfile tx "<BillingAddress1>"{ccfile(1){"</BillingAddress1>":
::jsfile tx "<BillingAddress2></BillingAddress2>":
::jsfile tx "<BillingCity></BillingCity>":
::jsfile tx "<BillingCountryCode></BillingCountryCode>":
::jsfile tx "<BillingState></BillingState>":
::jsfile tx "<BillingZipCode>"{MID(ccfile(4),"1","5"){"</BillingZipCode>":
::jsfile tx "<CardHolderIDCode>D</CardHolderIDCode>":
::jsfile tx "<CID></CID>":
::jsfile tx "<CIDIndicator></CIDIndicator>":
::jsfile tx "<CommTax></CommTax>":
::jsfile tx "<CommTaxIndicator>0</CommTaxIndicator>":
::jsfile tx "<CustomerID>"{ccCustNum{"</CustomerID>":
:ccInvcNum ne "":jsfile tx "<CustomerName>"{ccInvcNum{"</CustomerName>":
::jsfile tx
"<ExpirationDate>"{MID(ccfile(7),"1","2"){MID(ccfile(7),"4","2"){"</ExpirationDate>":
::jsfile tx "<InvoiceNumber>"{ccInvcNum{"</InvoiceNumber>":
::jsfile tx "<MerchantTransactionID>"{i{"</MerchantTransactionID>":
::jsfile tx "<MultSeqCount>1</MultSeqCount>":
::jsfile tx "<MultSeqNum>1</MultSeqNum>":
::jsfile tx "<RequestedACI>Y</RequestedACI>":
::jsfile tx "<ShipDate>"{@TD{"</ShipDate>":
::jsfile tx "<TransactionAmount>"{ccAmntReq{"</TransactionAmount>":
::jsfile tx "</Transaction>":
::jsfile tx "</File>":
::jsfile cr-:
::system "chmod 777"<fp{"/POSTMP/"{fn{".xml":
::system "mv"<fp{"/POSTMP/"{fn{".xml"<fp{"/POSREQ":
::i="0":
::y="N"; ms="Sending file to POS.":
::lookup blurb = ccBlurb k=(" 1") i=A -nx:
loop05s::'---wait for authorization:
:i eq "120" or y eq "Y":goto loop05e:
:ccShowProgress eq "Y":clearp; popup("1","1") -,"ccauth":
:blurb and ccShowProgress eq "Y":clears; show popup("4","1")
blurb(3)<blurb(4)<blurb(5)<blurb(6)<blurb(7)<blurb(8)<blurb(9)<blurb(10)<blurb(11)<blurb(12):
::display; sleep "1000":
::ms="Waiting for POS to process file ":
:EXISTS(""{fp{"/POSREQ/"{fn{".xml") gt "0":ms="Waiting for POS to pick up
file"; goto loop05n:
:EXISTS(""{fp{"/POSREQ/"{fn{".old") gt "0":ms="POS has picked up file,
waiting for result":
:EXISTS(""{fp{"/POSRSP/"{fn{"Response1.xml") gt "0":y="Y"; ms="POS has
completed, retrieving result."; goto loop05e:
loop05n::i=i+"1"; ms=ms<i<"secs"; display; goto loop05s:
loop05e::clears; clearp; display; close blurb:
::yn="N":
if03:y eq "Y":goto endif03:
:ccShowProgress eq "Y":input popup yn "Authorization is taking a long
time...keep trying? (Y/n) ":
:yn ne "N":i="0"; goto loop05s:
:ccShowProgress eq "Y":msgbox "Authorization process cancelled.":
::ccAuthCode="Time_Out":
::goto rauthit:
endif03:::
::lookup pos = pos@ r=free -e:
::pos(5)=ccInvcNum; pos(6)=ccCustNum; pos(7)=5; pos(9)="75658966":
::pos(18)=@TD; pos(19)=@ID; write pos:
loop22s::'---iterate thru returned XML file:
::import ASCII xml=(""{fp{"/POSRSP/"{fn{"Response1.xml") r=\n f=255:
:not xml:goto loop22e:
::z=xml(1):
if21:not (z co "<ApprovalCode>"):goto endif21:
::ccAuthCode=""{MID(""{z{"","15",DLEN(""{z{"")-"30"):
:ccAuthCode ne "":pos(10)=ccAuthCode; ccAuthCode="AP"{ccAuthCode;
ccfile(8)=ccAuthCode; pos(8)=ccAuthCode; goto endif21:
:ccAuthCode eq "":ccAuthCode="DECLINED"; ccfile(8)=ccAuthCode; goto endif21:
endif21:::
:z co
"<SettlementAmount>":ccAmntReq=""{MID(""{z{"","19",DLEN(""{z{"")-"38");
pos(3)=ccAmntReq; goto loop22n:
:z co
"<TransactionStatus>":ccfile(10)=""{MID(""{z{"","20",DLEN(""{z{"")-"40");
pos(4)=ccfile(10); goto loop22n:
:z co "<ErrorMessage>":ccAuthCode="POS_ERR";
ccfile(10)=""{MID(""{z{"","15",DLEN(""{z{"")-"30"); pos(4)=ccfile(10); goto
loop22n:
:z co "<ResponseTextMessage>" and pos(4) eq
"":pos(4)=""{MID(""{z{"","22",DLEN(""{z{"")-"42"); goto loop22n:
:z co "<AccountNumber>":pos(1)=""{MID(""{z{"","16",DLEN(""{z{"")-"32"); goto
loop22n:
:z co "<ExpirationDate>":pos(2)=""{MID(""{z{"","17",DLEN(""{z{"")-"32");
goto loop22n:
loop22n::goto loop22s:
loop22e:::
::pos(17)=pos(1){pos(2); write pos:
::write ccfile:
rauthit:::
:ccShowProgress eq "Y":clearp; clears:
:@PM eq "DEBUG":msgbox ccAuthCode<"\n"{pos(4):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.celestial.com/pipermail/filepro-list/attachments/20060504/8f2cd744/attachment-0001.html
More information about the Filepro-list
mailing list