home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
251-275
/
apd257
/
addressbook.bak
/
addressbook.amosSourceCode
Wrap
AMOS Source Code
|
1991-07-03
|
6KB
|
242 lines
Break Off
On Error Proc HELP3 : Load Iff "demo_disk:pic",0
Paper 6
Pen 12
PASSWORD:
On Error Proc HELP
Open In 1,"pass"
Input #1,P$
Close 1
Locate 10,12 : Input "Enter the Password : ";PASS$
If PASS$=P$ Then Goto SUB1
If PASS$<>P$ Then Goto SUB2
SUB1:
Locate 5,5 : Print "*** CORRECT PASSWORD GIVEN ***"
Print ""
Print ""
Locate 5,5 : Print " "
Locate 10,12 : Print " "
Locate 0,8 : Input " Do you want to change the password ? (Y/N) ";Q$
Q$=Lower$(Q$) : If Q$="n" Then Goto JOURNAL
If Q$="y" Then Goto CHANGE
CHANGE:
Open Out 1,"pass"
Locate 0,8 : Print " "
Input "What would you like to change the password to? ";P$ : If P$="" Then Goto CHANGE
Print #1,P$
Close 1
Goto JOURNAL
SUB2:
Bell : Wait 40
Print ""
Print " *** FAILED ENTRY ***"
Boom : Wait 40
Goto SUB2
JOURNAL:
On Menu On
Menu$(1)=" Options "
Menu$(1,1)="Read an Address"
Menu$(1,2)="Create New Address"
Menu$(1,3)="Print an Address"
Menu$(1,4)="Disk Directory"
Menu$(1,5)="Delete an Address"
Menu$(2)="Credits "
Menu$(2,1)="Programmed By"
Menu$(2,1,1)="Ben Mitchell"
Menu$(2,3)="Using"
Menu$(2,3,1)="AMOS "
Menu$(2,1,2)="4,St Clair Close"
Menu$(2,1,3)="Reigate"
Menu$(2,1,4)="Surrey"
Menu$(2,2)="Password By "
Menu$(2,2,1)="Dean Hartwell "
Menu On
On Menu Proc ACTION
Procedure ACTION
If Choice(2)=1
Goto NEW
End If
If Choice(2)=2
Goto TYPE
End If
If Choice(2)=3
Goto PRT
End If
If Choice(2)=4
Goto DISK
End If
If Choice(2)=5
Goto DELETE
End If
End Proc
TYPE:
Load Iff "demo_disk:pic",0
On Menu On
I$=""
A$=""
B$=""
C$=""
D$=""
E$=""
F$=""
Paper 6
Pen 12
On Error Proc HELP2
Locate 0,3 : Print "The bar menu only works when the words `Press a key to start' are on the screen"
Print ""
Print "Press a key to start writing an address"
Wait Key
Locate 0,3 : Print " "
Locate 0,3 : Input "Addressee's Initials: ";I$; : If I$="" Then Goto TYPE
Open Out 1,I$+".add"
Print ""
Locate 0,3 : Print " "
Locate 0,4 : Input "Name: ";A$
Print #1,A$
Locate 0,5 : Input "Street: ";B$
Print #1,B$
Locate 0,6 : Input "Town: ";C$
Print #1,C$
Locate 0,7 : Input "County: ";D$
Print #1,D$
Locate 0,8 : Input "Post Code: ";E$
Print #1,E$
Locate 0,9 : Input "Telephone Number: ";F$
Print #1,F$
Close 1
Goto TYPE
NEW:
Load Iff "demo_disk:pic",0
Paper 6
Pen 12
On Menu On
I$=""
A$=""
B$=""
C$=""
D$=""
E$=""
F$=""
Print ""
Print ""
Print "Press a Key to load an address to read"
Wait Key
On Error Proc HELP2
Locate 0,2 : Print " "
Locate 0,3 : Input "Addressee's Initials: ";I$ : If I$="" Then Goto NEW
Open In 1,I$+".add"
Input #1,A$
Input #1,B$
Input #1,C$
Input #1,D$
Input #1,E$
Input #1,F$
Print ""
Locate 0,4 : Print "Name: ";A$
Locate 0,5 : Print "Street: ";B$
Locate 0,6 : Print "Town: ";C$
Locate 0,7 : Print "County: ";D$
Locate 0,8 : Print "Post Code: ";E$
Locate 0,9 : Print "Telephone Number:";F$
Close 1
Print ""
Print "Press a key to load another address"
Wait Key
Goto NEW
PRT:
Load Iff "demo_disk:pic",0
On Menu On
Paper 6
Pen 12
I$=""
A$=""
B$=""
C$=""
D$=""
E$=""
Print ""
Print ""
Print "Press a key to load and print an address"
Wait Key
Locate 0,2 : Print " "
On Error Proc HELP2
Locate 0,2 : Input "Addressee's Initials: ";I$ : If I$="" Then Goto PRT
Open In 1,I$+".add"
Input #1,A$
Input #1,B$
Input #1,C$
Input #1,D$
Input #1,E$
Locate 0,4 : Print "Name: ";A$
Locate 0,5 : Print "Street: ";B$
Locate 0,6 : Print "Town: ";C$
Locate 0,7 : Print "County: ";D$
Locate 0,8 : Print "Post Code: ";E$
Locate 0,10 : Input " Are you sure you want to print this Address? (Y/N) ";R$
R$=Lower$(R$) : If R$="n" Then Goto PRT
Locate 0,14 : Print " Please Place Paper in the Printer!"
Lprint A$
Lprint B$
Lprint C$
Lprint D$
Lprint E$
Close 1
Print ""
Print " Press a key to load and print another address "
Wait Key
Goto PRT :
DISK:
Load Iff "demo_disk:pic",0
On Menu On
Paper 6
Pen 12
F$=""
Locate 0,3 : Print "Press a key to load a directory of all address files, their length and all `drawers' on the disk"
Wait Key
Locate 0,3 : Print " "
F$=Dir First$("*.add")
While F$<>""
Print F$-".add" : Bell : Wait 30
F$=Dir Next$
Wend
Print "Press a key to load directory again"
Wait Key
Goto DISK
DELETE:
Load Iff "demo_disk:pic",0
On Menu On
Paper 6
Pen 12
K$=""
R$=""
Locate 0,3 : Print "Press a key to delete an address"
Wait Key
Locate 0,3 : Print " "
Locate 0,3 : Input " Addressee's initials for address to be deleted : ";K$ : If K$="" Then Goto DELETE
Print ""
Input " Are sure you want to delete this person's address? ";R$
R$=Lower$(R$) : If R$="n" Then Goto DELETE
On Error Proc HELP2
Kill K$+".add"
Locate 0,10 : Print "Deleting ";K$
Wait 100
Goto DELETE
Procedure HELP
Locate 0,3 : Print "You have not copied the file `PASS' to this disk!"
Print "This program will not work without this file!!!"
Wait Key
Edit
Resume Next
End Proc
Procedure HELP2
Resume Next
End Proc
Procedure HELP3
Screen Open 0,320,200,16,Lowres
Locate 0,4 : Print "You have not copied the file `PIC' to this disk!"
Print "This program will not work without this file!!!"
Print "Press a Key to exit"
Wait Key
Edit
Resume Next
End Proc