!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! AUXSBR.BAS ! ! Sample program to set up and use AUXSBR.SBR in a Basic program. ! ! This program uses AUXSBR.SBR. ! ! Get: ! AUXSBR.M68 from AMUS ! AUXSBR.DOC from AMUS ! DUMB.M68 from AMUS ! ! Written by: ! James A. Jarboe IV ! Educational Filmstrips ! 1401 19th Street ! Huntsville, TX 77340 ! (409)- 295-5767 ! GR/AM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! MAP1 FILEN,S,25 ! Filename to print MAP1 BFLAG,B,1 ! Returned flag from AUXSBR.SBR MAP1 AUXERR(3),S,40 ! AUXSBR errors AUXERR(1)="Requested FILENAME not found." AUXERR(2)="Requested File is a RANDOM file." AUXERR(3)="DUMB.TDV not found on a TRMDEF. " MAP1 HELP(50),S,80 HELP(01) = " By James A. Jarboe IV" HELP(02) = "" HELP(03) = " This program is provided to give an EXAMPLE and help in the SETUP of" HELP(04) = "" HELP(05) = " AUXSBR.SBR" HELP(06) = "" HELP(07) = "AUXSBR.SBR allows the Auxiliary port on a terminal to be used as output" HELP(08) = "of data to any device attached to the terminal's auxiliary port such as" HELP(09) = "a printer." HELP(10) ="" HELP(11) =" To setup AUXSBR.SBR so that it works you must have the terminal driver" HELP(12) =" DSK0:DUMB.TDV[1,6]" HELP(13) =" on your system and loaded as a terminal driver on a TRMDEF statement" HELP(14) =" in your .INI file prior to booting the system." HELP(15) ="" HELP(16) ="EXAMPLE: TRMDEF PRINTER,AM300=3:DUMB,9600,20,20,20" HELP(17) ="" HELP(18) =" used as a printer driver on any valid printer, or" HELP(19) ="" HELP(20) =" TRMDEF AUXPRT,PSEUDO,DUMB,1,1,1" HELP(21) =" " HELP(22) =" used as driver loaded onto the system at bootup time for usage are both" HELP(23) =" valid. It is not necessary to use both lines since a driver is loaded " HELP(24) =" only once into the system." HELP(25) ="" HELP(26) ="Example of calling AUXSBR.SBR from BASIC:" HELP(27) ="" HELP(28) =" XCALL AUXSBR, Filename, Flag" HELP(29) ="" HELP(30) ="Where:" HELP(31) =" Filename = a STRING variable containing the name of the file" HELP(32) =" to print through the terminal's auxiliary port." HELP(33) ="" HELP(34) =" Flag = a BINARY 1 variable in which a status is return to" HELP(35) =" the basic program." HELP(36) =" 0 = All ok" HELP(37) =" 1 = Filename not found" HELP(38) =" 2 = File is RANDOM" HELP(39) =" 3 = DUMB.TDV was not found on a TRMDEF statement" HELP(40) ="" SETUP: CALL SCREEN ! display help ? TAB(2,1);TAB(-1,10); ? " SETUP" ? ? " To see if your printer is setup correctly to the terminal's auxiliary" ? " port and that your current terminal driver is setup to accept the" ? " correct TCRT calls to turn the auxiliary port ON and OFF," ?:? ? TAB(-1,11);" Turn your printer ";TAB(-1,12);"ON "; ? TAB(-1,11);" and Press a ";TAB(-1,12);"CR "; INPUT "",Z$ ! ! ! tab -1,82 will turn the aux port on if the terminal driver is coded right ! PRINT TAB(-1,82); ! ! this stuff will print on printer if tab(-1,82) worked. ? " !!!!!! ATTENTION !!!!!!" ? " YOU GOT DATA ON YOUR PRINTER" ! ! send a form feed ? CHR$(12) ! ! tab(-1,83) will turn the aux port off if the terminal driver is coded right ! PRINT TAB(-1,83); ? "" :? "" ? "If everything worked out right you should have the following printed" ? "out on the printer attached to the terminal's auxiliary port" ? "" ? " !!!!!! ATTENTION !!!!!!" ? " YOU GOT DATA ON YOUR PRINTER" ? ? "If not then check your TERMINAL DRIVER PROGRAM and see that the TCRT calls" ? "82 and 83 are the correct sequence of codes to turn your terminal's" ? "auxiliary port on and off." CALL PAUSE ? TAB(2,1);TAB(-1,10); ? "" ? " If you did get data printed on your printer, then" OK: ? ? TAB(-1,11);" Enter ";TAB(-1,12);"OK ";TAB(-1,11); ? "and Press a ";TAB(-1,12);" Return. "; INPUT "",Z$ IF UCS(Z$)[1,2]#"OK" THEN GOTO QUIT FILEN="@$^%*(" ! ! lets call auxsbr and see if DUMB.TDV is attached to a TRMDEF statement ! so that AUXSBR can use it. FILEN has a garbage name in it so that if ! DUMB is located we will get an error flag of BFLAG=1. But we are not going ! to check for it as we are only checking for the location of DUMB at this ! time. XCALL AUXSBR,FILEN,BFLAG IF BFLAG=3 THEN GOTO NO'DUMB ! If we got here then .INI file has a TRMDEF with DUMB on it. GETIT: ? TAB(2,1);TAB(-1,10); ? ? " Now we are going to attempt the final test." ? ? "This final test is to see if the cable connected to the printer is" ? "set-up correctly to handle handshaking. To do this you are going to" ? "print out a file. If handshaking is working then the file will print" ? "out completely. If handshaking is not working correctly then you will" ? "most probably get data overun and garbage will printout because the" ? "printer will not keep up with the data it receives." ? ? "I suggest printing out AUXSBR.BAS. So......." ? ? ? TAB(-1,11);" Enter a ";TAB(-1,12);"File name ";TAB(-1,11); ? "to print ( go ahead try AUXSBR.BAS) ";TAB(-1,12); INPUT LINE "",FILEN ? ? "The Terminal Auxiliary port should now be on and data should be" ? "printing on the printer attached to the auxiliary Port." ? "Screen Display will cease until file is through printing. " ! Call AUXSBR with filespec and print out file XCALL AUXSBR,FILEN,BFLAG LOOP2: IF BFLAG<>0 THEN GOTO AUXERR ? FILEN = UCS(FILEN) ? FILEN;" should now be printed out on the printer." ? "Good Luck !" ? "Program FINISHED" END ! ! AUXSBR returns a flag to indicate errors ! 0 = all ok ! 1 = filespec not found ! 2 = File was RANDOM ! 3 = DUMB not on a TRMDEF statement in INI file ! AUXERR: ? TAB(2,1);TAB(-1,10) ? ? TAB(15,1);"AUXSBR.SBR ";TAB(-1,11); ? "returned an error code of ";TAB(-1,12); ? BFLAG ? ? TAB(-1,11);"MEANING: ";TAB(-1,12); ? AUXERR(BFLAG) END ! ! Display help screen ! SCREEN: ? TAB(-1,0);TAB(1,80);TAB(-1,33);TAB(1,1);TAB(-1,32); ? TAB(1,27);TAB(-1,11);" AUXSBR.SBR SAMPLE PROGRAM ";TAB(-1,12) PAGE1: FRM=1 PAG: ? TAB(2,1);TAB(-1,10); FOR I=FRM TO FRM+19 IF I>40 THEN GOTO NXI ? HELP(I) NXI: NEXT I PAUSE: ? TAB(23,1); ? TAB(-1,11);"Press a ";TAB(-1,12);"CR ";TAB(-1,11);"to continue"; ? TAB(-1,12);" "; INPUT "",Z$ FRM=I IF I<40 THEN GOTO PAG I=100 RETURN NO'DUMB: ? TAB(2,1);tab(-1,10); ? ? " OOOPs !!!!" ? ? "DUMB.TDV has not been added to a TRMDEF statement so AUXSBR could not" ? "find it to use it. READ the documentation and add DUMB to a TRMDEF" ? "Statement in your .INI file and REBOOT your system." ? ? "Then try this program again and you will be one step closer to having" ? "AUXSBR.SBR working on your system!." ? ENDED: ? ? TAB(-1,11);"Program has ";TAB(-1,12);"ENDED." ? END QUIT: ? TAB(2,1);TAB(-1,10); Z$="N" ? TAB(10,18);"ARE YOU SURE YOU WANT TO QUIT? "; INPUT "",Z$ IF UCS(Z$)#"Y" THEN GOTO OK END