Category : Modula II Source Code
Archive   : FLXCPY10.ZIP
Filename : ENTREXIT.MOD

 
Output of file : ENTREXIT.MOD contained in archive : FLXCPY10.ZIP
IMPLEMENTATION MODULE EntrExit;

FROM SubDirs IMPORT PushDir, PopDir;
FROM Terminal IMPORT WriteString, WriteLn, Write, Read;
FROM Exits IMPORT CleanExit, DirtyExit;
FROM SYSTEM IMPORT BYTE;

CONST
BELL = 07x;
CR = 0Dx;
Version = "FlexCopy 1.0 -- Released 1989, Bit Bucket Software";

(* Print the program copyright notice and version number *)
PROCEDURE VersionMessage;
BEGIN
WriteString(Version);WriteLn;
END VersionMessage;

PROCEDURE FlexCopyEntry;
BEGIN (* FlexCopyEntry *)
IF NOT PushDir() THEN FlexCopyExit( PushDirFail); END;
END FlexCopyEntry;

PROCEDURE GiveFlexCopyHelp;
VAR
c : CHAR;
BEGIN (* GiveFlexCopyHelp *)
WriteLn;
WriteString('FlexCopy is a flexible file copy program for MS-DOS.');WriteLn;
WriteString('It uses an extended command syntax to allow copying multiple files.');WriteLn; WriteString('command line switches:');WriteLn;
WriteString('FlexCopy supports the following');WriteLn; WriteLn;
WriteString('File copy control switches:');WriteLn;
WriteString(' /M -- Move files instead of copying ( -> )');WriteLn;
WriteString(' /F -- Freshen existing files at destination');WriteLn;
WriteString(' /U -- Update specified files to destination');WriteLn;
WriteLn;
WriteString('Program control switches:');WriteLn;
WriteString(' /H or /? -- Help, show this help summary ');WriteLn;
WriteString('* /P -- Prompt user to choose between different descriptions for a file');WriteLn;
WriteString('* /N -- No prompt, always copy source description (default mode)');WriteLn;
WriteString('* /Q -- Quiet, no output to console unless error');WriteLn;
WriteString('* /V -- Verbose, report all actions to console (default mode)');WriteLn;
WriteString('* /X -- Suppress display of copyright banner');WriteLn;
WriteLn;
WriteString('The last switch appearing takes precedence if there is a conflict (e.g., /DM).');WriteLn;
WriteString('The /F and /U switches only have an effect for a file copy, not a /D or /M.');WriteLn;
WriteString('Switches marked with a * can be placed in an environment variable FLEXCOPYSW,');WriteLn;
WriteString("to alter the program's default mode of operation. Pressing ESCAPE will cancel");WriteLn;
WriteString('FlexCopy after the current file.');WriteLn;
END GiveFlexCopyHelp;

PROCEDURE FlexCopyExit( stat : ExitStatus);
VAR
code : BYTE;
BEGIN (* FlexCopyExit *)
code := 0;
IF NOT PopDir() THEN
WriteString('FlexCopy: Failure in restoring initial directory');
WriteLn;
END;
(* make sure we've got the version if an error occurred *)
IF ((stat <> OK) AND
(stat <> UserCancel)) THEN
VersionMessage;
IF ((stat <> Help) AND
(stat <> UserCancel)) THEN
Write(BELL);
END;
END;
CASE stat OF
UsageError:
WriteString('Usage: FlexCopy [switches] [d:][path]filename ...[[d:][path]filename]');
WriteLn;
WriteString(' Allowed switches are /m|f|u|n|p|q|v|x|h|?');
WriteLn;
WriteString(' Use FlexCopy /h|? for an explanation of the switches.');
WriteLn;
code := 1;
|
PushDirFail:
WriteString('FlexCopy: Failure in saving initial directory. Program stopped.');
WriteLn;
code := 5;
|
SelfCopy:
code := 3;
|
Help:
code := 1;
GiveFlexCopyHelp;
|
BadDir:
code := 5;
|
BadMove:
WriteString('Moving multiple files to single name -- operation aborted.');
WriteLn;
code := 2;
|
BadCopy:
WriteString('Copying multiple files to single name -- operation aborted.');
WriteLn;
code := 2;
|
DeviceError:
WriteString('FlexCopy does not support DOS devices.');
WriteLn;
code := 4;
|
TargetOverflow:
WriteString('Not all files copied due to target disk full.');
WriteLn;
code := 7;
|
UserCancel:
code := 7;
|
END; (* CASE stat *)
IF code = 0 THEN CleanExit; ELSE DirtyExit( code); END; (* IF *)
END FlexCopyExit;

END EntrExit.


  3 Responses to “Category : Modula II Source Code
Archive   : FLXCPY10.ZIP
Filename : ENTREXIT.MOD

  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/