' ' Program: QLUX ' Author: Lawrence Davis ' Description: Replacement for LUX/ZLUX programs ' ' ========================================================================== ' Program History ' ========================================================================== ' .......................................................................... ' ' v 1.21 TYPE command for .LBR files now calls on LT.COM (or ZLT.COM ' 04/12/90 renamed as LT.COM). TYPE command for .ZIP files now displays ' error message "++ Cannot type ZIPped files ++". TYEP (sic) is ' added as equivalent to TYPE (I often misspell TYPE as TYEP). ' ' Added CR, UNCR, LT, READ, VIEW, and VDE commands for crunching ' uncrunching, typing, and editing files found outside archive. ' Also added NULU command to supplement PUT command for LBR files, ' but PUT command for LBR files now uses LPUT instead of NULU. ' GET command for LBR files now requires LBREXT (renamed to LGET) ' instead of LT. Added ZCMD for using Z-System commands not found ' in QLUX. ZCMD can only do one single command at a time, i.e., ' no multiple commands. Example of ZCMD syntax: ' ' QLUX:LIBRARY.LBR (?=HELP)>>zcmd vlu ' ' Fixed SEND command. Changed SEND ALL command to SENDALL. ' SEND ALL was being interpreted as downloading a single LBR member ' file named "ALL". Added alternate code for KMD if you don't use ' ZMD. Changed ZSEND ALL command to ZSENDALL for RZMP download of ' of entire LBR/ZIP/ARC/ARK/LZH file. ' ' NEW command was added since there was a FOR command. ' ' Adjusted help menu and syntax display. The syntax display now ' follows ZCPR3-style syntax displays and now shows the current ' version number. ' - Sean N. Sullivan ' ' .......................................................................... ' ' v 1.20 Several new goodies added to QLUX. QLUX assumes a combination ' 09/22/89 of the following files being online: DIR, LDIR, TYPE (LT29), ' NULU, SETD, UNARC, ARK, ADS, UNZIP, LHRD, LHVW, ZMD, and RZMP. ' ' Added GET command to extract member files and PUT command to ' insert new files into archive -- only for LBR, using NULU, and ' ARC/ARK, using ARK. Also a DATE command for date/time-stamping ' LBR and ARC/ARK files. GET, PUT, and DATE command assumes same ' respective command line formats as if you're using LT, UNARC, ' UNZIP, LHRD, NULU, ARK, SETD, or ADS at the QLUX command line ' prompt but without specifying the archive file. For example: ' ' A0:ROOT>lt library.lbr a:file.dyc ' QLUX:LIBRARY.LBR (?=HELP)>>get a:file.dyc ' ' A0:ROOT>unarc archive.ark a:filename.typ ' QLUX:ARCHIVE.ARK (?=HELP)>>get a:filename.typ ' ' A0:ROOT>unzip zipped.zip member.fil ' QLUX:ZIPPED.ZIP (?=HELP)>>get member.fil ' ' A0:ROOT>lhrd lewzhuff.lzh member.doc ' QLUX:LEWZHUFF.LZH (?=HELP)>>get member.doc ' ' A0:ROOT>nulu -o library.lbr -a file -x ' QLUX:LIBRARY.LBR (?=HELP)>>put -a file -x ' ' A0:ROOT>ark archive.ark newfile.fil ' QLUX:ARCHIVE.ARK (?=HELP)>>put newfile.fil ' ' A0:ROOT>setd library.lbr 09/22/89 existing.fil /o ' QLUX:LIBRARY.LBR (?=HELP)>>date 09/22/89 existing.fil /o ' ' A0:ROOT>ads archive.ark 09/22/89 13:54 specific.fil ' QLUX:ARCHIVE.ARK (?=HELP)>>date 09/22/89 13:54 specific.fil ' ' Another new directory command is SD where you can see ALL the ' files in the current DU: (as opposed to FILES allowing you to ' see only the files with the same .EXTent as the file QLUX is ' currently attached to). ' ' QLUX presently does not support DU: specifications. One way to ' kludge your way around this is to use the following ARUNZ alias: ' ' LUX $td1$tu1:;qlux $*;$hb: ' ' This alias will allow you to access a LBR/ARC/ARK/ZIP/LZH file ' in any DU: from the ZCPR3 command A0> prompt. However, you will ' not be able to successfully access a LBR/ARC/ARK/ZIP/LZH file ' in a specific DU: from the QLUX command prompt. If you use this ' ARUNZ LUX alias approach, it will be assumed that the program will ' be named QLUX.COM. ' ' Provided additional ways to exit program (Q, E, X, CPM), put ' help menu in program, plus a few other minor changes. ' ' Comment out any commands you do not want to use and any parts of ' the help menu you do not want to be shown. This configuration of ' QLUX has the command line buffer (aka MCL) located at F500. ' Change that address and put together with BASCOM and L80 (or ' whatever linker you may have). ' - Sean N. Sullivan ' ' .......................................................................... ' ' v 1.10 QLUX replaces any variant of the standard LUX program. May be ' 09/17/89 used locally or with BYE present as long as MCL is correct. ' Version 1.10 configured for QBBS usage. MCL routines courtesy ' of Chris Mcewen (Socrates QBBS 201/754-9067). ' - Lawrence Davis - Glendale Litera QBBS - 818/956-6164 ' ' .......................................................................... ' DEFINT A-Z 'all integers DIM FIL$(6) ON ERROR GOTO 1100 FALSE=0 TRUE=NOT FALSE ' *** OPTION AREA *** ' --- address of external command line buffer in hexadecimal (&H + address) MCL=&HF500 ' --- print command line that gets poked into MCL DEBUG=FALSE ' --- pass all commands to MCL PASSCMD=FALSE ' --- Define programs to execute commands LBRDIR$="LDIR" 'LDIR15 ZIPDIR$="UNZIP" 'UNZIP099 ARCDIR$="UNARC" 'UNARC16 LZHDIR$="LHVW" 'LHVW11 'MODEM$="ZMD" 'ZMD150 MODEM$="KMD" 'KMD23 ZMODEM$="RZMP" 'RZMP16 LBRTYP$=LBRDIR$ ARCTYP$=ARCDIR$ LZHTYP$=LZHDIR$ ZIPTYP$=ZIPDIR$ MENU$="MENU" 'Your menu program ' *** END OF OPTION AREA *** HEADER=false VERS$="1.21" BEL$=CHR$(7) ' ** filetypes ** LBR$="LBR" ARC$="ARC" ARK$="ARK" ZIP$="ZIP" LZH$="LZH" ' ** get command tail from CP/M CALL CTAIL(CMD$) ' ** help if empty command line IF CMD$="" OR CMD$="//" OR CMD$="?" _ THEN PRINT "QLUX, version "+VERS$:_ PRINT "Syntax:": _ PRINT " LUX ":_ PRINT "Attaches to LBR, ARC, ARK, ZIP, LZH file":_ END ' ** disable ^C when BYE is running POKE 0,&HCD ' ** Get return character so we don't have to check the filetype again RET$=RIGHT$(CMD$,2) IF RET$=" L" THEN TYP$=LBR$:LBR=TRUE:RET=TRUE IF RET$=" A" THEN TYP$=ARC$:LBR=FALSE:ARC=TRUE:RET=TRUE IF RET$=" K" THEN TYP$=ARK$:LBR=FALSE:ARC=TRUE:RET=TRUE IF RET$=" Z" THEN TYP$=ZIP$:ZIP=TRUE:RET=TRUE IF RET$=" H" THEN TYP$=LZH$:LZH=TRUE:RET=TRUE ' ** parse filename IF RET THEN FIL$=LEFT$(CMD$,LEN(CMD$)-2):GOTO 20 2 LBR=FALSE ' ** check for DU$/DRV$ and ignore leaving filename in CMD$ COLON=INSTR(CMD$,":") IF COLON>0 _ THEN DU$=LEFT$(CMD$,COLON-1):DRV$=LEFT$(DU$,1):CMD$=MID$(CMD$,COLON+1) ' ** get rid of filetype, if any (we can't trust the user to be consistent) DOT=INSTR(CMD$,".") IF DOT >0 THEN CMD$=LEFT$(CMD$,DOT-1) ' ** print header first time through IF HEADER THEN PRINT:PRINT "QLUX - v"+VERS$ ' ** check all valid filetypes and flag accordingly FIL$(1)=CMD$+"."+LBR$ OPEN "I",1,FIL$(1) FIL$=FIL$(1):TYP$=LBR$:RET$=" L" LBR=TRUE GOTO 10 3 FIL$(2)=CMD$+"."+ARC$ OPEN "I",1,FIL$(2) FIL$=FIL$(2):TYP$=ARC$:RET$=" A" GOTO 10 4 FIL$(3)=CMD$+"."+ARK$ OPEN "I",1,FIL$(3) FIL$=FIL$(3):TYP$=ARK$:RET$=" K" GOTO 10 5 FIL$(4)=CMD$+"."+ZIP$ OPEN "I",1,FIL$(4) FIL$=FIL$(4):TYP$=ZIP$:RET$=" Z" ZIP=TRUE GOTO 10 6 FIL$(5)=CMD$+"."+LZH$ OPEN "I",1,FIL$(5) LZH=TRUE FIL$=FIL$(5):TYP$=LZH$:RET$=" H" 10 CLOSE IF NOT RET THEN DOT=INSTR(FIL$,"."):FIL$=LEFT$(FIL$,DOT-1) ' ** determine name of appropriate directory program IF LBR THEN DTYPE$=LBRDIR$ ELSE DTYPE$=ARCDIR$ IF ZIP THEN DTYPE$=ZIPDIR$ IF LZH THEN DTYPE$=LZHDIR$ 15 ' ** send filename to directory program CHAIN$=DTYPE$+" "+FIL$ IF LBR THEN CHAIN$=CHAIN$+"."+LBR$ GOTO 100 20 ' *** QLUX PROMPT AND INPUT ROUTINE *** PRINT:PRINT "QLUX:"FIL$+"."+TYP$+" (?=HELP)>>"; INPUT "",QCMD$ ' *** RESIDENT COMMANDS *** ' --- IF QCMD$="" THEN 20 CALL UCASE(QCMD$) ' --- HELP IF QCMD$="?" OR QCMD$="HELP" OR QCMD$="/" _ THEN 30 ' --- DIR IF QCMD$="DIR" _ THEN 10 ' --- SD IF QCMD$="SD" _ THEN CHAIN$="DIR":GOTO 100 ' --- FILES IF QCMD$="FILES" _ THEN CHAIN$="DIR *."+TYP$:GOTO 100 ' --- FOR 'IF QCMD$="FOR" _ ' THEN CHAIN$=QCMD$:GOTO 100 ' --- NEW 'IF QCMD$="NEW" _ ' THEN CHAIN$=QCMD$:GOTO 100 ' --- TYPE IF LEFT$(QCMD$,4)="TYPE" AND LBR _ THEN CHAIN$="LT "+FIL$+MID$(QCMD$,5):GOTO 100 IF LEFT$(QCMD$,4)="TYEP" AND LBR _ THEN CHAIN$="LT "+FIL$+MID$(QCMD$,5):GOTO 100 IF LEFT$(QCMD$,4)="TYPE" AND ZIP _ THEN PRINT:PRINT "++ Cannot type ZIPped files ++":GOTO 100 IF LEFT$(QCMD$,4)="TYEP" AND ZIP _ THEN PRINT:PRINT "++ Cannot type ZIPped files ++":GOTO 100 IF LEFT$(QCMD$,4)="TYPE" AND ARC _ THEN CHAIN$=ARCTYP$+" "+FIL$+MID$(QCMD$,5):GOTO 100 IF LEFT$(QCMD$,4)="TYEP" AND ARC _ THEN CHAIN$=ARCTYP$+" "+FIL$+MID$(QCMD$,5):GOTO 100 IF LEFT$(QCMD$,4)="TYPE" AND LZH _ THEN CHAIN$=LZHTYP$+" "+FIL$+MID$(QCMD$,5):GOTO 100 IF LEFT$(QCMD$,4)="TYEP" AND LZH _ THEN CHAIN$=LZHTYP$+" "+FIL$+MID$(QCMD$,5):GOTO 100 ' --- GET IF LEFT$(QCMD$,3)="GET" AND LBR _ THEN CHAIN$="LGET "+FIL$+" "+MID$(QCMD$,5):GOTO 100 IF LEFT$(QCMD$,3)="GET" AND ZIP _ THEN CHAIN$="UNZIP "+FIL$+" "+MID$(QCMD$,5):GOTO 100 IF LEFT$(QCMD$,3)="GET" AND ARC _ THEN CHAIN$="UNARC "+FIL$+" "+MID$(QCMD$,5):GOTO 100 IF LEFT$(QCMD$,3)="GET" AND LZH _ THEN CHAIN$="LHRD "+FIL$+" "+MID$(QCMD$,5):GOTO 100 ' --- OUTSIDE FILES IF LEFT$(QCMD$,2)="CR" AND LBR _ THEN CHAIN$="CR "+MID$(QCMD$,4):GOTO 100 IF LEFT$(QCMD$,4)="UNCR" _ THEN CHAIN$="UNCR "+MID$(QCMD$,6):GOTO 100 IF LEFT$(QCMD$,2)="LT" _ THEN CHAIN$="LT "+MID$(QCMD$,4):GOTO 100 IF LEFT$(QCMD$,4)="READ" _ THEN CHAIN$="LT "+MID$(QCMD$,6):GOTO 100 IF LEFT$(QCMD$,4)="VIEW" _ THEN CHAIN$="LT "+MID$(QCMD$,6):GOTO 100 IF LEFT$(QCMD$,3)="VDE" _ THEN CHAIN$="VDE "+MID$(QCMD$,5):GOTO 100 IF LEFT$(QCMD$,4)="ZCMD" _ THEN CHAIN$=MID$(QCMD$,6):GOTO 100 ' --- PUT IF LEFT$(QCMD$,3)="PUT" AND LBR _ THEN CHAIN$="LPUT "+FIL$+" "+MID$(QCMD$,5):GOTO 100 IF LEFT$(QCMD$,4)="NULU" AND LBR _ THEN CHAIN$="NULU "+FIL$+" "+MID$(QCMD$,5):GOTO 100 IF LEFT$(QCMD$,3)="PUT" AND ARC _ THEN CHAIN$="ARK "+FIL$+" "+MID$(QCMD$,5):GOTO 100 ' --- DATE IF LEFT$(QCMD$,4)="DATE" AND LBR _ THEN CHAIN$="SETD "+FIL$+" "+MID$(QCMD$,5):GOTO 100 IF LEFT$(QCMD$,4)="DATE" AND ARC _ THEN CHAIN$="ADS "+FIL$+" "+MID$(QCMD$,5):GOTO 100 ' --- SEND 'IF LEFT$(QCMD$,5)="SEND " _ ' THEN CHAIN$=MODEM$+" L "+FIL$+" "+MID$(QCMD$,6):GOTO 100 ' --- SEND ALL (ZMD defaults to 1k so no need for SK) 'IF QCMD$="SENDALL" _ ' THEN CHAIN$=MODEM$+" S "+FIL$+"."+TYP$:GOTO 100 ' (Just in case you only use KMD) 'IF QCMD$="SENDALL" _ ' THEN CHAIN$=MODEM$+" SK "+FIL$+"."+TYP$:GOTO 100 ' --- ZSENDALL 'IF QCMD$="ZSENDALL" _ ' THEN CHAIN$=ZMODEM$+" S "+FIL$+"."+TYP$:GOTO 100 ' --- CHAT 'IF QCMD$="CHAT" _ ' THEN CHAIN$="CHAT":GOTO 100 ' --- COMMENT 'IF QCMD$="COMMENT" _ ' THEN CHAIN$="QBBS C":GOTO 100 ' --- LUX (login to another file) IF LEFT$(QCMD$,3)="LUX" _ THEN CMD$=MID$(QCMD$,5):RET=FALSE:HEADER=FALSE:GOTO 2 ' --- MENU (exit to MENU program without return) 'IF QCMD$="MENU"_ ' THEN CHAIN$=MENU$:GOTO 110 ' --- BYE 'IF QCMD$="BYE" _ ' THEN POKE 0,&HC3:PRINT:PRINT BEL$;"++ Type BYE to Logoff ++":END ' --- QUIT IF LEFT$(QCMD$,1)="Q" OR LEFT$(QCMD$,1)="E" OR QCMD$="X" OR QCMD$="CPM" _ THEN POKE 0,&HC3:END ' ** pass any command to MCL IF PASSCMD _ THEN CHAIN$=QCMD$:GOTO 100 ' ** oops...= PRINT:PRINT BEL$;"++ Command Error ++" 30 ' *** DISPLAY HELP MENU *** CMD=32:DAT=0:GOSUB 120 PRINT PRINT "QLUX Commands:":PRINT PRINT "DIR Archive Directory" PRINT "SD Disk directory (all files in current DU:)" PRINT "FILES Disk directory (LBR, ARC/ARK, LZH or ZIP)" 'PRINT "FOR Description of uploaded files" 'PRINT "NEW List of new uploaded files" PRINT "TYPE Type member text file (LBR, ARC/ARK, LZH only)" PRINT "GET Extract member file" PRINT "PUT Insert new member file (LBR, ARC/ARK only)" PRINT "NULU <....> LiBRary Utility operation (LBR only)" PRINT "DATE <....> Stamp date/time (LBR, ARC/ARK only)" PRINT "CR <....> Crunch file found outside archive" PRINT "UNCR <....> Uncrunch file found outside archive" PRINT "LT/READ/VIEW <....> Type file found outside archive" PRINT "VDE <....> Edit file found outside archive" 'PRINT "SEND Xmodem send member file (LBR, ARC/ARK only)" 'PRINT "SENDALL X/Ymodem send entire LBR, ARC/ARK, LZH, ZIP" 'PRINT "ZSENDALL Zmodem send entire LBR, ARC, ARK, LZH, ZIP" 'PRINT "CHAT Chat with the Sysop (if available)" 'PRINT "COMMENT Enter a private comment to the Sysop" PRINT "LUX Attach to new LBR, ARC/ARK, LZH, ZIP" PRINT "ZCMD <....> Z-System command" 'PRINT "MENU Menu system" 'PRINT "BYE Logoff" PRINT "Q[uit], E[xit], X System exit" GOTO 20 100 ' ** append LUX + filename + filetype flag CHAIN$=CHAIN$+";LUX "+FIL$+RET$ ' ** exit without return to LUX 110 ' ** routines to poke MCL in ZCMD or ZCPR CMDLEN=LEN(CHAIN$)+1 CMDSEP=4 J=1 WHILE J<=CMDLEN-1 POKE MCL+J+3,ASC(MID$(CHAIN$,J,1)) J=J+1 WEND POKE MCL+J+3,0 POKE MCL+3,CMDLEN POKE MCL,CMDSEP IF DEBUG THEN PRINT:PRINT CHAIN$ POKE 0,&HC3 END 120 ' ** BDOS call CALL BDOS(CMD,DAT,RES) RETURN 1100 ' ** error handlers IF ERL=2 THEN CLOSE:RESUME 3 IF ERL=3 THEN CLOSE:RESUME 4 IF ERL=4 THEN CLOSE:RESUME 5 IF ERL=5 THEN CLOSE:RESUME 6 IF ERL=6 THEN CLOSE:PRINT:PRINT "++ File not Found ++":POKE 0,&HC3:END PRINT "ERROR";ERR;"ON LINE";ERL:END