SBP ZendOrder is a client program that logs into a specific type of receiver and uploads a series of files (all unknown in this code) via Zmodem. When finished the server sends a file "adummy.txt" as a check. This was done for a client of mine. All sensitive parts have been removed. Modem init parameters are read in from a data file and sent to the modem. You will notice some debugging code REMmed out. Written by: Jeffrey S. Weyrich mods: ZendOrder(doSafe%%) a%%,i%%,MdmInitStr$,MdmResetStr$,MdmSetAAStr$,MdmClrAAStr$,MdmDialStr$ bps&%,parity%%,port%%,databits%%,stopbits%%,MdmDialTime%% portName$,fileName$,SiteID$,Pswd$,HangupStr$,PhoneNum$ dialString$,eMsg1$,eMsg2$,testbuffer$ "wlcc.dll","ComOpen","ICIJIIIII" "wlcc.dll","ComSetFlow","III" "wlcc.dll","CSetModemParmDialTime","III" "wlcc.dll","CSetModemParmDialStr","IIC" "wlcc.dll","CSetModemParmDiscStr","IIC" "wlcc.dll","CSetModemParmResetStr","IIC" "wlcc.dll","CSetModemInitStr","IIC" "wlcc.dll","ComReset","II" "wlcc.dll","ComModemInit","II" "wlcc.dll","ComDial","IIC" "wlcc.dll","ComStimulus","IICCII" "zmodem.dll","ComSzm","IICI" "zmodem.dll","ComRz","IIII" "wlcc.dll","ComDisc","II" "wlcc.dll","ComClose","II" "wlcc.dll","ComSetYield","III" "wlcc.dll","ComGetteststring","IIFI" "wlcc.dll","Ctest","I" "wlcc.dll","Ctestint","II" "wlcc.dll","Cteststring","IC" "wlcc.dll","CGetModemParmResetStr","IIF" "wlcc.dll","ComGetc","II" _ "999999999" ,4"control" ` SiteID$SiteID.control Pswd$Pswd.control port%%CommPort.control1'zero based for Superbase portName$"COM"(port%%,"0")":" bps&%BPS.control MdmInitStr$ModemInitStr.control MdmResetStr$ModemReset.control MdmDialTime%%ModemDialTime.control MdmDialStr$ModemDialStr.control HangUpStr$ModemDiscStr.control PhoneNum$OrdrSitePhone.control "control" parity%%1 databits%%8 stopbits%%1 testbuffer$""  i%%("ComOpen",portName$,port%%,bps&%,databits%%,parity%%,stopbits%%,4096,4096) i%% 0p eMsg1$"Error opening comm device." i%% 1  eMsg2$"Invalid or unsupported ID: "portName$ 2  eMsg2$"Device "portName$" is already open." 3  eMsg2$"Device "portName$" not open." 4  eMsg2$"Not enough memory for i/o queues." 5  eMsg2$"Error in default parameters." 10  eMsg2$"Device "portName$" not found. No hardware." 11  eMsg2$"Invalid byte size." 12  eMsg2$"Speed "(bps&%,"z99999")" is not supported."  eMsg1$,eMsg2$,139,a%% ClosePort(port%%)  disable xon/xoff, enable rts/cts i%%("ComSetFlow",port%%,0) now that we have opened the com port, setup the modem parms and init it. i%%("CSetModemParmDialTime",port%%,MdmDialTime%%) i%%1p "Error setting dial time","Time value: "(MdmDialTime%%),139,a%% ClosePort(port%%)  set the dialing string MdmDialStr$""p "Invalid dial string","",139,a%% ClosePort(port%%)  i%%("CSetModemParmDialStr",port%%,MdmDialStr$) i%%1p "Error setting dial string","String: "MdmDialStr$,139,a%% ClosePort(port%%)  set the disconnect/hangup string i%%("CSetModemParmDiscStr",port%%,HangUpStr$"|") i%%1p "Error setting hang up string","String: "HangUpStr$,139,a%% ClosePort(port%%)  set the reset string i%%("CSetModemParmResetStr",port%%,MdmResetStr$"|") i%%1p "Error setting reset string","String: "MdmResetStr$,139,a%% ClosePort(port%%)   set the init string i%%("CSetModemInitStr",port%%,MdmInitStr$"|") i%%1p "Error setting initialization string","String: "MdmInitStr$,139,a%% ClosePort(port%%)  "Initializing port "portName$" . . ." i%%("ComReset",port%%) 2 now that all the modem strings are set, init it i%%("ComModemInit",port%%) i%%1p "Error initializing modem.","",139,a%% ClosePort(port%%)  i%%("ComSetYield",port%%,0) "Dialing "PhoneNum$" . . ." i%%("ComDial",port%%,PhoneNum$"|") i%% 1p i%%0p eMsg1$"Dialing terminated by ESC key." eMsg2$"" ^ eMsg1$"Dialing timed out." eMsg2$""  eMsg1$,eMsg2$,139,a%% ClosePort(port%%)  20 OPEN "ModemW.txt" FOR OUTPUT CALL ShowTestBuffer(port%%,testbuffer$) "Attempting login. . ." i%%("ComStimulus",port%%,"login:",SiteID$"|",200,50) i%%1p i%% 1'input parms were wrong or port is closed.  eMsg1$"No prompt from host."  eMsg2$"Terminating connection." 2  eMsg1$"Time out on logging in."  eMsg2$"" 3  eMsg1$"Character count exceeded before login"  eMsg2$"prompt was found." 4  eMsg1$"A break was encountered"  eMsg2$"" ^  eMsg1$"Undefined code returned by ComStimulus call."  eMsg2$"Code: "(i%%)"."  eMsg1$,eMsg2$,139,a%% HangUp(port%%) ClosePort(port%%)  CALL ShowTestBuffer(port%%,testbuffer$)  "Sending password. . ." i%%("ComStimulus",port%%,"Password:",Pswd$"|",256,35) i%%1p i%% 1'input parms were wrong or port is closed.  eMsg1$"No password prompt from host."  eMsg2$"Terminating connection." 2  eMsg1$"Time out on password acceptance."  eMsg2$"" 3  eMsg1$"Character count exceeded before password"  eMsg2$"prompt was found." 4  eMsg1$"A break was encountered"  eMsg2$"" ^  eMsg1$"Undefined code returned by ComStimulus call."  eMsg2$"Code: "(i%%)"."  eMsg1$,eMsg2$,139,a%% HangUp(port%%) ClosePort(port%%)  CALL ShowTestBuffer(port%%,testbuffer$) i%% = GetInput%%(port%%,testbuffer$) IF i%% THEN END SUB END IF "Sending data files. . ." i%%("ComSzm",port%%,"*.dat",ZSendTimeOut%%) i%%1p "Error during file transfer.","Terminating",139,a%% HangUp(port%%) ClosePort(port%%)  "Ready to receive acknowledgement. . ." now that the file has been sent, prepare to receive ADUMMY.TXT i%%("ComRz",port%%,FALSE%%,ZRecvTimeOut%%) i%%1p "Errors during file receive ADUMMY.TXT.","Notify your administrator.",139,a%% HangUp(port%%) ClosePort(port%%)  "File transfers completed!","",100,a%% "" HangUp(port%%) ClosePort(port%%) "*.dat"'do some cleanup  HangUp(p%%) i%% i%%("ComDisc",p%%)  ClosePort(p%%) i%% i%%("ComClose",p%%)  ShowTestBuffer(port%%,testbuffer$) i%% i%%("ComGetteststring",port%%,testbuffer$,256) i%%1p {testbuffer$ ^ {"Error getting test string. Code: "(i%%,"0") SET STATUS "Click to continue..." WAIT MOUSE  GetInput%%(p%%,tb$) i%%,a%% GetInput%%1 tb$"" i%%("ComGetc",p%%) a%%0 a%% 20 i%%1p tb$tb$(i%%) ? CHR$ (i%%); 'enable this line by removing the REM to output to debug file a%%0 ^ 1 a%%a%%1  /(tb$)4p -(tb$,4)"fed4"p'attention string for zmodem protocol  i%%("ComGetc",p%%) i%%1 a%%20p HangUp(p%%) ClosePort(p%%) GetInput%%0 "Host timed out...","",100,i%%