home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1978-06-06 | 5.9 KB | 321 lines |
- Rem**File maker**
- Rem**Written By Simon Walklate**
- Screen Open 0,320,256,16,Lowres
- Unpack 1 To 0
- Curs Off : Flash Off
- Pen 1 : Paper 0
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "Type of printer:"
- Locate 9,19 : Print "(P)arallel (S)erial"
- Locate 9,20 : Print "(N)one"
- Do
- C$=Inkey$
- C$=Upper$(C$)
- If C$="P"
- Open Out 2,"PAR:"
- Exit
- End If
- If C$="S"
- Open Out 2,"SER:"
- Exit
- End If
- If C$="N"
- Exit
- End If
- Loop
- Global C$
- STA:
- Cls
- Unpack 1 To 0
- Curs Off : Flash Off
- Pen 1 : Paper 0
- Reserve Zone 4
- Set Zone 1,160,77 To 200,113
- Set Zone 2,224,77 To 266,113
- Set Zone 3,288,77 To 329,113
- Set Zone 4,356,77 To 396,113
- Do
- X=X Mouse : Y=Y Mouse
- If Zone(0,X,Y)=1 and Mouse Key=1 Then Proc CREATE
- If Zone(0,X,Y)=2 and Mouse Key=1 Then Proc AD
- If Zone(0,X,Y)=3 and Mouse Key=1 Then Proc COUNT
- If Zone(0,X,Y)=4 and Mouse Key=1 Then Proc PRIN
- Loop
- Procedure CREATE
- If Exist("Df0:")
- Else
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STA
- End If
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "Enter Filename"
- Locate 9,19 : Print "To Create:"
- Locate 3,14 : Input A$
- Cls 0,21,102 To 280,124
- If Exist("Df0:")
- Else
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STA
- End If
- If Exist(A$)
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "File exists " : Locate 9,19 : Print "Replace(Y/N)?"
- Do
- S$=Inkey$
- S$=Upper$(S$)
- If S$="Y"
- Exit
- End If
- If S$="N"
- Goto STA
- End If
- Loop
- End If
- Locate 6,29 : Print A$
- If Exist("Df0:")
- Else
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STA
- End If
- Open Out 1,A$
- STAR:
- Do
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "Enter record:"
- If Exist("Df0:")
- Else
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STAR
- End If
- Locate 3,14 : Input B$
- Cls 0,21,102 To 280,124
- If B$="-1" Then Goto CLOS
- B$=Upper$(B$)
- If Len(B$)>30
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "No more than" : Locate 9,19 : Print "30 characters!!"
- Wait 200
- Goto STAR
- End If
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print B$ : Locate 9,19 : Print "is this O.K.?(Y/N)"
- Do
- S$=Inkey$
- S$=Upper$(S$)
- If S$="Y" Then Exit
- If S$="N" Then Goto STAR
- Loop
- Print #1,B$
- Loop
- CLOS:
- Close 1
- Goto STA
- End Proc
- Procedure AD
- If Exist("Df0:")
- Else
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STA
- End If
- Z$=Dir$
- Locate 9,18 : Print "Enter Filename"
- Locate 9,19 : Print "To Add To:"
- Locate 3,14 : Input A$
- Cls 0,21,102 To 280,124
- If Exist("Df0:")
- Else
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STA
- End If
- If Exist(A$)
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "File exists " : Locate 9,19 : Print "Add(Y/N)?"
- Do
- S$=Inkey$
- S$=Upper$(S$)
- If S$="Y"
- Exit
- End If
- If S$="N"
- Goto STA
- End If
- Loop
- Else
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "File does"
- Locate 9,19 : Print "not exist!!"
- Wait 200
- Goto STA
- End If
- Locate 6,29 : Print A$
- Append 1,A$
- STAR2:
- Do
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "Enter record:"
- Locate 3,14 : Input B$
- If Exist("Df0:")
- Else
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STAR2
- End If
- Cls 0,21,102 To 280,124
- If B$="-1" Then Goto CLOS2
- B$=Upper$(B$)
- If Len(B$)>30
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "No more than" : Locate 9,19 : Print "30 characters!!"
- Wait 200
- Goto STAR2
- End If
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print B$ : Locate 9,19 : Print "is this O.K.?(Y/N)"
- Do
- S$=Inkey$
- S$=Upper$(S$)
- If S$="Y" Then Exit
- If S$="N" Then Goto STAR2
- Loop
- Print #1,B$
- Loop
- CLOS2:
- Close 1
- Goto STA
- End Proc
- Procedure COUNT
- If Exist("Df0:")
- Else
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STA
- End If
- Locate 9,18 : Print "Enter filename"
- Locate 9,19 : Print "To Count:"
- Locate 3,14 : Input F$
- If Exist("Df0:")
- Else
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STA
- End If
- If Exist(F$)
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "File exists " : Locate 9,19 : Print "Count(Y/N)?"
- Else
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "File does" : Locate 9,19 : Print "not exist!"
- Wait 200
- Goto STA
- End If
- Do
- S$=Inkey$
- S$=Upper$(S$)
- If S$="Y"
- Exit
- End If
- If S$="N"
- Goto STA
- End If
- Loop
- If Exist("Df0:")
- Else
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STA
- End If
- Cls 0,21,102 To 280,124
- Locate 6,29 : Print F$
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "Counting" : Locate 9,19 : Print F$
- Open In 1,F$
- Do
- Exit If Eof(1)
- A=A+1
- Input #1,A$
- Loop
- Close 1
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print A;" records" : Locate 9,19 : Print "counted in file"
- Wait 200
- Goto STA
- End Proc
- Procedure PRIN
- If C$="N"
- Locate 9,18 : Print "No printer" : Locate 9,19 : Print "Selected!!"
- Wait 200
- Goto STA
- Else
- If Exist("Df0:")
- Else
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STA
- End If
- Locate 9,18 : Print "Enter filename"
- Locate 9,19 : Print "To Print:"
- Locate 3,14 : Input F$
- If Exist("Df0:")
- Else
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STA
- End If
- If Exist(F$)
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "File exists " : Locate 9,19 : Print "Print(Y/N)?"
- Else
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "File does" : Locate 9,19 : Print "not exist!"
- Wait 200
- Goto STA
- End If
- Do
- S$=Inkey$
- S$=Upper$(S$)
- If S$="Y"
- Exit
- End If
- If S$="N"
- Goto STA
- End If
- Loop
- If Exist("Df0:")
- Else
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "No disk in" : Locate 9,19 : Print "Drive 0"
- Wait 200
- Goto STA
- End If
- Locate 6,29 : Print F$
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print "Printing" : Locate 9,19 : Print F$
- Open In 1,F$
- Do
- Exit If Eof(1)
- A=A+1
- Input #1,A$
- Print #2,A,A$
- Loop
- Close 1
- Cls 0,70,135 To 225,206
- Locate 9,18 : Print A;" records printed"
- Print #2,A;" records printed"
- Wait 100
- Goto STA
- End If
- End Proc