home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
PROGRAMM
/
BUILDER.ZIP
/
TUTOR2.BLD
< prev
next >
Wrap
Text File
|
1992-11-17
|
3KB
|
113 lines
' First we declare our variables
Longint Flag
String Temp, BCFFilename, filename, directory
' Check to see if we have the minimum number of command line parameters
if ParamCount < 4
' It not call the help screen
ShowHelp
end
' Force the second parameter to uppercase and assign it to a string
BCFFilename:= Uppercase "%2"
' Add the default extention .BCF if none was given
Flag:= HasExtension BCFFilename
If not (Flag) BCFFilename:= BCFFilename+".BCF"
' Force the third parameter to uppercase and assign it to a string
filename:= Uppercase "%3"
' Force the fourth parameter to uppercase and assign it to a string
Directory:= Uppercase "%4"
' Check for no specified directory, and assign one if needed
if Directory == ""
Directory:= CurrentDrive
Temp:= CurrentDir
Directory:= Directory+Temp
end
Temp:= Uppercase "%1"
' verify the parameters
select Temp from
Case "A":
Addfile
Case "C":
CopyFile
Case "D":
DeleteFile
end
' If we get here then %1 was not one of the commands, so we
' want to display the help screen.
ShowHelp
' Now we list our subroutine
Sub ADDFile
' Add a file to a BCF or create one if the BCF does not exist.
' We wil check flag for any errors.
Flag:= BCFADD BCFFilename, filename
if not Flag
say "Error adding "; filename; " to "; BCFFilename
exit 1
end else
say filename;" added to "; BCFFilename
exit 0
end
end
sub CopyFile
' Copy a file from a BCF.
' We will check flag to any errors.
Flag:= BCFCopy BCFFilename, filename, directory
if not flag
say "Error copying "; filename;" to ";directory;" from ";BCFFilename
exit 1
end else
say filename;" copied from ";BCFFilename;" to ";directory
exit 0
end
end
sub DeleteFile
' Delete a file from BCF
' We will check flag for any errors.
Flag:= BCFDelete BCFFilename, filename
if not flag
say "Error deleting "; filename; " from "; BCFFilename
exit 1
end else
say filename; " deleted from ";BCFFilename
exit 0
end
end
sub ShowHelp
' Display a help screen
Say "<Bright Red>Error<Normal> invalid command line"
say "BCF.EXE BUILDER Compressed File Utility"
say "Copyright hyerkinetix, inc. 1991"
say "BUILDER compressed file utility to add, delete and copy"
say "files to/from a .BCF file"
say
say "Command line format"
say "BCF [a/c/d] BCFFilename filename <directory>"
say "a - add a file to the BUILDER Compressed File"
say "c - copy a file from the BUILDER Compressed File to the"
say " optional directory"
say "d - delete a file from the BUILDER Compressed File"
say "BCFFilename - name of the BCF file to be acted upon"
say "filename - filename to add/copy/delete. COPY/DELETE support wildcards."
say "directory - optional destination parameter for the copy command."
say
exit 1
end