home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 26
/
CD_ASCQ_26_1295.iso
/
vrac
/
volume_3.zip
/
IT.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-09-17
|
4KB
|
190 lines
DECLARE FUNCTION MouseInit% ()
DECLARE FUNCTION GetFilename$ (SS$)
DECLARE FUNCTION GetDrive% ()
DECLARE FUNCTION FindFile$ (FileSpec$, ATTR%, Mouse%)
DECLARE FUNCTION INC! (i%)
DECLARE SUB LocateYX (Y%, X%)
DECLARE FUNCTION YesNo$ (Msg$, Y%, X%)
DECLARE FUNCTION CharFromTo$ (a$, First%, Last%)
DECLARE FUNCTION CharAt$ (a$, i%)
DECLARE SUB Center.Message (Msg$, Line.Num%)
'********************************************
'* Constants *
'********************************************
CONST MAX.SCRN.COL% = 80
CONST MAX.SCRN.ROW% = 25
CONST TRUE% = -1
CONST FALSE% = 0
'********************************************
'* Variable's *
'********************************************
File.Data$ = ""
VOID$ = ""
Selected.Label% = 0
StopIt% = FALSE%
DIM Label(1 TO 100) AS STRING
CLS
Counter% = 1
Current.Drive1% = 0
Exist1$ = ""
'*********************************************
'* Initialize *
'*********************************************
RANDOMIZE 10
CLS
Current.Drive1% = GetDrive%
'*********************************************
'* Get Current Dirctory Name *
'*********************************************
SHELL "dir > dir.txt"
OPEN "dir.txt" FOR INPUT AS #1
WHILE NOT EOF(1)
LINE INPUT #1, CurrentPath1$
IF CharFromTo(CurrentPath1$, 2, 10) = "Directory" THEN
CurrentPath2$ = CharFromTo(CurrentPath1$, 15, LEN(CurrentPath1$))
CurrentPath$ = CurrentPath2$ + "\*.zip"
END IF
WEND
CLOSE #1
SHELL "del dir.txt"
'*********************************************
'* Allow for No Screen while *
'* Mouse and file search completes *
'*********************************************
LOCATE 8, 20
PRINT "Please Wait, Checking for & Processing Zip Files"
LOCATE 9, 20
PRINT INT(RND * 40); "% complete"
'*********************************************
'* Mouse & Find File *
'*********************************************
r% = MouseInit
LOCATE 10, 20
PRINT " 50 % complete"
Exist$ = FindFile$(CurrentPath$, 0, r%)
IF Exist$ = "" THEN
CLS
END
END IF
'*********************************************
'* Processes File Name *
'*********************************************
Directory.Name$ = GetFilename$(Exist$)
'*********************************************
'* Makes Directory and unzips file *
'*********************************************
TT$ = "Mkdir " + CurrentPath2$ + "\" + Directory.Name$
SHELL TT$
TT$ = "Pkunzip " + CurrentPath2$ + "\" + Directory.Name$ + ".zip " + CurrentPath2$ + "\" + Directory.Name$
SHELL TT$
CLS
SUB Center.Message (Msg$, Line.Num%)
IF Line.Num% <= MAX.SCRN.ROW% THEN
IF Line.Num% > 0 THEN
LOCATE Line.Num%, 1
PRINT STRING$(MAX.SCRN.COL%, " ");
LOCATE Line.Num%, INT((MAX.SCRN.COL% - LEN(Msg$)) / 2)
PRINT Msg$;
ELSE
BEEP
END IF
ELSE
BEEP
END IF
END SUB
FUNCTION CharAt$ (a$, i%)
IF i% > 0 THEN
CharAt$ = MID$(a$, i%, 1)
ELSE
SOUND 2000, 60
END IF
END FUNCTION
FUNCTION CharFromTo$ (a$, First%, Last%)
IF First% <= Last% THEN
CharFromTo$ = MID$(a$, First%, (Last% - First% + 1))
END IF
END FUNCTION
SUB DEC (i%)
i% = i% - 1
END SUB
FUNCTION GetFilename$ (SS$)
T = -1
F = 0
switch = T
Length% = LEN(SS$)
FOR a% = Length% TO 1 STEP -1
IF CharAt(SS$, a%) = "\" AND switch = T THEN
switch = F
b% = a% + 1
END IF
IF switch = T THEN
Y$ = Y$ + CharAt(SS$, a%)
END IF
NEXT a%
IF Length% > 5 THEN
FOR a% = Length% TO (Length% - 4) STEP -1
IF CharAt(SS$, a%) = "." THEN
c% = a% - 1
END IF
NEXT a%
END IF
YY$ = CharFromTo(SS$, b%, c%)
GetFilename$ = YY$
END FUNCTION
FUNCTION INC (i%)
i% = i% + 1
INC = i%
END FUNCTION
SUB LocateYX (Y%, X%)
IF Y% > 0 THEN
IF Y% < 26 THEN
IF X% > 0 THEN
IF X% < 80 THEN
LOCATE Y%, X%
END IF
END IF
END IF
END IF
END SUB
FUNCTION YesNo$ (Msg$, Y%, X%)
'This will return "Y" or "N"
Answer$ = " "
WHILE (INSTR("YyNn", Answer$) = 0)
CALL LocateYX(Y%, X%)
PRINT Msg$;
CurrentX% = POS(0)
CurrentY% = CSRLIN
INPUT " (Y/N) "; Answer$
S = LEN(Answer$)
CALL LocateYX(CurrentY%, CurrentX%)
PRINT STRING$(S + 9, " ")
IF S > 0 THEN Answer$ = LEFT$(Answer$, 1)
WEND
YesNo$ = UCASE$(Answer$)
END FUNCTION