'=========================================================================== ' Subject: DOS SHELL TYPE PROGRAM Date: 12-15-99 (17:47) ' Author: Randall L. Glass Code: PB ' Origin: rlglass@yahoo.com Packet: PB.ABC '=========================================================================== '------------------------------------------------------------------------- ' ' DShell Program ' CopyRight Aug3,1999 ' BY Randall L Glass ' '--------------------------------------------------------------------------- ' ' Email rlglass@yahoo.com ' '--------------------------------------------------------------------------- ' ' This Program is Freeware ' You may use this program for non-commerical use, As long As ' you give me credit somewhere in the documentation. ' ' No frills Program to travel thru directories, view files[Also "zip lzh ' files"],copy files,rename files,delete files,make directories,remove ' directories,rename directories,unarchive zip or lzh files ,or unarchive ' part of zip lzh files. ' ' You must SET the value of TEMP in your autoexec.bat file. ' Example SET TEMP = D:\TMP ' ' OR Rewrite the code in the program to set TempDir to your tempory directory. ' And Rewrite the code to your editor or file viewer. ' ' This Program uses assigns "Listr.com" to Viewer$ ' ' Fell Free To Add your own viewer to it instead of list. ' ' When you choose copy the Program Copies files from the directory you are ' looking at to the directory you run Dshell from. ' ' It is the same way with unarchive. ' '---------------------------------------------------------------------------- $DYNAMIC $HUGE $STACK 15000 DEFINT A-Z TYPE ZipType ' Zip File Header Signature AS DWORD Version AS WORD GPBFlag AS WORD ' Not sure Compress AS WORD ' Compression type FileTime AS WORD Filedate AS WORD ' Took a while to figure out CRC32 AS DWORD CompressSize AS DWORD UnCompressSize AS DWORD FileNameLen AS WORD ExtraField AS WORD END TYPE TYPE LZHHead HeadSize AS BYTE CheckSum AS BYTE Id1 AS STRING * 3 Method AS BYTE Id2 AS BYTE CompressSize AS DWORD UnCompressSize AS DWORD FileTime AS WORD FileDate AS WORD Attrs AS BYTE HeaderLevel AS BYTE FileNameLen AS BYTE FileName AS STRING * 12 END TYPE DECLARE Function GetKey%() AS INTEGER DECLARE SUB GetStrLoc() DECLARE SUB BoxBorder () DECLARE SUB Scroll(BYVAL TopRow%,BYVAL TopLeftCol%,BYVAL BottomRow%,BYVAL BottomRightCol%,BYVAL TotalLines%,BYVAL Attr%,BYVAL WhichWay%) DIM ScreenSegment AS shared WORD DIM DirStack$(50),ShellDir$(50),DirLoc%(50) DIM Directory$(10000), DirInfo$(10000) SHARED Directory$(), DirInfo$() SHARED Viewer$,TempDir$,StackPos%,DirStack$(), DirLoc%(),DirPos% SHARED StartLine$,EndLine$,FileList$,Response$,ExtractCmd$,ExtractReponse$ SHARED DosError??,ShellDir$(),ShellPos%,ExitShell%,DirStack% SHARED NextHandle%,LineSeg??,LinePtr??,NowDir$,NewPos%,DirChoice% SHARED TempDir$,RunBatch$,TD$,CrLf$,NewPosFlag%,DirDisplayPos% COLOR 0,1 CLS NewPosFlag% = instr(UTRIM$(Command$),"/RETURN") SearchPath$ = EXTRACT$(Command$," ") IF SearchPath$ = "" OR SearchPath$ = "/RETURN" THEN SearchPath$ = "\" ELSE SearchPath$ = SearchPath$ + "\" REPLACE "\\" WITH "\" IN SearchPath$ REPLACE "//" WITH "/" IN SearchPath$ END IF IF(PBVScreenCARD AND 1) = 0 THEN ScreenSegment?? = 47104 '&HB800 'color monitor ELSE ScreenSegment?? = 45056 '&HB000 'mono monitor END IF %PkSig = &H04034B50 ' Signature %UpArrow = -72:%DownArrow = -80:%Enter = 13:%Escape = 27 %Home = -71:%PageDown = -81:%PageUp = -73:%EndKey = -79 %Up = 6:%Down = 7:%LeftArrow = -75:%RightArrow = -77 %AltHome = -151:%AltA = -30:%AltV = -47 %AltU = -22:%AltC=-46:%AltD=-32:%AltR=-19:%AltN = -49:%AltM = -50:%AltH = -35:%F1 = -59 %ReadOnly = 1:%Hidden = 2:%System = 4:%Volume = 8:%SubDir = 16:%Archive = 32 %AllFiles = 33 Crlf$ = CHR$(13,10) COLOR 0,1 CLS Viewer$ = "listr.com" LastDir$ = SearchPath$ NowDir$ = CURDIR$ TD$ = ENVIRON$("TEMP") IF Td$ = "" THEN MKDIR "\TMP" TD$ = "\TMP" ELSE TempDir$ = TD$ + "\dosview" RunBatchDir$ = TD$ END IF IF NewPosFlag% AND FileExist%(TD$+"\Shelview.dat") THEN OPEN TD$+"\Shelview.dat" FOR INPUT AS #1 INPUT #1,DirChoice% INPUT #1,DirDisplayPos% DO INCR I% INPUT #1,DirLoc%(I%) LOOP UNTIL EOF(1) DirPos% = I% CLOSE #1 END IF IF FileExist%(TD$+"\Shelview.dat") THEN Kill TD$+"\Shelview.dat" IF FileExist%(TD$+"\Shelview.bat") THEN Kill TD$+"\Shelview.bat" ShellPos% = 0 DO DosShell LastDir$ CHDIR NowDir$ LOOP STOP SUB DosShell(ShellDirectory$) Choice% = 1:DisplayPos% = 1:LowFIle% = 1:HiFile% = 18:Ky% = 0 InfoLine$ = " FileName"+" Size"+" Date" + " Time" PushDir2 ShellDirectory$,ShellDir$(),ShellPos% IF NewPosFlag% THEN GOSUB GetAndSort INCR NewPos% IF NewPos% <= DirPos% THEN DosShell Directory$(DirLoc%(NewPos%)) ELSE Choice% = DirChoice% DisplayPos% = DirDisplayPos% NewPos$ = "" DirPos% = 0 END IF END IF DO GOSUB GetAndSort Pick% = ChooseProgram%( DirInfo$(),Directory$(),FilesInfo$,InfoLine$,Choice%,DisplayPos%,LowFile%,HiFile%,Ky%,DirNum%,"Directory") Ext$ = Extension$(Directory$(Pick%)) COLOR 0,7 SELECT CASE Ky% CASE %RightArrow,%Enter IF BitTest%(Attrib(RealDir$ + Directory$(Pick%)),4) THEN PushLoc Pick% DosShell(Directory$(Pick%)) COLOR 7,1 CLS ELSEIF ISFALSE BitTest%(Attrib(RealDir$ + Directory$(Pick%)),4) THEN SELECT CASE Ext$ CASE ".ZIP",".LZH" ShowZip(RealDir$ + Directory$(Pick%)) CASE ".EXE",".COM" IF Ky% = %Enter THEN DirFreeFile% = FREEFILE OPEN TD$ +"\ShelView.Dat" FOR OUTPUT AS #DirFreeFile% PRINT #DirFreeFile%,Choice% PRINT #DirFreeFile%,DisplayPos% FOR IX% = 1 to DirPos% PRINT #DirFreeFile%,DirLoc%(IX%) NEXT IX% CLOSE #DirFreeFile% DirFreeFile% = FREEFILE OPEN TD$ +"\ShelView.bat" for output as #DirFreeFile% Batch$ = "@cls" + CrLf$ + "@Echo off" + CrLf$ + RealDir$ + Directory$(Pick%) + CrLf$ Batch$ = Batch$ + "cls" + CrLf$ + ProgName$ +" RETURN" + CrLf$ PRINT #DirFreeFile%,Batch$ StuffBuffer TD$ +"\ShelView.bat"+chr$(13) CLOSE #DirFreeFile% SCREEN 0 CLS COLOR 0,0 LOCATE 1,1 PRINT STRING$(800,219) LOCATE 1,1,0 BIT RESET PbvSwitch,0 SYSTEM END IF CASE ELSE '".TXT",".DOC" ShellCmd$ = Viewer$ + " " + RealDir$ + Directory$(Pick%) SHELL ShellCmd$ ClearBuffer COLOR 7,1 CLS DELAY .1 END SELECT END IF CASE %LeftArrow DECR ShellPos% DECR DirPos% EXIT LOOP CASE %Escape CHDIR NowDir$ COLOR 7,0 CLS LOCATE 1,1 BIT RESET PbvSwitch,0 STOP CASE %AltC IF Pick% > 0 AND ISFALSE BitTest%(Attrib(RealDir$ + Directory$(Pick%)),4) THEN LOCATE 25,1:PRINT "Copy File " + Directory$(Pick%);:INPUT; "(Y/N) ?",YesNo$ IF UTRIM$(YesNo$) = "Y" THEN LOCATE 25,1:SHELL "COPY "+RealDir$ + Directory$(Pick%) +" "+NowDir$ END IF END IF CASE %AltD IF Pick% > 0 THEN IF ISFALSE BitTest%(Attrib(RealDir$ + Directory$(Pick%)),4) THEN PRINT "DELETE File " + Directory$(Pick%);:INPUT; "(Y/N) ?",YesNo$ IF UTRIM$(YesNo$) = "Y" THEN LOCATE 25,1:SHELL "DEL "+RealDir$ + Directory$(Pick%) END IF ELSEIF BitTest%(Attrib(RealDir$ + Directory$(Pick%)),4) THEN PRINT "DELETE Directory " + Directory$(Pick%);:INPUT; "(Y/N) ?",YesNo$ IF UTRIM$(YesNo$) = "Y" THEN LOCATE 25,1:SHELL "RD "+RealDir$ + Directory$(Pick%) END IF END IF END IF CASE %AltR IF Pick% > 0 THEN IF ISFALSE BitTest%(Attrib(RealDir$ + Directory$(Pick%)),4) THEN LOCATE 25,1 Print "RENAME ";Directory$(Pick%);" TO What ? "; Input;, NewName$:PRINT " "; IF NewName$ <> "" THEN INPUT; "Continue ? (Y/N)",YesNo$ IF UTRIM$(YesNo$) = "Y" THEN LOCATE 25,1:SHELL "RENAME "+ RealDir$ + Directory$(Pick%) + " " + NewName$ END IF ELSEIF BitTest%(Attrib(RealDir$ + Directory$(Pick%)),4) THEN LOCATE 25,1 Print "RENAME ";Directory$(Pick%);" TO What ? "; Input;, NewDirName$:PRINT " "; IF NewDirName$ <> "" THEN INPUT;"Continue ? (Y/N)",YesNo$ IF UTRIM(YesNo$) = "Y" THEN LOCATE 25,1:SHELL "MOVE "+ RealDir$ + Directory$(Pick%) + " " + RealDir$ + NewDirName$ END IF END IF END IF CASE %AltM LOCATE 25,1 INPUT; "New Directory Name ? ", NewDirName$ IF NewDirName$ <> "" THEN INPUT;"Continue ? (Y/N)",YesNo$ IF UTRIM(YesNo$) = "Y" THEN LOCATE 25,1:SHELL "MD " + RealDir$ + NewDirName$ END IF CASE %AltU IF ISFALSE BitTest%(Attrib(RealDir$ + Directory$(Pick%)),4) THEN LOCATE 25,1 PRINT "Unarchive ";Directory$(Pick%);:INPUT;" ? (Y/N)";YesNo$ IF UTRIM$(YesNo$) = "Y" THEN COLOR 7,0 CLS SELECT CASE Ext$ CASE ".ZIP" SHELL "PKUNZIP -d "+ RealDir$ + Directory$(Pick%) + " " + NowDir$ CASE ".LZH" IF RIGHT$(UTRIM$(NowDir$),1) <> "\" THEN UnLhaDir$ = NowDir$ + "\" ELSE UnLhaDir$ = NowDir$ END IF SHELL "LHA.EXE X " + RealDir$ + Directory$(Pick%) + " " +UnLhaDir$ END SELECT COLOR 0,1 END IF END IF CASE %AltV SHELL Viewer$ + " " + RealDir$ + Directory$(Pick%) ClearBuffer COLOR 7,1 CLS DELAY .1 CASE %AltH,%F1 Help CASE %AltA About END SELECT LOOP EXIT SUB GetAndSort: TotalFiles% = 0 RealDir$ = AddSlash$(TrueDir2$(ShellDir$(), ShellPos%)) GetDirs RealDir$ + "*.*", Directory$(), DirInfo$(), FilesInfo$, TotalFiles% DirNum% = TotalFiles% IF DirNum% > 1 THEN ARRAY SORT Directory$(1) FOR TotalFiles%,TagArray DirInfo$() GetFiles RealDir$ + "*.*", Directory$(), DirInfo$(), FilesInfo$, TotalFiles% SortNumber% = TotalFiles - DirNum% IF SortNumber% > 1 THEN FileStart% = DirNum% + 1 ARRAY SORT Directory$(FileStart%) FOR SortNumber%,TagArray DirInfo$() END IF RETURN END SUB SUB ShowZip(File$) COLOR 0,1 CLS LOCATE 1,1,0 Ext$ = Extension$(File$) File$ = TrueName$(File$) IF ISFALSE FileExist%(File$) THEN EXIT SUB PushDir TempDir$ ViewZip File$ PopDir SHELL "DELTREE /Y " + Rtrim$(RealDir$,"\") + " >NUL" COLOR 7,1 CLS END SUB SUB ViewZip(File$) IF ISFALSE FileExist%(File$) THEN LOCATE 5,15:PRINT File$;" doesn't exist !"; EXIT SUB END IF DIM ArchiveFiles$(10000),ArchiveInfo$(10000),ArchiveDir$(10000) Choice% = 1:DisplayPos% = 1:LowFIle% = 1:HiFile% = 18 Ky% = 0 InfoLine$ = " FileName"+" Size"+" Date" + " Time" Ext$ = Extension$(File$) IF Ext$ = ".ZIP" OR Ext$ = ".LZH" THEN PresentDir$ = CURDIR$ PresentDrive$ = CURDRIVE$ CHDRIVE Left$(File$,1) CHDIR GetDirectory$(File$) SELECT CASE Ext$ CASE ".ZIP" ZipView GetFileName$(File$), ArchiveFiles$(), ArchiveInfo$(), FilesInfo$, Success% CASE ".LZH" LzhView GetFileName$(File$), ArchiveFiles$(), ArchiveInfo$(), FilesInfo$, Success% END SELECT CHDRIVE PresentDrive$ CHDIR PresentDir$ IF ISFALSE Success% THEN EXIT SUB TotalFiles?? = CVWRD(ArchiveFiles$(0)) 'ARRAY SORT ArchiveFiles$(1) FOR TotalFiles??,TAGARRAY ArchiveInfo$() DO Pick% = ChooseProgram%( ArchiveInfo$(),ArchiveFiles$(),FilesInfo$,InfoLine$,Choice%,DisplayPos%,LowFile%,HiFile%,Ky%,0,"") Choice% = Pick% SELECT CASE Ky% CASE %Escape CHDIR NowDir$ COLOR 7,0 CLS LOCATE 1,1,0 BIT RESET PbvSwitch,0 STOP CASE %LeftArrow EXIT SUB CASE %RightArrow,%Enter,%AltV IF Pick% > 0 THEN Pick$ = UCASE$(ArchiveFiles$(Pick%)) RealName$ = GetFileName$(Pick$) PickExt$ = Extension$(Pick$) IF (PickExt$ =".ZIP" OR PickExt$ = ".LZH") AND Ky% <> %AltV THEN PushDir "TEMP" RealDir$ = TrueDir$ + "\" IF ISFALSE FileExist%(RealDir$+Pick$) THEN SELECT CASE Ext$ CASE ".ZIP" SHELL "PKUNZIP -e -o " + File$ + " " + Pick$ + " " + RealDir$ + " >NUL" 'SHELL "UNZIP " + File$ + " " + Pick$ + " " + "-d" + RealDir$ + " >NUL" CASE ".LZH" SHELL "lha.exe e /pn2 " + File$ + " " + RealDir$ + " "+ Pick$ END SELECT END IF fe% = FetchErrorLevel% IF FetchErrorLevel% > 0 THEN SHELL "DELTREE /Y " + Rtrim$(RealDir$,"\") + " >NUL" EXIT SUB END IF ViewZip RealDir$ + RealName$ SHELL "DELTREE /Y " + Rtrim$(RealDir$,"\") + " >NUL" PopDir COLOR 7,1 CLS DELAY .1 ITERATE LOOP ELSE RealDir$ = TrueDir$ + "\" SELECT CASE Ext$ CASE ".ZIP" SHELL "PKUNZIP -e -o " + File$ + " " + Pick$ + " " + RealDir$ ' + " >NUL" 'SHELL "UNZIP " + File$ + " " + Pick$ + " " + "-d" + RealDir$ ' + " >NUL" CASE ".LZH" SHELL "lha.exe e /pn2 " + File$ + " " + RealDir$ + " "+ Pick$ END SELECT END IF 'CLS fe% = FetchErrorLevel% IF FetchErrorLevel% > 0 THEN SHELL "DELTREE /Y " + Rtrim$(RealDir$,"\") + " >NUL" EXIT SUB END IF PresentDir$ = CURDIR$ PresentDrive$ = CURDRIVE$ CHDRIVE LEFT$(TrueDir$,1) CHDIR TrueDir$ SHELL Viewer$ + " " + RealName$ ClearBuffer COLOR 7,1 CLS KILL RealName$ CHDRIVE PresentDrive$ CHDIR PresentDir$ DELAY .1 END IF CASE %AltU IF Pick% > 0 THEN Pick$ = UCASE$(ArchiveFiles$(Pick%)) RealName$ = GetFileName$(Pick$) RealDir$ = NowDir$ CLS SELECT CASE Ext$ CASE ".ZIP" SHELL "PKUNZIP -e -o " + File$ + " " + Pick$ + " " + RealDir$ ' + " >NUL" CASE ".LZH" SHELL "lha.exe e /pn2 " + File$ + " " + RealDir$ + " "+ Pick$ END SELECT DELAY .2 CLS END IF CASE %AltA ABOUT CASE %AltH,%F1 ZipHelp END SELECT LOOP END IF COLOR 0,1 END SUB FUNCTION ChooseProgram%(ArchiveInfo$(),ArchiveFile$(),InfoLine1$,InfoLine2$ ,Choice%, DisplayPos%,LowFile%, HiFile%,Ky%,DirNum%,ChooseType$) DIM PrintLine AS STRING * 47 DIM DirLine AS STRING * 80 DisplayLine% = 18 TotalFiles% = CVWRD(ArchiveInfo$(0)) IF TotalFiles% < DisplayLine% THEN HiFile% = TotalFiles% BottomDisplayLine% = DisplayLine% COLOR 7,1 CLS COLOR 0,7 LOCATE 1,1:PRINT SPACE$(80); COLOR 7,1 LOCATE 2,2:PRINT Ltrim$(InfoLine1$) LOCATE 4,2:PRINT InfoLine2$ DO COLOR 15, 1 LinePos% = 0 IF TotalFiles% < 15 THEN BottomDisplayLine% = TotalFiles% IF ScrollIt% = 0 THEN 'POKE$ 0, SaveScreen$ : LOCATE y%, x% 'restore old screen FOR ArchiveFile% = LowFile% TO HiFile% INCR LinePos% LSET PrintLine$ = ArchiveInfo$(ArchiveFile%) IF LinePos% = DisplayPos% THEN QPrint 5 + LinePos%,1, PrintLine$ ,71 ELSE QPRINT 5 + LinePos%,1,PrintLine$,23 END IF NEXT ArchiveFile% LSET PrintLine$ = "" FOR I% = LinePos% + 1 To DisplayLine% QPRINT 5 + I%,1,PrintLine$,23 NEXT I% ELSE LSET PrintLine$ = ArchiveInfo$(Choice%) QPRINT 5 + DisplayPos%,1,PrintLine$,71 END IF DirLine$ = SPACE$(80) MID$(DirLine$,2) = ArchiveFile$(Choice%) COLOR 0,7:LOCATE 25,1:PRINT DirLine$; ScrollIt% = 0 ClearBuffer DO: ky$ = UCASE$(INKEY$): LOOP WHILE ky$ = "" Ky% = ASC(ky$): IF Ky% = 0 THEN Ky% = -ASC(MID$(ky$, 2)) SELECT CASE Ky% CASE %Enter,%RightArrow ChooseProgram% = choice%: EXIT DO CASE %Escape ChooseProgram% = 0: EXIT DO CASE %Home choice% = 1:LowFile% = 1 HiFile% = BottomDisplayLine% DisplayPos% = 1 CASE %EndKey Choice% = TotalFiles% DisplayPos% = MODTYPE(Choice%, BottomDisplayLine%) LowFile% = Choice% - DisplayPos% + 1 HiFile% = TotalFiles% CASE %PageDown INCR Choice%, DisplayLine% INCR LowFile%,DisplayLine% HiFile% = LowFile% + BottomDisplayLine% -1 IF HiFile% > TotalFiles% THEN HiFile% = TotalFiles% IF choice% > TotalFiles% THEN Choice% = TotalFiles% DisplayPos% = ModType(Choice%, BottomDisplayLine%) LowFile% = Choice% - DisplayPos% + 1 HiFile% = TotalFiles% END IF CASE %PageUp DECR Choice%,DisplayLine% DECR LowFile%,DisplayLine% HiFile% = LowFile% + DisplayLine% -1 IF LowFile% < 1 THEN LowFile% = 1:HiFile% = BottomDisplayLine% IF Choice% <=1 THEN Choice% = 1 LowFile% = 1 HiFile% = BottomDisplayLine% DisplayPos% = 1 END IF CASE %DownArrow INCR Choice% IF Choice% <= TotalFiles% THEN INCR DisplayPos% ELSE Choice% = TotalFiles% END IF IF DisplayPos% > BottomDisplayLine% THEN DisplayPos% = BottomDisplayLine% LowFile% = Choice% -BottomDisplayLine% + 1 IF HiFile% >= TotalFiles% THEN HiFile% = TotalFiles% ELSE HiFile% = LowFile% + BottomDisplayLine% -1 END IF PrintAtr BottomDisplayLine%+5, 1, 47, 23 Scroll 5,1, BottomDisplayLine%+4,47, 1,23,%Up ScrollIt% = 1 END IF CASE %UpArrow DECR choice% DECR DisplayPos% IF choice% <=1 THEN choice% = 1 LowFile% = 1 HiFile% = BottomDisplayLine% DisplayPos% = 1 ELSE IF DisplayPos% < 1 THEN DisplayPos% = 1 LowFile% = Choice% HiFile% = Choice% + BottomDisplayLine% -1 IF HiFile% >= TotalFiles% THEN HiFile% = TotalFiles% ELSE HiFile% = LowFile% + BottomDisplayLine% -1 END IF PrintAtr 6, 1, 47, 23 Scroll 5,1, BottomDisplayLine%+4,47, 1,23,%Down ScrollIt% = 1 END IF END IF CASE 48 TO 57,65 TO 90 IF ChooseType$ = "Directory" THEN ScanFiles% = TotalFiles% - Choice% ARRAY SCAN ArchiveInfo$(Choice% + 1) FOR ScanFiles% ,FROM 2 TO 2,=Ky$,To PossibleChoice% IF PossibleChoice% > 0 THEN Choice% = Choice% + PossibleChoice% ELSEIF PossibleChoice% = 0 THEN ARRAY SCAN ArchiveInfo$(1) FOR Choice% - 1 ,FROM 2 TO 2,=Ky$,To PossibleChoice% IF PossibleChoice% > 0 THEN Choice% = PossibleChoice% END IF IF PossibleChoice% > 0 THEN LowFile% = Choice% - DisplayPos% + 1 HiFile% = LowFile% + BottomDisplayLine% -1 IF LowFile% < 1 THEN LowFile% = 1:HiFile% = BottomDisplayLine%:DisplayPos% = Choice% IF HiFile% > TotalFiles% THEN HiFile% = TotalFiles% END IF END IF CASE -255 to -1 ChooseProgram% = choice%: EXIT DO CASE ELSE EXIT DO END SELECT LOOP COLOR 7,0 END FUNCTION SUB Scroll(BYVAL TopRow%,BYVAL TopLeftCol%,BYVAL BottomRow%,BYVAL BottomRightCol%,BYVAL TotalLines%,BYVAL Attr%,BYVAL WhichWay%) ! PUSH DS ! PUSH BP ! MOV AH,WhichWay% ! MOV AL, TotalLines% ! MOV BH, Attr% ! MOV CH, TopRow% ! MOV CL, TopLeftCol% ! MOV DH, BottomRow% ! MOV DL, BottomRightCol% ! INT &H10 ! POP BP ! POP DS END SUB SUB QPrint(BYVAL Row, BYVAL Col, BYVAL Text$, BYVAL attr) PUBLIC ScreenSeg?? = ScreenSegment?? ! push DS ; save DS for PowerBASIC ! mov ax,Row% ; get the row ! dec al ; convert row to zero base ! mov bl,80 ; get the number of cols ! mul bl ; multiply # of cols * rows ! add ax,Col% ; add the column ! dec al ; convert column to zero base ! mov di,ax ; offset within video page ! shl di,1 ; account for color/attribute ! push WORD PTR Text$ ; push string handle on the stack ! call GetStrLoc ; find the string ! jcxz QPExit ; if it's Null, exit ! mov DS, DX ; put segment in DS ! mov SI, AX ; put offset in SI ! mov ES, ScreenSeg?? ; move to ES ! mov AH, attr ; put attribute in AH WriteChar: ! lodsb ; get Char from string ! stosw ; write Char and attribute to screen ! loop WriteChar ; do it all CX times QPExit: ! pop DS ; restore DS for PowerBASIC END SUB SUB PrintAtr(byval Row%, byval Col%,ByVal LineWidth%, byval Attr%) ScreenSeg?? = ScreenSegment?? ! push ds ;save the good stuff ! mov ax,Row% ; get the row ! dec al ; convert row to zero base ! mov bl,80 ; get the number of cols ! mul bl ; multiply # of cols * rows ! add ax,Col% ; add the column ! dec al ; convert column to zero base ! mov di,ax ; offset within video page ! shl di,1 ; account for color/attribute ! mov es,ScreenSeg?? ;put video segment into ax ! mov ah,Attr% ;the color attribute will be needed ! mov cx,LineWidth% forloop: ! inc di ;increment to the next vidram position ! mov es:[di],ah ;poke the attribute into vidram ! inc di ! loop forloop ;loop until cx = 0 ! pop ds END SUB FUNCTION GetKey%() Public While ISFALSE INSTAT:Wend ky$ = Inkey$ IF len(ky$) = 2 then GetKey% = -ascii(right$(ky$,1)) ELSE GetKey% = ascii(ky$) END IF END FUNCTION SUB ClearBuffer DO:LOOP UNTIL INKEY$ = "" END SUB SUB GetDirs(Spec$,Directory$(), DirInfo$(), FilesInfo$, TotalDirs%) DIM FileName AS STRING * 8 DIM Ext AS STRING * 4 DirFile$ = DIR$(Spec$,16) IF DirFile$ <> "" THEN GetDirInfo DirDate$,DirTime$,DirSize???,DirAttr? IF BIT(DirAttr?,4) THEN INCR TotalDirs% Directory$(TotalDirs%) = DirFile$ LSET FileName$ = Extract$(DirFile$,".") LSET Ext$ = Extension$(DirFile$) IsDir$ = "" DirInfo$(TotalDirs%) = " " + FileName$ + Ext$ + " " + IsDir$ + " " + " "+DirDate$ + " " + DirTime$ END IF ELSE GOTO StoreInfo2 END IF DO DirFile$ = DIR$ IF DirFile$ <> "" THEN GetDirInfo DirDate$,DirTime$,DirSize???,DirAttr? IF BIT(DirAttr?,4) THEN INCR TotalDirs% Directory$(TotalDirs%) = DirFile$ LSET FileName$ = Extract$(DirFile$,".") LSET Ext$ = Extension$(DirFile$) IsDir$ = "" DirInfo$(TotalDirs%) = " " + FileName$ + Ext$ + " " + IsDir$ + " " + " "+DirDate$ + " " + DirTime$ END IF ELSE EXIT LOOP END IF LOOP StoreInfo2: FilesInfo$ = Spec$ + ":" + STR$(TotalDirs%)+" Directories And Files" DirInfo$(0) = MKWRD$(TotalDirs%) Directory$(0) = MKWRD$(TotalDirs%) END SUB SUB GetFiles(Spec$,Directory$(), DirInfo$(), FilesInfo$, TotalFiles%) DIM FileName AS STRING * 8 DIM Ext AS STRING * 4 DirFile$ = DIR$(Spec$,33) IF DirFile$ <> "" THEN GetDirInfo DirDate$,DirTime$,DirSize???,DirAttr? INCR TotalFiles% Directory$(TotalFiles%) = DirFile$ LSET FileName$ = Extract$(DirFile$,".") LSET Ext$ = Extension$(DirFile$) IsDir$ = " " DirInfo$(TotalFiles%) = " " + FileName$ + Ext$ + " " + IsDir$ + USING$("########",DirSize???) + " "+DirDate$ + " " + DirTime$ ELSE GOTO StoreInfo END IF DO DirFile$ = DIR$ IF DirFile$ <> "" THEN GetDirInfo DirDate$,DirTime$,DirSize???,DirAttr? INCR TotalFiles% Directory$(TotalFiles%) = DirFile$ LSET FileName$ = Extract$(DirFile$,".") LSET Ext$ = Extension$(DirFile$) IsDir$ = " " DirInfo$(TotalFiles%) = " " + FileName$ + Ext$ + " " + IsDir$ + USING$("########",DirSize???) + " "+DirDate$ + " " + DirTime$ ELSE EXIT LOOP END IF LOOP StoreInfo: DirInfo$(0) = MKWRD$(TotalFiles%) Directory$(0) = MKWRD$(TotalFiles%) END SUB SUB GetRegDir(Spec$,Attr%,Directory$(),TotalFiles%) DirFile$ = DIR$(Spec$,Attr%) IF DirFile$ <> "" THEN INCR FileNum% Directory$(FileNum%) = DirFile$ ELSE TotalFiles% = 0 EXIT SUB END IF DO DirFile$ = DIR$ IF DirFile$ <> "" THEN INCR FileNum% Directory$(FileNum%) = DirFile$ ELSE EXIT SUB END IF LOOP END SUB FUNCTION Extension$(File$) FOR I% = LEN(File$) TO 1 STEP -1 Period$ = MID$(File$,I%,1) IF Period$ = "." THEN Extension$ = RTRIM$(UCASE$(MID$(File$,I%))):EXIT FUNCTION NEXT I% END FUNCTION FUNCTION GetFileName$(F$) FOR I% = LEN(F$) TO 1 STEP -1 Char$ = MID$(F$,I%,1) IF Char$ = "\" OR CHAR$ = "/" THEN GetFileName$ = File$ EXIT FUNCTION ELSE File$ = Char$ + File$ END IF NEXT I% GetFileName$ = File$ END FUNCTION FUNCTION GetDirectory$(D$) Ln% = LEN(D$) FOR I% = Ln% TO 1 STEP -1 Char$ = MID$(D$,I%,1) IF Char$ = "\" OR CHAR$ = "/" THEN EXIT FOR NEXT I% IF I% <> 3 THEN TheDir$ = LEFT$(D$,I%-1) ELSE TheDir$ = LEFT$(D$,I%) END IF GetDirectory$ = TheDir$ END FUNCTION FUNCTION GetLastDir$(D$) Ln% = LEN(D$) Slash$ = RIGHT$(D$,1) IF Slash$ = "\" OR Slash$ = "/" THEN DECR Ln% FOR I% = Ln% TO 1 STEP -1 Char$ = MID$(TheDir$,I%,1) IF Char$ = "\" OR CHAR$ = "/" THEN EXIT FOR NEXT I% IF I% <> 3 THEN TheDir$ = INDEX$(D$,I%,Ln%) ELSE TheDir$ = LEFT$(D$,I%) END IF GetLastDir$ = TheDir$ END FUNCTION FUNCTION INDEX$(M$,StartPos%,LastPos%) INDEX$ = MID$(M$,StartPos%,LastPos% - StartPos% + 1) END FUNCTION FUNCTION GetDirAndSlash$(D$) Ln% = LEN(D$) FOR I% = Ln% TO 1 STEP -1 Char$ = MID$(D$,I%,1) IF Char$ = "\" OR CHAR$ = "/" THEN EXIT FOR NEXT I% IF I% <> 3 THEN TheDir$ = LEFT$(D$,I%) ELSE TheDir$ = LEFT$(D$,I%) END IF GetDirAndSlash$ = TheDir$ END FUNCTION FUNCTION AddSlash$(D$) TheDir$ = TrueName$(D$) IF LEN(TheDir$) > 3 AND RIGHT$(TheDir$,1) <> "\" THEN AddSlash$ = TheDir$ + "\" ELSE AddSlash$ = TheDir$ END IF END FUNCTION FUNCTION FileDirExist%(d$) Ln% = LEN(D$) FOR I% = Ln% TO 1 STEP -1 Char$ = MID$(D$,I%,1) IF Char$ = "\" OR CHAR$ = "/" THEN EXIT FOR NEXT I% FileDirExist% = I% END FUNCTION SUB PushDir(Directory$) IF Directory$ = "" THEN EXIT SUB INCR StackPos% DirStack$(StackPos%) = Directory$ IF DirExist%(TrueDir$) = 0 THEN MKDIR TrueDir$ END SUB SUB PushLoc(P%) IF P% = 0 THEN EXIT SUB INCR DirPos% DirLoc%(DirPos%) = P% END SUB SUB PopDir() DECR StackPos% END SUB FUNCTION TrueDir$() D$ = DirStack$(1) FOR I% = 2 to StackPos% IF RIGHT$(DirStack$(I% -1),1) <> "\" THEN D$ = D$ + "\" + DirStack$(I%) ELSE D$ = D$ + DirStack$(I%) END IF NEXT I% TrueDir$ = D$ END FUNCTION SUB PushDir2(Directory$,Stack$(),StackPos2%) PUBLIC IF Directory$ = "" THEN EXIT SUB INCR StackPos2% Stack$(StackPos2%) = Directory$ END SUB SUB PopDir2(StackPos2%) PUBLIC DECR StackPos2% END SUB FUNCTION TrueDir2$(Stack$(), StackPos2%) PUBLIC D$ = Stack$(1) FOR I% = 2 to StackPos2% IF RIGHT$(Stack$(I% -1),1) <> "\" THEN D$ = D$ + "\" + Stack$(I%) ELSE D$ = D$ + Stack$(I%) END IF NEXT I% TrueDir2$ = D$ END FUNCTION FUNCTION DirExist%(Directory$) DirName$ = DIR$(Directory$,16) IF DirName$ = "" THEN EXIT FUNCTION Exists% = ATTRIB(Directory$) Exists% = BIT(Exists%,4) IF Exists% THEN DirExist% = 1 END FUNCTION FUNCTION FileExist%(Directory$) D$ = DIR$(Directory$) IF D$ <> "" THEN FileExist% = 1 END FUNCTION FUNCTION TrueName$(Directory$) DIM Canonicalized AS STRING * 128 DirName$ = Directory$ +CHR$(0) DirNamePtr??? = STRPTR32(DirName$) CanonicalizedPtr??? = VARPTR32(Canonicalized$) DosError?? = 0 !PUSH DS !LDS SI,DirNamePtr??? !LES DI,CanonicalizedPtr??? !MOV AH,&H60 !INT &H21 !POP DS !JNC NoError !MOV DosError??,AX NoError: IF LEFT$(Canonicalized$,2) = "\\" THEN Drive$ = MID$(Canonicalized$,3,1)+":" Path$ = EXTRACT$(MID$(Canonicalized$,8),CHR$(0)) IF Path$ = "" THEN Path$ = "\" TrueName$ = EXTRACT$(Drive$ +Path$,CHR$(0)) ELSE TrueName$ = EXTRACT$(Canonicalized$,CHR$(0)) END IF END FUNCTION FUNCTION CURDRIVE$ Curdrive$ = LEFT$(CURDIR$,1) END FUNCTION FUNCTION MODTYPE??(Number%,ModNumber%) M% = Number% MOD ModNumber% IF M% = 0 THEN ModType% = ModNumber% ELSE ModType% = M% END IF END FUNCTION SUB LzhView(LzhFile$,ArchiveFiles$(),ArchiveInfo$(), FilesInfo$, Success%) DIM Lzh AS LZHHead DIM FileName AS STRING * 8 DIM Ext AS STRING * 4 FilePos??? = 0: QUIT% = 0 Handle% = FREEFILE OPEN LzhFile$ FOR BINARY AS Handle% RestOfFileSize??? = LOF(Handle%) IF RestOfFileSize??? = 0 THEN CLOSE Handle% PRINT LzhFile$+" has an FileSize of Zero !" Success% = 0 EXIT SUB END IF DO GET Handle%,FilePos???,Lzh IF Lzh.Id1 = "-lh" Or Lzh.Id1 = "-lz" Or Lzh.Id1 = "-lZ" THEN IF Lzh.HeadSize AND (Lzh.HeadSize < RestOfFileSize???) THEN Get Handle%,FilePos??? + Lzh.HeadSize,DirLen?? SEEK Handle%,FilePos??? + Lzh.HeadSize+3 IF DirLen?? > 0 AND DirLen?? < 256 THEN GET$ Handle%,DirLen??-3,Directory$ REPLACE CHR$(255) WITH "\" IN Directory$ ELSE Directory$ = "" END IF INCR FilePos???, Lzh.CompressSize + Lzh.HeadSize + 2 DECR RestOfFileSize???, FilePos??? INCR FileNumber?? File$ = LEFT$(Lzh.FileName,Lzh.FileNameLen) LSET FileName$ = Extract$(File$,".") LSET Ext$ = Extension$(File$) GetDateAndTime Lzh.Filedate,Lzh.FileTime,Filedate$,FileTime$ IF DirLen?? THEN DirSign$ = " + " ELSE DirSign$ = " " END IF ArchiveFiles$(FileNumber??) = Directory$ + File$ ArchiveInfo$(FileNumber??) = DirSign$ + FileName$ + Ext$ + USING$("########",Lzh.UnCompressSize) + " " + Filedate$ + " "+FileTime$ END IF ELSE INCR FilePos???, 2 DECR RestOfFileSize???, FilePos??? END IF Loop UNTIL Lzh.HeadSize = 0 Or Lzh.HeadSize > RestOfFileSize??? OR FilePos??? = RestOfFileSize??? Close Handle% FilesInfo$ = LzhFile$ + ":" + STR$(FileNumber??)+" Files" ArchiveFiles$(0) = MKWRD$(FileNumber??) ArchiveInfo$(0) = MKWRD$(FileNumber??) IF FileNumber?? > 1 THEN ARRAY SORT ArchiveFiles$(1) FOR FileNumber??,TAGARRAY ArchiveInfo$() Success% = 1 END SUB SUB ZipView(ZipFile$,ArchiveFiles$(),ArchiveInfo$(),FilesInfo$,Success%) ' View the ZIP File DIM Zip AS ZipType DIM FileName AS STRING * 8 DIM Ext AS STRING * 4 FileNumber?? = 0 Success% = 0 Handle% = FREEFILE OPEN ZipFile$ FOR BINARY AS Handle% FileSize??? = LOF(Handle%) IF FileSize??? = 0 THEN ' Check if files exists '?ZipFile;" has an FileSize of Zeor !" ' if not, exit CLOSE Handle% EXIT SUB END IF DO GET Handle%,ZipPos???,SIG??? ' Read File Header IF Sig??? = %PkSig Then FilePos??? = ZipPos???:EXIT LOOP INCR ZipPos???,2 IF ZipPos??? > 200 THEN CLOSE Handle%:EXIT SUB LOOP DO GET Handle%,FilePos???,Zip ' Read File Header IF (Zip.Signature = %PkSig) THEN INCR FilePos???, Zip.CompressSize + 30 + Zip.FileNameLen + ZIP.ExtraField INCR FileNumber?? GET$ Handle%,Zip.FileNameLen,File$ TheFile$ = GetFileName$(File$) IF TheFile$ = "" THEN DECR FileNumber?? ITERATE DO END IF LSET FileName$ = Extract$(TheFile$,".") LSET Ext$ = Extension$(File$) GetDateAndTime Zip.Filedate,Zip.FileTime,Filedate$,FileTime$ ArchiveFiles$(FileNumber??) = File$ IF FileDirExist%(File$) THEN DirSign$ = " + " ELSE DirSign$ = " " END IF ArchiveInfo$(FileNumber??) = DirSign$ + FileName$ + Ext$ + USING$("########",Zip.UnCompressSize) + " "+Filedate$+" "+FileTime$ END IF LOOP WHILE Zip.Signature = %PkSig CLOSE Handle% FilesInfo$ = ZipFile$ + ":" + STR$(FileNumber??)+" Files" ArchiveInfo$(0) = MKWRD$(FileNumber??) 'Total Number of FIles ArchiveFiles$(0) = MKWRD$(FileNumber??) IF FileNumber?? > 1 THEN ARRAY SORT ArchiveFiles$(1) FOR FileNumber??,TAGARRAY ArchiveInfo$() Success% = 1 END SUB SUB GetDirInfo(DirDate$,DirTime$,DirSize???,DirAttrib?) PUBLIC LOCAL DirDate??,DirTime??,DirAttr?,Dsize??? ! mov AX, &H2F00 ; function 2Fh, get DTA location ! int &H21 ; call DOS ! MOV AX,ES:[BX + 24] ! MOV DirDate??,AX ! MOV AX,ES:[BX + 22] ! MOV DirTime??,AX ! MOV AX,ES:[BX +26] ! MOV DSize???[0],AX ! MOV AX,ES:[BX +28] ! MOV DSize???[2],AX ! MOV AL,ES:[BX +21] ! MOV DirAttr?,AL DirSize??? = DSize??? DirAttrib? = DirAttr? GetDateAndTime DirDate??,DirTime??,DirDate$,DirTime$ END SUB SUB GetDateAndTime(Filedate??,FileTime??,Filedate$,FileTime$) PUBLIC Year?? = (Filedate?? AND &B1111111000000000):SHIFT RIGHT Year??,9 INCR Year??,1980 Month?? = Filedate?? AND &B0000000111100000:SHIFT RIGHT Month??,5 Day?? = Filedate?? AND &B0000000000011111 Hours?? = FileTime?? AND &B1111100000000000:SHIFT RIGHT Hours??,11 Minutes?? = FileTime?? AND &B0000011111100000:SHIFT RIGHT Minutes??,5 Seconds?? = (FileTime?? AND &B0000000000011111) * 2 Month$ = LTRIM$(STR$(Month??)) Day$ = LTRIM$(STR$(Day??)) IF LEN(Month$) = 1 THEN Month$="0"+Month$ IF LEN(Day$) = 1 THEN Day$ = "0"+Day$ 'IF Hours?? > 12 THEN ' Hours?? = Hours?? -12:AmPm$ = "p & " 'ELSE ' AmPm$ = "a & " 'END IF Hours$ = LTRIM$(STR$(Hours??)) Minutes$ = LTRIM$(STR$(Minutes??)) Seconds$ = LTRIM$(STR$(Seconds??)) IF LEN(Hours$) = 1 THEN Hours$="0"+Hours$ IF LEN(Minutes$) = 1 THEN Minutes$="0"+Minutes$ IF LEN(Seconds$) = 1 THEN Seconds$="0"+Seconds$ Filedate$ = Month$ + "-" + Day$ + "-" + LTRIM$(STR$(Year??)) FileTime$ = Hours$ + ":" + Minutes$ + ":" + Seconds$ 'FileTime$ = Hours$ + ":" + Minutes$ + AmPm$ + Seconds$ +"s" END SUB FUNCTION ModType2??(Number&,ModNumber%) M?? = Number& MOD ModNumber% IF M?? = 0 THEN ModType2?? = ModNumber% ELSE ModType2?? = M?? END IF END FUNCTION SUB CenterYes.No(Fg%,Bg%,YNFg%,Row%,Ky$,Text$) CCenterPrint Fg%,Bg%,Row%,Text$+"(Yes/No) ?" YNPos% = POS(0)+1 YPos% = POS(0)-10 CPRINT YNFg%,Bg%,CSRLIN,YPos%+1,"Y" CPRINT YNFg%,Bg%,CSRLIN,YPos%+5,"N" DO LOCATE ,YNPos%:PRINT " "; DO:Ky$ = INKEY$:LOOP UNTIL Ky$ <> "" Ky$ = UCASE$(Ky$) IF Ky$ <> Escape$ THEN LOCATE ,YNPos%:PRINT Ky$; DELAY .1 LOOP UNTIL Ky$ = "Y" OR Ky$ = "N" OR Ky$ = Escape$ END SUB SUB CCenterPrint(Fg%,Bg%,Row%,Txt$) Ln% = LEN(Txt$) CenterPos% = INT((80 - Ln%) / 2 + .5 +1) CPRINT Fg%,Bg%,Row%,CenterPos%,Txt$ END SUB SUB CenterPrint (Row%, Txt$) PUBLIC Ln% = LEN(Txt$) CenterPos% = INT((PbvScrnCols - Ln%) / 2 + .5 +1) LcPrint Row%, CenterPos%,Txt$ END SUB SUB CenterBox(ForeGround%, BackGround%, Shadow%, RowPos%, Rows%, WindowWidth%) CenterPos% = INT((PbvScrnCols - WindowWidth%) / 2 + .5 +1) PrintBox ForeGround%, BackGround%,Shadow%,RowPos%, CenterPos%, Rows%, WindowWidth% END SUB SUB PrintBox (ForeGround%, BackGround%,Shadow%,RowPos%, ColumnPos%, Rows%, WindowWidth%) PrintLine$ = CHR$(186)+STRING$(WindowWidth% -2, 32)+CHR$(186) CPRINT ForeGround%, BackGround%,RowPos%, ColumnPos%,CHR$(201)+STRING$(WindowWidth% -2, 205)+CHR$(187) FOR I% = RowPos% +1 TO RowPos% + Rows% CPrint ForeGround%, BackGround%,I%, ColumnPos%,PrintLine$ IF Shadow% THEN CPRINT 8,0,I%,POS(0)," " NEXT I% CPRINT ForeGround%,BackGround%,RowPos%+Rows%+1,ColumnPos%,CHR$(200)+STRING$(WindowWidth% -2,205)+CHR$(188) IF Shadow% THEN CPRINT 8,0,RowPos%+Rows%+1,POS(0)," " CPRINT 8,0,RowPos%+Rows%+2,1+ColumnPos%,STRING$(WindowWidth%," ") END IF END SUB SUB CPRINT(FG%,BG%,Row%, Col%,Txt$) PUBLIC COLOR FG%, BG% LOCATE Row%, Col% PRINT Txt$; END SUB SUB LcPrint(Row%,Col%,BYVAL Txt$) LOCATE Row%,Col% PRINT Txt$; END SUB FUNCTION UTRIM$(S$) UTRIM$ = UCASE$(TRIM$(S$)) END FUNCTION sub stuffbuffer(characters$) public FOR I% = 1 to LEN(Characters$) REG 1,&H0500 REG 3,ascii(MID$(Characters$,i%,1)) CALL INTERRUPT &H16 NEXT I% end sub FUNCTION ProgName$ DIM NSeg AS LOCAL WORD DIM NOff AS LOCAL WORD DIM Prog AS LOCAL STRING Prog = SPACE$(65) NSeg = STRSEG(Prog) NOff = STRPTR(Prog) ! Push DS ! Push SI ! Mov AX, &H6200 ! Int &H21 ! Mov DS, BX ; point DS at PSP segment ! Mov BX, &H2C ! Mov AX, [BX] ! Mov DS, AX ! Xor SI, SI ; points DS:SI at first byte of environment ContinueSearch: ! Lodsb ; get one byte from environment ! Or AL, AL ; look for a single null char ! Jnz ContinueSearch ; if not null, continue ! Lodsb ; look at next char ! Or AL, AL ; is it null, too? ! Jnz ContinueSearch ; if not null, continue ! Add SI, 2 ; DS:SI points at program name ! Mov AX, NSeg ! Mov ES, AX ! Mov BX, NOff ; ES:BX points to Prog LoadName: ! Lodsb ! Or AL, AL ! Jz NameLoaded ! Mov Byte Ptr ES:[BX], AL ! Inc BX ! Jmp LoadName NameLoaded: ! Pop SI ! Pop DS ProgName$ = RTRIM$(Prog$) END FUNCTION SUB Help x% = POS : y% = CSRLIN 'save cursor position and screen content DEF SEG = &hB800 : SaveScreen$ = PEEK$(0,4000) COLOR 7,0 CLS CenterPrint 4, "Shell View Help Commands" LOCATE 6,20:PRINT "Alt A About Program" LOCATE 7,20:PRINT "Alt C Copy File" LOCATE 8,20:PRINT "Alt D Delete File or Directory" LOCATE 9,20:PRINT "Alt H Help" LOCATE 10,20:PRINT "Alt M Make New Directory" LOCATE 11,20:PRINT "Alt R Rename File or Directory" LOCATE 12,20:PRINT "Alt U Unarchive File to called From Directory" LOCATE 13,20:PRINT "Alt V View File" LOCATE 14,20:PRINT CHR$(26);" Enter Directory,View File,View Archive" LOCATE 15,20:PRINT CHR$(27);" Leave Directory,Archive File" LOCATE 16,20:PRINT CHR$(24);" Go Up One Directory,or File" LOCATE 17,20:PRINT CHR$(25);" Go Down One Directory,or File" LOCATE 18,20:PRINT "Home Goto First Directory, or File" LOCATE 19,20:PRINT "End Goto Last Directory, or File" LOCATE 20,20:PRINT "Page Up Go Up One Page" LOCATE 21,20:PRINT "Page Down Go Down One Page" LOCATE 22,20:PRINT "Escape Quit Program" LOCATE 23,20:PRINT "F1 HELP" COLOR 0,1 SLEEP POKE$ 0, SaveScreen$ : LOCATE y%, x% DEF SEG END SUB SUB ZipHelp x% = POS : y% = CSRLIN 'save cursor position and screen content DEF SEG = &hB800 : SaveScreen$ = PEEK$(0,4000) COLOR 7,0 CLS CenterPrint 4, "Shell View Help Commands" LOCATE 6,20:PRINT "Alt A About Program" LOCATE 9,20:PRINT "Alt H Help" LOCATE 10,20:PRINT "Alt U Unarchive File to called From Directory" LOCATE 11,20:PRINT "Alt V View File" LOCATE 12,20:PRINT CHR$(26);" Enter View File,View Archive" LOCATE 13,20:PRINT CHR$(27);" Leave Archive File" LOCATE 14,20:PRINT CHR$(24);" Go Up One File" LOCATE 15,20:PRINT CHR$(25);" Go Down One File" LOCATE 16,20:PRINT "Home Goto First file" LOCATE 17,20:PRINT "End Goto Last File" LOCATE 18,20:PRINT "Page Up Go Up one Page" LOCATE 19,20:PRINT "Page Down Go Down One Page" LOCATE 20,20:PRINT "Escape Quit Program" LOCATE 21,20:PRINT "F1 HELP" COLOR 0,1 SLEEP POKE$ 0, SaveScreen$ : LOCATE y%, x% DEF SEG END SUB SUB About x% = POS : y% = CSRLIN 'save cursor position and screen content DEF SEG = &hB800 : SaveScreen$ = PEEK$(0,4000) COLOR 7,0 CLS CenterBox 0, 7, 1, 5, 10, 40 COLOR 0,7 CenterPrint 8, "Shell View" CenterPrint 10, "BY Randall L Glass" CenterPrint 12, "Copyright 1999" SLEEP POKE$ 0, SaveScreen$ : LOCATE y%, x% DEF SEG END SUB FUNCTION BitTest%(Value%,TheBit%) BitTest% = Bit(Value%,TheBit%) END FUNCTION