home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
026-050
/
apd035
/
archivepal.bak
/
archivepal.amosSourceCode
Wrap
AMOS Source Code
|
1978-08-29
|
11KB
|
493 lines
SET
Procedure SET
Break Off
Led On
Hide On
Screen Open 0,640,248,2,Hires
Curs Off
Flash Off
Close Editor
FRONT_END
End Proc
Procedure KEYTEST
1 X$=Inkey$
If Key State(95)=True Then HELP
If Key State(69)=True Then INFO
If X$="a" Then APPE
If X$="A" Then APPE
If X$="C" Then CHANGE
If X$="c" Then CHANGE
If X$="D" Then Cls : DI
If X$="d" Then Cls : DI
If X$="q" Then QUIT
If X$="Q" Then QUIT
If X$="e" Then TIDE
If X$="E" Then TIDE
If X$="K" Then KIL
If X$="k" Then KIL
If X$="v" Then WEIVC
If X$="V" Then WEIVC
If X$="" Then Goto 1
Goto 1
End Proc
Procedure WEIVC
16 Cls
Centre "File view options."
Print
Print
Print "Press one of the following keys"
Print
Print "A to view all the records in a file"
Print "B to view selected records"
Print "C to view individal records"
Print "<HELP> for a full explanation"
Print "<SPACE> to return to main menu"
14 X$=Inkey$
X$=Upper$(X$)
If X$="A" Then WEIV
If X$="B" Then WEIVS
If X$="C" Then WEIVI
If X$=" " Then FRONT_END
If Key State(95)=True Then WEIVH
Goto 14
End Proc
Procedure WEIVH
Cls
Bell
Centre "View help"
Print
Print
Print " This part of Archivist allows you to see what you have put into your files."
Print "You can view any part of any file by selecting the correct option at the."
Print "menu. The options are:"
Print
Print " Pressing `a' will let you view the whole file"
Print " Pressing `b' will let you view a small, self-defined number of records e.g.10"
Print " Pressing `c' will let you view one individual record out of a file"
Print
Print "I hope It's all straight forward."
Print
Centre "Press any key to return to view menu."
Print
For N=0 To 100
Next N
Wait Key
WEIVC
End Proc
Procedure WEIVS
Cls
On Error Proc VIWE
Print "Small number of records"
Print
15 Input "Which file ";F$
If F$="" Then Goto 15
Open In 1,F$+".NUM"
Input #1,A
Close 1
Print A;" records in file"
Print
Input "How many records ";M
Print
18 Input "Starting at which record ";R
R$=Str$(R)
If R$="" Then Goto 18
For N=R To R+M
N$=Str$(N)
Open In 1,F$+N$
Input #1,A$
Print "Record number";N;" in file ";F$;" is ";A$
Close 1
Next N
Print
Centre "Press any key to return to view menu"
Print
Wait Key
Goto 16
End Proc
Procedure WEIVI
On Error Proc VIWE
Cls
Print "Individual file viewing"
Print
17 Input "Which file to view ";F$
If F$="" Then Goto 17
Open In 1,F$+".NUM"
Input #1,L
Close 1
Print "There are";L;" records in file ";F$
Print
19 Input "Which record do you want to view ";N
N$=Str$(N)
If N$="" Then Goto 19
Open In 1,F$+N$
Input #1,I$
Close 1
N=Val(N$)
Print "Record ";N;" in file ";F$;" is ";I$
Print
Centre "Press any key."
Print
Wait Key
Cls
Goto 16
End Proc
Procedure WEIV
On Error Proc VIWE
Cls
3 Print "Enter filename to view."
Input V$
If V$="" Then Goto 3
Open In 2,V$+".NUM"
Input #2,A
Close 2
Print A;" records in file"
For N=1 To A
A$=Str$(N)
Open In 2,V$+A$
Input #2,N$
Print "Record number";N;" in file is ";N$
Close 2
Next N
Print "Closing file viewed"
Print
Centre "Press any key to continue."
Print
Wait Key
Cls
Goto 16
End Proc
Procedure VIWE
Print
Centre "File, or record in file, does not exist"
Print
Centre "Press any key to return to menu"
Print
Print
Wait Key
FRONT_END
End Proc
Procedure CHANGE
Cls
On Error Proc CHANGEE
Print "File name to change"
Input V$
Open In 2,V$+".NUM"
Input #2,B
Close 2
Print B;" records in file"
For N=1 To B
A$=Str$(N)
Open In 2,V$+A$
Input #2,N$
Print "Record number";N;" in file is ";N$
Close 2
Next N
Print "Change which file number"
Input C
C$=Str$(C)
Open In 3,V$+C$
Input #3,A$
Close 3
Print "Current value of record";C;" is:";A$
Print
Print "New value for record";C;" is:"
Input A$
Led Off
Open Out 4,V$+C$
Led On
Print #4,A$
Led Off
Close 4
Led On
Print "Any more (y/n)"
7 X$=Inkey$
If X$="Y" Then CHANGE
If X$="y" Then CHANGE
If X$="" Then Goto 7
FRONT_END
End Proc
Procedure CHANGEE
Print
Print
Centre "Can't do that."
Print
Centre "Press any key to return to main menu."
Wait Key
FRONT_END
End Proc
Procedure KIL
On Error Proc KILE
Cls
Print "Filename of file to delete"
Input K$
Open In 1,K$+".NUM"
Input #1,A
Close 1
Print "Kill ";K$;". Sure (y/n)"
Input Y$
If Y$="y" Then Goto 5
If Y$="Y" Then Goto 5
FRONT_END
5 For N=1 To A
Led Off
N$=Str$(N)
Print "Record";N$;" deleted."
Kill K$+N$
Led On
Next N
Kill K$+".NUM"
Print
Print
Centre "Deletion completed. Press a key to return to main menu."
Print
Wait Key
FRONT_END
End Proc
Procedure KILE
Print
Centre "File does not exist on this disk. Press any key to return to main menu."
Print
Wait Key
FRONT_END
End Proc
Procedure DI
On Error Proc DIE
Print "Which drive? (df0/df1/df2/dh0/dh1/dh2/di0/di1 etc)"
Input D$
If Left$(D$,3)<>":" Then D$=D$+":"
Dir D$
Print
Print
Centre "Press any key to continue."
Print
Wait Key
FRONT_END
End Proc
Procedure DIE
Print
Centre "Unavailable. Device (or volume) not mounted."
Print
Centre "Press any key to return to main menu."
Print
Wait Key
FRONT_END
End Proc
Procedure APPE
Cls
On Error Proc APPEE
Print "Filename of file to add on to"
Input F$
Open In 1,F$+".NUM"
Input #1,A
Close 1
Print "There are";A;" records in file ";F$
Print "How many more do you want to add on?"
Input B
For N=A+1 To A+B
Led Off
N$=Str$(N)
Print "Value for record number";N;" is"
Input C$
Led On
Open Out 1,F$+N$
Print #1,C$
Close 1
Next N
Open Out 1,F$+".NUM"
Print #1,A+B
Close 1
Print
Print
Centre "Press any key to return to main menu."
Print
Wait Key
FRONT_END
End Proc
Procedure APPEE
Print
Print
Centre "Can't do that. Sorry"
Print
Print
Centre "Press any key to return to menu"
Print
Wait Key
FRONT_END
End Proc
Procedure HELP
Bell
Cls
Print
Print "ELP...HELP...HELP...HELP...HELP...HELP...HELP...HELP...HELP...HELP...HELP...HE"
Print
Print " Pressing `a' will add on to any file"
Print " Pressing `c' will change any record in any file on disk"
Print " Pressing `d' will show the directory of the disk in any drive."
Print " Pressing `e' will edit a record."
Print " Pressing `k' will delete (KILL) any file you have created."
Print " Pressing `q' will quit the program."
Print " Pressing `v' will view any number of records in any file. See view help."
Print " Pressing <HELP> on the main menu will give you this help screen."
Print " Pressing <ESC> on the main menu will give you information about this program"
Print "it's idea, and other irrelevant information"
Print "There is a demo file on this disk, called DEMO. View it, Add to it or delete it"
Print "But if you do decide to pass this program on, please re-create the file."
Print
Print
Centre "Press any key to continue."
Wait Key
Cls
FRONT_END
End Proc
Procedure FRONT_END
Cls
Shared R$,F$,FILEN
Centre "Archivist"
Print
Centre "---------"
Print
Centre "MAIN MENU"
Print
Print
Print "Press one of the following keys:"
Print "A to add to a file"
Print "C to change any record"
Print "D to see the directory of any drive"
Print "E to edit a record"
Print "K to delete a file"
Print "Q to quit"
Print "V to view records"
Print "<HELP> to read help"
Print "<ESC> for info on Archivist"
Print
Print "Chip memory=";Chip Free;" bytes"
Print "Fast memory=";Fast Free;" bytes"
KEYTEST
End Proc
Procedure QUIT
Cls
Break On
Print "Quit. Sure? (y/n)"
2 Y$=Inkey$
If Y$="y" Then 6
If Y$="Y" Then 6
If Y$="n" Then FRONT_END
If Y$="N" Then FRONT_END
If Y$="" Then Goto 2
6 Cls
Print "Bye"
Set Rainbow 0,1,64,"(,8,)","",""
End Proc
Procedure INFO
Bell
Cls
Print
Centre "Archivst V1.0"
Print
Centre "-------------"
Print
Print " This program is Archivist. Archivist is a simple little data storage program."
Print "It will store any data that you have as a sequential data file on disk."
Print " I had the idea for this when I needed a small program to store some results"
Print "as part of a maths project I was doing at the time. I had just bought a copy "
Print "of AMOS at that time and had two choices. I could buy a database and save time,"
Print "or use AMOS to store my data and save money. I wasn't rich (and still aren't)"
Print "so I looked to AMOS to try to find a way of storing the data in such a way that"
Print "I could get at any record easily. I looked at this, and when I found a viable"
Print "program,I decided to release it into the unsuspecting PD market, through"
Print "Mandarin as perhaps the first utility written in AMOS."
Print " People are more than welcome to load this file into their copies of AMOS and"
Print "and correct it any way they seem fit, but please read the acompianing .DOC file"
Print
Print "P.S. Watch that power light!"
Print
Print "P.P.S. Archivist has a small bug on the chamnge command so just be careful!"
Print
For N=1 To 100
Next N
Centre "More-Press any key."
Print
Wait Key
Cls
Print "This program is Public Domain software.If you have any comments about Archivist"
Centre "then send them to:"
Print
Print
Centre "Steven Harrison"
Print
Centre "62 Vyner Street,"
Print
Centre "Haxby Road,"
Print
Centre "York."
Print
Centre "YORKSHIRE"
Print
Centre "ENGLAND"
Print
Centre "YO3 7HS"
Print
Print
Centre "OR"
Print
Print
Centre "Steven Harrison"
Print
Centre "Clifton House (5th year)"
Print
Centre "St Peters School"
Print
Centre "Bootham"
Print
Centre "York"
Print
Centre "YORKSHIRE"
Print
Centre "ENGLAND"
Print
Centre "YO3 6AB"
Print
Print
Print
Centre "Press any key to return to main menu."
Wait Key
FRONT_END
End Proc
Procedure TIDE
Shared F$,L
On Error Proc TIDEE
Cls
Print "Filename of file"
Input F$
Print "How many records required"
Input R
Open Out 2,F$+".NUM"
Print #2,R
Close 2
For N=1 To R
N$=Str$(N)
Open Out 1,F$+N$
Print "Record ";N;" is"; : Input I$
Print #1,I$
Close 1
Next N
Print
Print
Centre "Input completed. Press any key to return to main menu."
Print
Print
Wait Key
FRONT_END
End Proc
Procedure TIDEE
Print
Print
Centre "Oops, my fault."
Print
Centre "But I can't help it."
Print
Centre "Press any key to return to main menu"
Print
Wait Key
FRONT_END
End Proc