Category : Files from Magazines
Archive   : ITP9005.ZIP
Filename : TESTFCB.PAS

 
Output of file : TESTFCB.PAS contained in archive : ITP9005.ZIP

PROGRAM TestFCB;

{ test FCBLabel UNIT}

USES CRT,FCBLabel;

VAR
Choice : Byte;
Drive : DriveType;
DiskID : DiskIDType;
NewDiskID : DiskIDType;

BEGIN
REPEAT {Endless loop - select option 5 to Exit}
ClrScr;
GotoXY(25,1); WriteLn('Volume Functions');
GotoXY(25,9); WriteLn('1) SET LABEL');
GotoXY(25,10); WriteLn('2) DELETE LABEL');
GotoXY(25,11); WriteLn('3) RENAME LABEL');
GotoXY(25,12); WriteLn('4) GET LABEL');
GotoXY(25,13); WriteLn('5) Exit');
GotoXY(20,15);
Write('Type number and press Enter > ');
ReadLn(Choice); WriteLn;
Drive := 'C'; { use drive C: as test drive }

CASE Choice OF
1: BEGIN {Set volume LABEL}
DiskID := GetDiskID(Drive);
IF DiskID <> '' THEN
BEGIN
WriteLn('Label not null: ',DiskID);
WriteLn('Use RENAME instead');
WriteLn('Press Enter to continue');
ReadLn
END
ELSE
BEGIN
Write('Enter new label > ');
ReadLn(DiskID);
IF NOT SetDiskID(Drive,DiskID) THEN
BEGIN
WriteLn('System Error');
WriteLn
('Press Enter to continue');
ReadLn
END
END
END;
2: BEGIN {Delete Volume LABEL}
IF DeleteDiskID(Drive) THEN
WriteLn('Volume label deleted')
ELSE
WriteLn('System Error');
WriteLn('Press Enter to continue');
ReadLn
END;
3: BEGIN {Rename Volume LABEL}
DiskID := GetDiskID(Drive);
IF DiskID = '' THEN
BEGIN
WriteLn('Current label is null:');
WriteLn('Use SET option instead');
WriteLn('Press Enter to continue');
ReadLn
END
ELSE
BEGIN
Write('Enter new name of label > ');
ReadLn(NewDiskID);
IF NOT ReNameDiskID
(Drive,DiskID,NewDiskID) THEN
BEGIN
WriteLn('System Error');
WriteLn
('Press Enter to continue');
ReadLn
END
END
END;
4: BEGIN {Get Volume LABEL}
DiskID := GetDiskID(Drive);
Write('The current label is ');
IF DiskID = '' THEN
WriteLn('null')
ELSE
WriteLn(DiskID);
WriteLn('Press Enter to continue');
ReadLn
END;
5: Halt;
ELSE { continue }
END { case }
UNTIL FALSE
END.