Ϋίί Ϋ ΫίίίίΫ ΫίίίίΫ ίίΫίί Ϋ άάά άάά ά ά άάά άάά Ϋ ΫάάάάΫ ΫάάάάΫ Ϋ TBBS Server Control System Ϋ Ϋ Ϋ ΫάΫ ΫάΫ Ϋ Ϋ Ϋ Ϋ Ϋ Ϋ Ϋ With Task Scheduler Serving Ϋάά ΫάΫ Ϋ Ϋ άΫά Ϋ ά Ϋ Ϋ Ϋ άάΫάά Up To 10 Simultaneous Tasks! ΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔ VERSION 4.1 A PRODUCT OF ADVANCED SYSTEMS RESEARCH API written by Alan McNamee What is it? ΔΔΔΔΔΔΔΔΔΔΔ Copyit! is a stand alone dos application designed to act as a co-processor to a LAN BASED TBBS system. This topology and methodology enables TDBS and TBBS applications to request another processor to perform operations and tasks that could either not be performed by TBBS or would be better suited to being performed by another machine thus freeing TBBS of the task. This is very well suited to such high impact operations as CD-ROM access and disk search applications. Simply, Copyit! is a request processing system that was designed to enable a multi-line system to process task requests from many lines simultaneously. With its hand full of both general and specialize request types, Copyit! can provide a nearly unlimited range of services to the requesting Copyit! aware application. History ΔΔΔΔΔΔΔ Copyit! originated as an idea conceived by Rick Kosick in order to relieved the impact felt by the access of CD-Roms with a file management program that he had developed. That first version was not much more than a compiled batch file in PASCAL that had a very specific task which was to wait for the presence of a file and then make dos calls to copy the requested file back to his programs holding area. This one rather simply process conceived the entire idea of having another machine take the load off of TBBS and do robotic processes which an application could synchronize with to enable DOS ONLY operations to be access via TBBS. The introduction of ASR to Copyit's maturity came forth with the 2nd version in which the basic design and look changed dramatically. Version 2 was rewritten in 'C' and released with the basic LOOK of sysmon and brought with it the first version that could process free form instructions and not just file transfers. This version was released for the LAN based option of the FILEMAN 2.x version. After the completion of the Fileman integration and getting all of the request protocols ironed out, a number of ASR products where developed to interface Copyit! and provide TBBS abilities that it never before could perform such as online tape backup, file archiving/unarchiving, etc. Version 3.x took yet another complete rewrite by completely changing the internal processing structure and migrating the code over to CLIPPER 5.1 and 'C'. At this time another complete face lift was given to Copyit to just make it prettier and give a more ergonomic appearance to the way that it processed its tasks. During the 3.x versions the release of Tims 1.1 was completed and this gave us an opportunity to test the existing architecture to see how quickly development of a real time event handler could be made into the existing structure. Without modifying any of the underlying structure, a complete realtime echo mail event processor was developed in under 6 hours. This now brings us to the present. The release of version 4.x came with some very substantial enhancements. Primarily the architecture was opened up so that custom NON ASR applications could be developed using the Copyit interface and the Copyit! API. This included 7 primary TYPES of basic operations that would allow just about any conceived application to access Copyit and instruct it to perform its bidding without regard to any other application that may being doing the same thing at the same time. Additionally, version 4.x was brought forth with a REALTIME FAX interface that would allow any TDBS application to generate a full graphic fax and send it immediately with as little a 14 lines of code. Architecture of the request file ΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔ The basic components of the Copyit request file mechanism allows for a variety of combinations of its data types to form its basic operational instruction set. Here is the request files component structure. Fld Fieldname Length Dec. Fieldtype ΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔ 1 REQ_TYPE 2 0 Chr 2 SRC_FILE 100 0 Chr 3 DEST_PATH 100 0 Chr 4 CTRL_PATH 100 0 Chr 5 XTRACT_CMD 100 0 Chr 6 GIFDSK_RES 1 0 Chr 7 ERRORLEVEL 2 0 Num 8 LICENSE 35 0 Chr 9 ERROR 1 0 Log 10 ERRMSG 100 0 Chr 11 S_TASKTYPE 9 0 Chr 12 S_LINENUMB 9 0 Chr 13 S_SYSTMSG 14 0 Chr 14 SDATE 8 0 Date 15 STIME 10 0 Num 16 COVER 1 0 Log 17 PAGELENGTH 5 2 Num 18 NOLOGO 1 0 Log Fields 1-13 are generic and are used for many different types of request operations and fields 14-18 only have meaning when performing a fax request. Since Copyit works off of primary REQUEST TYPES, I will try to put forth its operation by showing the utilization of the request file with each request type. The following are the 7 currently available request types. VALUE FUNCTION 1 File(s) Transfer 2 Gif Compression 3 Dos Program Execution 4 Exit on Errorlevel 5 Fax Transmission 6 Cold Boot 7 Warm Boot The following will be a brief description of the purpose of each of the general purpose fields: 1 REQ_TYPE 2 0 Chr This field must contain on of the 7 valid request type values. This gives Copyit! information on how to process the other fields. 2 SRC_FILE 100 0 Chr This field when used with a type 1 file transfer, tells copyit the full path and filename of the file to access. When used with a type 5 fax transmission, it is only meaningful if a txt, pcx or dcx file is attached to the transmission as part of the body of the fax. 3 DEST_PATH 100 0 Chr This field when used with a type 1 tells copyit where to send the file accessed in the SRC_FILE file. This must be a full path that is NOT terminated by a \ 4 CTRL_PATH 100 0 Chr This field is used when the sending application must wait for a response from copyit that signals the completion of the task. This must be a full path that IS terminated by a \ . When used with a type 5 Fax Transmission this field is used for the TO | FROM that is made a part of the cover sheet if one is instructed to be included. 5 XTRACT_CMD 100 0 Chr This field is used primarily with the type 3 Dos program execution. This field will contain the Dos command line that is to be invoked by Copyit. When used with a type 5 Fax Transmission, this field will contain the Full Telephone number to be used to dial the Target fax machine. 6 GIFDSK_RES 1 0 Chr This field is primarily used with the type 2 Gif Compression. This field contains the compression percentage as a value between 1 and 4 where 1 is 100% and 4 is 6%. This field is also used with the type 5 Fax Transmission to instruct copyit to what resolution to use when sending the fax, a 0 is HIGHRES and a value of 1 is LOWRES. 7 ERRORLEVEL 2 0 Num This field is primarily used with the type 4 Exit with ErrorLevel. The value used with this field can be between 0 and 255. This field is also used with the type 5 Fax Transmission to instruct copyit to used either normal text or compressed text for the fax transmission. A value of 0 is NORMALTEXT and a value of 1 is COMPRESSEDTEXT. 8 LICENSE 35 0 Chr This field is used by copyit to return the copyit licensing information to the requesting application. 9 ERROR 1 0 Log This field is used by copyit to tell the requesting application that an error occurred during the requested task. If used with a type 5 fax transmission, this field will be used to ... 10 ERRMSG 100 0 Chr This field is used by copyit to tell the requesting application the nature of the error that occurred from a failed request. If used with a type 5 fax transmission this field will contain the name of a pcx field to be used as the cover sheet graphic if one is intended to be a part of the transmission. This will be the filename only as all logofiles must be in the path that is configured by the copyit fax configuration. 11 S_TASKTYPE 9 0 Chr This field is used for the string information that is to be displayed on the copyit console when the task is received. 12 S_LINENUMB 9 0 Chr This field is used for the console display of the line number of the application making the request. 13 S_SYSTMSG 14 0 Chr This field is used for the copyit console display of the messages the indications the activity of the application request. The following will be a brief description of the purpose of each of the Fax Transmission specific fields: 14 SDATE 8 0 Date This field is used to specify the date that the fax is to be transmitted. If left empty the fax will be sent immediately. If a date is used then the STIME field must contain a value. 15 STIME 10 0 Num This field is used to specify the time that the fax is to be transmitted. If the SDATE field contains a date and the STIME field contains a time which is entered as the number of seconds since midnight, then the fax will be transmitted at that date and time. 16 COVER 1 0 Log This boolean field can be either true or false. If true then a cover sheet will be sent with the fax with option cover sheet text. If False no cover sheet will be used and no cover sheet text may be used. 17 PAGELENGTH 5 2 Num This field is for entering the page length to be used. Normally 11.5 inchs is used but this can be any value. If a value of 0 is entered then the fax will be continuous pages. 18 NOLOGO 1 0 Log This field is to specified if a pcx logo file will be attached to the cover sheet. If true, no pcx file will be used in the coversheet, if false, one will be used. Application/Copyit Interaction ΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔ In some cases with some request types, interaction between the TDBS application and copyit will take place. For example, when a type 1 file transfer request is made, the TDBS application first prepares the request file from the req.dbf structure. This req.dbf structure is copied to a file called 'req'+uline()+'.dbf'. This creates a unique request file for the line that is using the application. The application then fills in the appropriate information into the request file and then copies the request file to the COPYIT DIRECTORY. Copyit will automatically detect the presence of the request file and begin processing it. The TDBS application then must wait for acknowledgement from Copyit that the request has been fully processed or that it is ok for the application to proceed. This acknowledgement comes in the form of a file event with the file always begin "RECEIVED.FLG". This file should be instructed in the file request to be sent to a private directory for that callers line number, something in the form on 'line'+uline()+'\'. This insures that any other line that may be doing the same process, will not create a conflict with another line. In addition, the receive flag may be a start signal for a process that may be started by the application but is not complete on the copyit side. After the complete operation has been done by copyit, copyit will send back a file called 'RES'+ULINE()+'.DBF'. This file will normally be empty unless and error had been detected by copyit during the process. In the case of an error, each record in the file will be a brief description of the error. The application must also know that copyit is currently available for processing the incoming requests. This is done by examining the copyit directory for the file NETBUSY.FLG. If this file exists then copyit is currently not available to process requests. Normally this suggests that copyit is out under an errorlevel process or offline. In order to maintain application integrity, normally you would continue to process for up to 30 seconds waiting for the NETBUSY.FLG to disappear and if it does not then instruct the application to abort the request process. Coding Examples ΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔ The following code example is an extract from the ASR Fileman program and illustrates a batch file request of a type 1 request value. This shows the preparation of the request file and the start signal wait process. **** BEGIN BATCH FILE TRANSFER CODING EXAMPLE **** proc download drrec=recno() d=0 use select 1 use &mqholdfile select 2 use fardata set index to fararea select 3 use fileman set index to fname usecds=.f. mserv2que=" " do while .t. d=d+1 mcdserver=.f. mcdpath="" mfcdpath="" if empty(adownload[d]) d=0 exit endif sval=upper(trim(adownload[d])) select 3 seek sval if found() sval=arealvl+area_no endif select 2 seek sval if found() if cdserver usecds=.t. mcdserver=.t. mcdpath=upper(trim(cdspath)) mfcdpath=lower(trim(farpath)) mserv2que=serv2que endif endif select 1 append blank replace holdfile with adownload[d] replace lastuser with uname() replace cdserver with mcdserver replace cdpath with mcdpath replace fcdpath with mfcdpath replace serv2que with mserv2que enddo select 2 use select 3 use select 1 goto top ? qdir=mqdirs+"line"+uline+"\" do dnldel tot24hr=ulpeek(165,4) multi=.f. if usecds quedirflg=mqdirs+"LINE"+uline+"\RECEIVED.FLG" queerr=mqdirs+"LINE"+uline+"\ERROR00.LOG" ? "Sending requests to Server #"+servnum+"..." d=0 l=0 ?? chr(7) do while .t. d=d+1 if cdserver l=l+1 if l=1 path2ser=trim(cdpath) mapped2=serv2que svar="REQ"+uline+".DBF" s=svar svar=path2ser+svar select 7 use req.dbf copy stru to &s use use &s select 1 set color to w/n ? trim(holdfile) holdfile2=holdfile fcdpath2=fcdpath qdir2=qdir select 7 append blank repl req_type with "1" repl src_file with trim(fcdpath2)+trim(holdfile2) repl dest_path with mapped2+SUBS(qdir2,2,LEN(TRIM(qdir2))-2) repl ctrl_path with mapped2+SUBS(mqdirs,2) repl s_tasktype with "File Req" repl s_linenumb with " "+uline repl s_systmsg with " File "+str(l,2,0) select 1 if eof() select 7 use select 1 copy file &s to &svar exit else skip endif loop endif set color to w/n ? trim(holdfile) holdfile2=holdfile fcdpath2=fcdpath qdir2=qdir select 7 append blank repl src_file with trim(fcdpath2)+trim(holdfile2) repl s_systmsg with " File "+str(l,2,0) select 1 endif if eof() select 7 use select 1 copy file &s to &svar exit else skip endif enddo path2ser=path2ser+sval tof="sval" endif select 1 use select 2 use d=0 qfilesize=0 mcdserver=.f. if .not. empty(adownload[2]) multi=.t. ?? chr(7) set color to w+/n dummy=afill(afilename,space(1)) dummy=afill(afilesize,0,i+1) dummy=afill(afiledate,"01/01/80") dummy=afill(afiledesc,space(1)) dummy=afill(arec,0) dummy=afill(aonline,.f.) dummy=afill(xtn,.f.) ? "Copying files to queue..." select 1 use fardata set index to fararea select 2 use fileman set index to fname do while .t. mcdserver=.f. d=d+1 if empty(adownload[d]) exit endif dfilename=trim(adownload[d]) select 2 seek dfilename if found() findarea=arealvl+area_no select 1 seek findarea mfn=TRIM(farpath) mcdspath=TRIM(cdspath) mcdserver=cdserver select 2 ffilename=mfn+dfilename qdir=mqdirs+"line"+uline+"\"+dfilename if .not. mcdserver qfilesize=qfilesize+size endif if .not. mcdserver set color to w/n ? ffilename do binarycopy with ffilename,qdir endif endif enddo select 1 use select 2 use **** prompt for logoff if mlogoff if mlogoff do lineprmpt with "Logoff after Download [y/N] " ans=upper(trim(cvar)) if ans="Y" loff=.t. endif endif endif qdir=mqdirs+'line'+uline+' /TL /NL /I:"D *.*"' **** begin batch download if usecds ? "Waiting for requests, Esc to Abort " endif qq=0 do while .t. qq=qq+1 if usecds do case case qfilesize >=50000 clear dotbbs type 34 optdata qdir if file(quedirflg) dummy=inkey(1) do binaryerase with quedirflg endif exit case file(quedirflg) dummy=inkey(1) do binaryerase with quedirflg clear dotbbs type 34 optdata qdir exit otherwise if file(queerr) clear type &queerr dummy=inkey(1) do binaryerase with queerr wait exit endif ?? "." if qq >= 120 ?? chr(27) set color to r+/n ? "Server is not responding, Download Aborted!" dummy=inkey(2) use use fileman set index to farea,fname,dlstat,putol return endif dummy=inkey(1) if dummy=27 ?? chr(27) set color to r+/n ? "Download Aborted!" dummy=inkey(2) use use fileman set index to farea,fname,dlstat,putol return endif loop endcase if file(queerr) clear type &queerr dummy=inkey(1) do binaryerase with queerr wait exit endif else clear dotbbs type 34 optdata qdir exit endif enddo d=0 **** delete queued files do dnldel else **** Single file downloads **** coding example omitted endif select 1 use fileman set index to fname,farea,dlstat,putol select 2 use fardata set index to fararea select 3 use filecfg if usecds resfile=mqdirs+"\RES"+uline+".DBF" if file(resfile) select 4 use &resfile qq=0 if error set color to gr+/n ? " -Errors have been recorded, Press Any Key-" dummy=inkey(6) set color to gr+/n clear set color to gr+/b ??' Request ERRORS, The Following Requests where not processed' set color to r+/n do while .t. if eof() exit endif qq=qq+1 if mod(qq,20)=0 set color to gr+/n ? " -more-" dummy=inkey(12) clear set color to gr+/b ??' Request ERRORS, The Following Requests where not process' set color to r+/n endif if .not. empty(errmsg) ? subs(errmsg,1,77) else qq=qq-1 skip loop endif skip if eof() exit endif enddo set color to gr+/n ? " -Press Any Key-" dummy=inkey(12) clear endif use select 3 if file(resfile) do binaryerase with resfile endif endif endif return **** END CODING EXAMPLE **** The following code example is an extract from ASRchive which illustrates the type 3 request which allows an external dos application to be called from Copyit. When copyit receives this request it will unload itself from memory except for a 4k resident portion that must remain. The Dos application that you request the execution of will have all of the remaining available memory. **** BEGIN CODING EXAMPLE **** line1=mmap+subs(mqdir,2) line2="Dummy" *** line3 is the setup for a call to a batch file called asrzip.bat *** the rest of the parameters are the command line parameters for *** pkzip.exe that are accepted by the batch file with the %1 %2 %3 with *** the call to the batch file. line3="asrzip temp.zip "+mmap+subs(mqdir,2)+"\que\*.* > asrchive.txt" use req.dbf copy stru to &reqfile use use &reqfile append blank repl req_type with "3" repl dest_path with line1 repl ctrl_path with line1 repl s_tasktype with "Archive" repl s_linenumb with " "+ULINE() repl s_systmsg with trim(subs(filename,at(".",filename)+1))+" Archiving" repl xtract_cmd with line3 use mservtemp=mservpath+'\'+reqfile copy file &reqfile to &mservtemp qq=0 set color to w+/r @ 15,7 say space(66) @ 15,7 say "Archiving " do while .t. qq=qq+1 if file("RECEIVED.FLG") dummy=inkey(1) erase received.flg exit endif ?? "." if qq >= 120 ?? chr(27) set color to w+/r @ 15,7 say space(66) set color to w+*/r @ 15,7 say "Server is not responding, Process Aborted!" set color to w+/r dummy=inkey(4) @ 15,7 say space(66) use return endif dummy=inkey(1) enddo if file("ERROR00.LOG") dummy=INKEY(1) errfile=mqdir+"\error00.log" erase error00.log endif @ 15,7 say space(66) @ 15,7 say "Copying work file to "+filename +" ..." copy file temp.zip to &filename dummy=inkey(2) **** END CODING EXAMPLE **** The following code example is an extract from tapeman which illustrates the exit on errorlevel from a type 4 request. **** BEGIN CODING EXAMPLE **** if dotape s="REQ"+uline()+".DBF" use req.dbf copy stru to &s use use &s append blank repl req_type with "4" repl errorlevel with 28 repl s_tasktype with "Tape BU" repl s_linenumb with " "+ULINE() repl s_systmsg with "Online Backup" use svar=mcpath+s copy file &s to &svar endif **** END CODING EXAMPLE **** The following code example is an extract from the credit card system that ASR uses for product purchases. This program allows the caller to optionally request that the invoice for the purchase be faxed immediately rather than being sent in the mail. This will show the method used to prepare the information that is to be faxed and then instructing copyit on how to send it. This example sends both a full coversheet with a logo graphic and a body text which is the invoice iself. This uses a type 5 request value. **** BEGIN FAX CODING EXAMPLE **** do while .t. clear faxit=.f. ans=.f. @ 2,3 say "Do you wish to have your invoice faxed immedietly?" GET ans PICT "Y" read if ans faxit=.t. fcountry = " " fareacode=" " fphonenum=" - " ans=.t. @ 4,3 say "Are you in the U.S. or Canada" get ans PICT "Y" read if .not. ans @ 5,3 say "Enter your Country code" get fcountry pict "99" read @ 6,3 say "Enter your Area Code" @ 5,29 say "-" @ 5,30 get fareacode pict "999" read @ 7,3 say "Enter your fax number" @ 5,33 say "-" @ 5,34 get fphonenum pict "99999999" read ffaxnum="910288011"+fareacode+fphonenum else @ 5,3 say "Enter your Area Code" @ 5,30 get fareacode pict "999" read @ 6,3 say "Enter your fax number" @ 5,33 say "-" @ 5,34 get fphonenum pict "999-9999" read if empty(fareacode) .or. fareacode="702" ffaxnum="9"+fphonenum else ffaxnum="9102881"+fareacode+fphonenum endif endif ans=.f. @ 8,3 say "Is this correct" get ans pict "Y" read if ans exit else loop endif else exit endif enddo clear set color to w+/B @ 1, 5 say "ΔΔΔ΄ Save Purchase ΓΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔΔ " @ 2, 5 say " " @ 3, 5 say " Thank You! Your purchase has been saved in the database. " if faxit @ 4, 5 say " FAXING your Invoice! Please Wait ... " else @ 4, 5 say " Printing your Invoice! Please Wait ... " endif @ 5, 5 say " " if .not. prnonly use card append blank replace entrydate with date() replace crdno with m->crdno replace crdtype with m->crdtype replace crdholder with m->crdholder replace crdexp with m->crdexp replace total with m->total replace addr1 with m->addr1 replace addr2 with m->addr2 replace city with m->city replace state with m->state replace zip with m->zip replace phone with m->phone replace expire with m->expire replace processed with .f. replace username with uname replace userloc with ulocation() replace auth with " " replace product with m->prodsel else prodsel=space(60) @ 6,5 say "Enter Product for Invoice" get prodsel @ 7,5 say "Enter Amount of Purchase " get total pict "9999.99" read endif set printer to lpt1 set print on set console off ? ? ? ? ? ? " The Advanced System Credit Card Transactions - Printed " + dtoc(date()) ? ? " ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ" ? " Entry Date ....... " + dtoc(date()) ? " User Name ........ " + rtrim(uname) if .not. prnonly ? " User Location ... " + rtrim(userloc) endif ? " ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ" ? " Credit Card Number ..... " + rtrim(crdno) ? " Credit Card Holder ..... " + rtrim(crdholder) ? " Credit Card Expires .... " + rtrim(crdexp) ? " Credit Card Type ....... " + rtrim(crdtype) ? " Authorization Number ... " ? " ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ" ? " User Information:" ? ? " " + rtrim(crdholder) ? " " + rtrim(addr1) if .not. empty(rtrim(addr2)) ? " " + rtrim(addr2) endif ? " " + rtrim(city) + ", " + trim(state) + " " + trim(zip) ? ? " " + rtrim(phone) ? " Key imbedded for: " + rtrim(bbsname) ? " ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ" ? ? " $"+str(total,6,2)+" - "+trim(prodsel) ? " Programmer: "+mprgmr ? " Percentage: "+STR(mprc,6,0)+"%" ? ? " ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ" ? ? " ___ Check User Record Updated" ? ? " ___ Check Credit Card Slip Processed" ? ? ? do printbig with " "+rtrim(crdno) ? do printbig with " "+rtrim(crdexp) ? do printbig with " $"+str(total,6,2) eject if faxit set print off faxfile="FAX"+ULINE()+".BDY" set alternate to &faxfile set alternate on endif ? ? do bigletters ? ? " The Advanced System Credit Card Transaction - Printed " + dtoc(date()) ? ? ? ? " " + rtrim(uname) ? " " + rtrim(addr1) if .not. empty(rtrim(addr2)) ? " " + rtrim(addr2) endif ? " " + rtrim(city) + ", " + trim(state) + " " + trim(zip) ? ? ? ? if empty(rtrim(addr2)) ? endif ? "-" ? " " + rtrim(phone) ? " Key Imbedded For: " + rtrim(bbsname) ? " ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ" ? " Entry Date ....... " + dtoc(date()) ? " Name ............. " + rtrim(uname) if .not. prnonly ? " Location ........ " + rtrim(userloc) endif ? " ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ" ? " Credit Card Number ..... " + rtrim(crdno) ? " Credit Card Holder ..... " + rtrim(crdholder) ? " Credit Card Expires .... " + rtrim(crdexp) ? " Credit Card Type ....... " + rtrim(crdtype) if prnonly ? " Authorization Number ... " + ltrim(rtrim(str(145,3,0)))+"-"+subs(dtoc(date()),7,2)+"-"+subs(dtoc(date()),1,2) else ? " Authorization Number ... " + ltrim(rtrim(str(recno(),10,0)))+"-"+subs(dtoc(date()),7,2)+"-"+subs(dtoc(date()),1,2) endif ? " ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ" ? " Purchase Information:" ? ? " $"+str(total,6,2)+" - "+trim(prodsel) ? " ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ" ? ? " Note: All credit card transactions are processed by:" ? " INCAD, Inc., In Partnership with Advanced Systems Research, Inc." ? ? do printbig with " "+rtrim(crdno) ? do printbig with " "+rtrim(crdexp) ? do printbig with " $"+str(total,6,2) ? ? ? ? " Advanced Systems Research, Inc." ? " 1475 Terminal Way Bldg C2" ? " Reno, Nv 89502" ? " 702-334-3304 (voice) - 702-334-3317 (bbs)" ? ? " Turning TBBS POSSIBILITIES into REALITIES!" if faxit ? chr(12) else eject endif if .not. prnonly replace processed with .t. endif if faxit set alternate off set alternate to reqfile="REQ"+ULINE()+".DBF" use req.dbf copy stru to &reqfile use use &reqfile append blank replace xtract_cmd with ffaxnum && the phone number of the && fax machine being called replace license with "CATMAN 1.0" && Name of application that && sent the fax replace ctrl_path with trim(uname())+"|Advanced Systems Research" && the to and from entries. && seperate with the | chr. && If the FROM and | are && are omitted, then the default && from the copyit fax setup && will be used. replace errmsg with "ASRFAX2.PCX" && the name of the pcx && cover page, uses default && in the copyit fax setup if && omitted. replace error with .f. && always false replace gifdsk_res with "0" && resolution, 0=high, 1=low replace errorlevel with 0 && 0=NORMAL TEXT, 1=COMPRESSED replace req_type with "5" && task type 5 for faxing replace s_tasktype with "Send Fax" replace s_linenumb with " "+uline() replace s_systmsg with " Invoice FAX" && copyit screen display info replace cover with .t. && true=use cover info, false= && don't use cover info replace pagelength with 11.0 && fax page lenght replace nologo with .f. && false=use pcx cover sheet && true=don't use pcx cover sheet replace stime with 0 && time to send fax, 0 immediately replace sdate with ctod(" / / ") && date to send fax, blank for && immediately && NOTE: && REPLACE SRC_FILE WITH THE NAME OF A FILE TO BE USED AS THE && BODY TEXT. THIS CAN BE A TEXT, 200DPI B/W PCX OR A DCX FILE. && LEAVE THIS EMPTY IF NO BODY INFO WILL BE SENT. && use faxfile="FAX"+ULINE()+".CVR" set alternate to &faxfile set alternate on ? ? " This is your invoice for this transaction! Since it has been FAXED" ? " automatically using COPYIT! V4.1 you will not be receiving a invoice" ? " by mail." ? " " ? " Alan McNamee" ? " " set alternate off set alternate to faxfile="FAX"+ULINE()+".CVR" faxdest=COPYIT_PATH+faxfile copy file &faxfile to &faxdest faxfile="FAX"+ULINE()+".BDY" faxdest=COPYIT_PATH+faxfile copy file &faxfile to &faxdest faxdest=COPYIT_PATH+reqfile copy file &reqfile to &faxdest else set print off endif set console on if prnonly quit endif **** END CODING EXAMPLE **** The following code example is an illustration of the types 6 and 7 machine reboot requests. Normally this would be used as a prepared request file which is sent over to copyit before the TBBS machine does a reboot for an operation such as an automatic disk defrag process. This would require that the copyit machine be shut down and brought back up to wait for the TBBS machine to reconnect. **** BEGIN CODING EXAMPLE **** s="REQ"+uline()+".DBF" use req.dbf copy stru to &s use use &s append blank repl req_type with "6" ** note: use type 7 for a warm reboot repl s_tasktype with "Reboot" repl s_linenumb with " "+ULINE() repl s_systmsg with "Copyit Shutdwn" use svar=mcpath+s copy file &s to &svar **** END CODING EXAMPLE **** The previous examples are by no means complete examples of the utility that can be provided by the use of a copyit aware interface. But by knowing the elements and the rules of copyit many processes can be created that would otherwise not be possible for an online application. An example of a very extensive use would be an interface to the AS400 query system to request information from a company data system for online access through a TBBS system. This may sound difficult but it is actually a very simple process and has already been done by one company to provide information about flooring charges of computer equipment that dealers have on hand. This information may take quite awhile to generate the results so instead of having the caller wait online while the results are computed and translated into a ascii text file, the application issues the query request then tells the caller that the results will be faxed back when they are complete. After the AS400 finishes its query process the TBBS system then sends a second request (triggers by user logons) that invokes copyit to fax the resulting text file to the original callers fax machine. This is all completing automatic and requires very little programming skill. If you wish any additional information or help in interfacing your application to copyit you can access the Advanced System BBS and leave a message in the ASR Support Echo or call Advanced Systems Research Tech. Support at 503-699-TBBS. Alan McNamee