! DSKUSE.BAS Counts up how much disk space you're using & how
! many bytes that is, & how much it would cost.
! If you want to change the cost, the variable's name
! is MEGABYTE'COST. Right now it's set to $50.00 per month
! per megabyte
! Built August 23, 1980
! by Stephan K. Elliott
! This process consists of three files DSKUSE.HLP in [7,1]
! all on DSK0: DSKUSE.CMD in [2,2]
! DSKUSE.RUN in [7,0]
MAP1 DIRECTORY'STRING,S,150
MAP1 TOTAL'BLOCKS,F
MAP1 TOTAL'BYTES,F
MAP1 MEGABYTE'COST,F,,50 ! $ per month charged for storage ($50 here)
MAP1 COST,F
DOES'FILE'EXIST:
LOOKUP "USE.DIR", FILE'THERE
! If the program was run from the command file, USE.DIR should have
! already been erased, if it hasn't, send 'em back to the command file
IF FILE'THERE <= 0 &
THEN &
? TAB(15,10); "ONE MOMENT, PLEASE WHILE I LOOK UP A FILE" : &
CHAIN "DSKUSE.CMD"
RETURN
SEARCH'FOR'TOTAL:
INPUT LINE #1, DIRECTORY'STRING
? TAB(13,10); TAB(-1,9);
? TAB(13,10);DIRECTORY'STRING
X = INSTR(1,DIRECTORY'STRING,"Total of")
IF EOF(1) = 1 &
THEN &
? "SORRY, MY MISTAKE" : &
END
IF X = 0 &
THEN &
GOTO SEARCH'FOR'TOTAL
Y = INSTR(1,DIRECTORY'STRING,"in")
Z = INSTR(1,DIRECTORY'STRING,"block")
BLOCK'STRING = DIRECTORY'STRING[Y+3,Z-1]
TOTAL'BLOCKS = VAL(BLOCK'STRING)
RETURN