Category : Utilities for DOS and Windows Machines
Archive   : FILLDISK.ZIP
Filename : FILLDISK.SRC

 
Output of file : FILLDISK.SRC contained in archive : FILLDISK.ZIP
DIM BLOCK$(511)
DIM DFNAME$(15)
START:
CLEAR
LOCATE 1,10: PRINT "FILLDISK.EXE DOS UTILITY 10/10/90 BENNY THE ROBOT"
LOCATE 2,10: PRINT "____________"

LOCATE 4,10: PRINT "Purpose: Calculate remaining free disk space on target drive"
LOCATE 5,10: PRINT " and fill with one file of specified constant data."

REPEAT:
LOCATE 8,1: PRINT SPACE$(80)
LOCATE 18,1: PRINT SPACE$(80)
LOCATE 21,1: PRINT SPACE$(80)
LOCATE 22,1: PRINT SPACE$(80)
LOCATE 8,10: INPUT "Enter drive you want to work on (A, B, C ...): ",DRIVE$
IF LEN(DRIVE$) > 1 THEN GOTO REPEAT
IF DRIVE$ = "" THEN DRIVE$ = "A"
DRIVE% = ASC(DRIVE$)
IF DRIVE% > 96 THEN DRIVE% = DRIVE% - 96 ELSE DRIVE% = DRIVE% - 64
LOCATE 8,57: PRINT CHR$(DRIVE% + 64)

NAMEAGAIN:
LOCATE 9,1: PRINT SPACE$(80)
LOCATE 9,10: PRINT "Enter file name, RETURN for default file name FILLER.TMP"
LOCATE 9,57: INPUT "",DFNAME$
IF LEN(DFNAME$) > 12 THEN GOTO NAMEAGAIN
IF DFNAME$ = "" THEN DFNAME$ = "FILLER.TMP"
LOCATE 9,57: PRINT SPACE$(12)
LOCATE 9,57: PRINT DFNAME$
LOCATE 10,10: PRINT "Fill character, RETURN for default: 00 (entry in hex)"
LOCATE 11,10: PRINT "(Entries in decimal must be followed by D)"
GOTO ENTERVAL

VALAGAIN:
LOCATE 10,48: PRINT SPACE$(32)
LOCATE 11,1: PRINT SPACE$(80)
ENTERVAL:
LOCATE 10,48: INPUT "",DFILLER$
IF DFILLER$ = "" THEN DFILLER% = 0: GOTO GETSPACE
IF LEN(DFILLER$) < 3 THEN GOTO HEXVALUE
IF VAL(DFILLER$) > 255 THEN GOTO VALAGAIN
IF RIGHT$(DFILLER$,1) = "D" OR RIGHT$(DFILLER$,1) = "d" THEN DFILLER% = VAL(LEFT$(DFILLER$,3)):TYPE$ = "Decimal":GOTO GETSPACE

HEXVALUE:
H2 = VAL(LEFT$(DFILLER$,1))
H1 = VAL(MID$(DFILLER$,2,1))
DFILLER% = H2 * 16 + H1
TYPE$ = "Hexadecimal"

GETSPACE:
LOCATE 11,1: PRINT SPACE$(80)
LOCATE 10,52: PRINT SPACE$(20)
LOCATE 10,52: PRINT TYPE$
LOCATE 12,10: PRINT "checking free disk space, please wait ... "

BLOCK$ = STRING$(512,DFILLER%)

CALL DSPACE(DRIVE%,SECTORS%,BYTES%,CLUSTERS%)

LOCATE 13,1: PRINT SPACE$(80)
LOCATE 14,1: PRINT SPACE$(80)
LOCATE 15,1: PRINT SPACE$(80)
LOCATE 12,1: PRINT SPACE$(80)
LOCATE 12,10: PRINT "Bytes per sector: ";BYTES%
LOCATE 13,10: PRINT "Sectors per cluster: ";SECTORS%
LOCATE 14,10: PRINT "Available clusters: ";CLUSTERS%;
PRINT " Total sectors: ";SECTORS%*CLUSTERS%
SECTORS = SECTORS%: BYTES = BYTES%: CLUSTERS = CLUSTERS%

RES = SECTORS * BYTES * CLUSTERS / 1000
LOCATE 16,10: PRINT "There are ";
PRINT USING "####,.###"; RES;
PRINT " KBytes ready to be filled with ASCII ";
IF DFILLER% < 32 THEN PRINT "CTRL ";CHR$(DFILLER%+64) ELSE PRINT CHR$(DFILLER%)

RECORDS% = INT(CLUSTERS * SECTORS)
LOCATE 18,10: PRINT "How many sectors do you want to write, max. ";RECORDS%
LOCATE 19,10: PRINT "(RETURN for default, 0 to exit program)"
LOCATE 18,55: INPUT "",RECMIN$
LOCATE 18,55: PRINT SPACE$(6)
LOCATE 18,55: PRINT RECMIN$

CHECKENTRY:
RECMIN% = VAL(RECMIN$)
IF RECMIN$ = "" THEN RECMIN% = RECORDS%
IF RECMIN% < 1 THEN GOTO PROGEXIT
IF RECMIN% > RECORDS% THEN GOTO REFUSE
GOTO ACCEPT
REFUSE:
LOCATE 18,10: PRINT "You are only allowed to write a maximum of ";RECORDS%;" sectors"
LOCATE 19,10: PRINT "Please enter again, 0 to exit program "
LOCATE 18,55: INPUT "",RECMIN$
LOCATE 18,1: PRINT SPACE$(80)
LOCATE 19,1: PRINT SPACE$(80)
GOTO CHECKENTRY:
ACCEPT:
RECORDS% = RECMIN%
LOCATE 18,1: PRINT SPACE$(80)
LOCATE 19,1: PRINT SPACE$(80)
LOCATE 18,10: PRINT "writing ";RECORDS%;" sectors, please wait ... "

LOCATE 20,10: PRINT "File named ";CHR$(DRIVE%+64)+":";DFNAME$
DFNAME$ = CHR$(DRIVE%+64)+":"+DFNAME$+CHR$(0)+"$"

CALL DFILL(DFNAME$,BLOCK$,RECORDS%)

PROGEXIT:
IF RECMIN% < 1 THEN RESP$ = " PROGRAM ABORTED" ELSE RESP$ = "DONE"
LOCATE 21,1: PRINT SPACE$(80)
LOCATE 21,67: PRINT RESP$
LOCATE 22,10: INPUT "Do again ? (Y/N): ",ANSWER$
A$ = LEFT$(ANSWER$,1)
IF A$ = "y" OR A$ = "Y" THEN LOCATE 16,16: PRINT "were": GOTO START

SYSTEM




  3 Responses to “Category : Utilities for DOS and Windows Machines
Archive   : FILLDISK.ZIP
Filename : FILLDISK.SRC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/