home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-09-02 | 9.0 KB | 403 lines |
- Rem ********
- Rem ************** EasyBase1200 **************
- Rem ********** Bill Currie 1993 ***********
- Rem *******************
- '
- Rem AMOS copyright notice
- '
- AMOSC
- Procedure AMOSC
- Screen Open 0,320,256,32,Lowres
- Curs Off : Paper 0 : Cls 0 : CB[0]
- Get Icon Palette
- Locate 0,1
- Centre ">>> Program by Bill Currie <<<"
- Flash 3,"(f00,32)(f80,32)(ff0,32)(0f0,32)(08f,32)(88f,32)(f0f,32)"
- Pen 3 : Ink 3 : Box 50,40 To 270,150
- Locate 0,11
- Centre Border$("EasyBase",1)
- Ink 0 : Pen 2
- Paste Icon 230,20,2
- _SMALL_COPYRIGHT[225]
- End Proc
- Procedure _SMALL_COPYRIGHT[YDISPLAY]
- '
- Auto View Off
- '
- Screen Open 7,320,24,16,0 : Curs Off : Flash Off : Cls 0
- Screen Display 7,,-100,,
- Paste Bob 260,3,1
- Paper 0 : Pen 7 : Print At(1,1);"This program was written using"
- Get Sprite Palette
- View : Wait Vbl
- '
- For Y=1 To Screen Height/2
- Screen Display 7,,YDISPLAY+Screen Height/2-Y,,Y*2
- Screen Offset 7,,Screen Height/2-Y
- View : Wait Vbl
- Next
- '
- Do
- If Mouse Key=1 Then Exit
- Loop
- '
- For Y=Screen Height/2 To 0 Step -1
- Screen Display 7,,YDISPLAY+Screen Height/2-Y,,Y*2
- Screen Offset 7,,Screen Height/2-Y
- View : Wait Vbl
- Next
- '
- Screen Close 7
- Auto View On
- '
- Cls
- End Proc
- '
- Limit Mouse
- EASYBASE
- Procedure EASYBASE
- BEGINOVER:
- Screen Open 0,320,256,4,Lowres
- Curs Off : Colour 0,$77 : Paper 0 : Cls 0 : CB[0]
- Locate 0,10 : Centre "Easy Base"
- THEMENU
- Do
- Menu Off
- Menu On
- BL=0
- If Key State(95)=True Then HELP
- If Choice<>-1 Then Goto NOCHOICE
- If Choice(1)=1 and Choice(2)=1 Then MAKE_BASE : Goto BEGINOVER
- If Choice(1)=1 and Choice(2)=2 Then SEE_BASE : Goto BEGINOVER
- If Choice(1)=1 and Choice(2)=3 Then AMEND_BASE : Goto BEGINOVER
- If Choice(1)=1 and Choice(2)=4 Then DELETE_BASE : Goto BEGINOVER
- If Choice(1)=1 and Choice(2)=5 Then HELP : Goto BEGINOVER
- If Choice(1)=1 and Choice(2)=6 Then AMOSC : End
- NOCHOICE:
- Loop
- End Proc
- Procedure THEMENU
- Menu Del
- Menu$(1)=" Options "
- Menu$(1,1)=' Make Base '
- Menu$(1,2)=' See Base '
- Menu$(1,3)=' Amend Base '
- Menu$(1,4)=' Delete Base '
- Menu$(1,5)=" Help "
- Menu$(1,6)=' Quit '
- Menu$(1,7)=' (in1,1)(lo8,0)(ss6)A(lo18,0)(ss0)A <> WB'
- End Proc
- '
- '
- Procedure BASE_SCREEN
- Screen Open 0,640,256,8,Hires
- Curs Off : Flash Off : Colour 3,$FF0 : Colour 0,$77 : Cls 0
- Paper 0 : Pen 3 : Centre "Easy Base"
- Paper 1
- Wind Open 1,16,16,76,28
- Clw
- Paper 0
- Wind Open 2,32,32,72,1
- Clw
- Wind Open 3,32,48,72,1
- Clw
- Wind Open 4,32,64,72,1
- Clw
- Wind Open 5,32,80,72,1
- Clw
- Wind Open 6,32,96,72,1
- Clw
- Wind Open 7,32,112,72,1
- Clw
- Wind Open 8,32,128,72,1
- Clw
- Wind Open 9,32,144,72,1
- Clw
- Wind Open 10,32,160,72,1
- Clw
- Wind Open 11,32,176,72,1
- Clw
- Wind Open 12,32,192,72,1
- Clw
- Wind Open 13,32,208,72,1
- Clw
- End Proc
- Procedure MAKE_BASE
- BASE_SCREEN
- Window 2 : Clw
- Input "Base File Name ";F$;
- If F$="" Then Goto XIT
- If Exist(F$)
- Window 3 : Clw
- Print "File ";F$;" already exists!";
- While Inkey$<>"" : Wend
- While Inkey$="" : Wend
- Goto XIT
- End If
- Open Random 1,F$
- Field 1,70 As A$,70 As B$,70 As C$,70 As D$,70 As E$,70 As F$,70 As G$,70 As H$,70 As I$,70 As J$
- For I=1 To 50
- A$=" " : B$=" " : C$=" " : D$=" " : E$=" "
- F$=" " : G$=" " : H$=" " : I$=" " : J$=" "
- Put 1,I
- Next I
- Do
- For I=3 To 13 : Window I : Clw : Next I
- Window 3 : Clw
- Input "Record No {1 - 50, 0 to Exit} ";R;
- Exit If R=0
- Window 4 : Clw
- Input "";A$;
- A$=Left$(A$,70)
- Window 5 : Clw
- Input "";B$;
- B$=Left$(B$,70)
- Window 6 : Clw
- Input "";C$;
- C$=Left$(C$,70)
- Window 7 : Clw
- Input "";D$;
- D$=Left$(D$,70)
- Window 8 : Clw
- Input "";E$;
- E$=Left$(E$,70)
- Window 9 : Clw
- Input "";F$;
- F$=Left$(F$,70)
- Window 10 : Clw
- Input "";G$;
- G$=Left$(G$,70)
- Window 11 : Clw
- Input "";H$;
- H$=Left$(H$,70)
- Window 12 : Clw
- Input "";I$;
- I$=Left$(I$,70)
- Window 13 : Clw
- Input "";J$;
- J$=Left$(J$,70)
- Put 1,R
- Loop
- Close 1
- XIT:
- End Proc
- Procedure SEE_BASE
- BASE_SCREEN
- Window 2 : Clw
- Input "Base File Name ";F$;
- If F$="" Then Goto XIT
- If Not Exist(F$)
- Print "File ";F$;" does not exist!";
- While Inkey$<>"" : Wend
- While Inkey$="" : Wend
- Goto XIT
- End If
- Open Random 1,F$
- Field 1,70 As A$,70 As B$,70 As C$,70 As D$,70 As E$,70 As F$,70 As G$,70 As H$,70 As I$,70 As J$
- Do
- For I=3 To 13 : Window I : Clw : Next I
- Window 3 : Clw
- Input "Record No {1 - 50, 0 to Exit} ";R;
- Exit If R=0
- Get 1,R
- Window 4 : Clw
- Print A$;
- Window 5 : Clw
- Print B$;
- Window 6 : Clw
- Print C$;
- Window 7 : Clw
- Print D$;
- Window 8 : Clw
- Print E$;
- Window 9 : Clw
- Print F$;
- Window 10 : Clw
- Print G$;
- Window 11 : Clw
- Print H$;
- Window 12 : Clw
- Print I$;
- Window 13 : Clw
- Print J$;
- Window 1 : Curs Off : Paper 1
- Locate 0,26 : Centre "[P]rint [next]"
- CHOOSE:
- K$="" : While K$="" : K$=Inkey$ : Wend
- If(K$="P") or(K$="p")
- On Error Goto ER
- Goto OK
- ER:
- ERR
- Resume CHOOSE
- OK:
- Open Port 2,"Prt:"
- On Error Goto ER2
- Goto OK2
- ER2:
- ERR
- Close 2
- Resume CHOOSE
- OK2:
- Print #2,""
- Print #2,A$
- Print #2,B$
- Print #2,C$
- Print #2,D$
- Print #2,E$
- Print #2,F$
- Print #2,G$
- Print #2,H$
- Print #2,I$
- Print #2,J$
- Print #2,""
- Close 2
- Goto CHOOSE
- End If
- Cline
- Paper 0
- Loop
- Close 1
- XIT:
- End Proc
- '
- Procedure AMEND_BASE
- BASE_SCREEN
- Window 2 : Clw
- Input "Base File Name ";F$;
- If F$="" Then Goto XIT
- If Not Exist(F$)
- Print "File ";F$;" does not exist!";
- While Inkey$<>"" : Wend
- While Inkey$="" : Wend
- Goto XIT
- End If
- Open Random 1,F$
- Field 1,70 As A$,70 As B$,70 As C$,70 As D$,70 As E$,70 As F$,70 As G$,70 As H$,70 As I$,70 As J$
- Do
- For I=3 To 13 : Window I : Clw : Next I
- Window 3 : Clw
- Input "Record No {1 - 50, 0 to Exit} ";R;
- Exit If R=0
- Window 4 : Clw
- Input "";A$;
- A$=Left$(A$,70)
- Window 5 : Clw
- Input "";B$;
- B$=Left$(B$,70)
- Window 6 : Clw
- Input "";C$;
- C$=Left$(C$,70)
- Window 7 : Clw
- Input "";D$;
- D$=Left$(D$,70)
- Window 8 : Clw
- Input "";E$;
- E$=Left$(E$,70)
- Window 9 : Clw
- Input "";F$;
- F$=Left$(F$,70)
- Window 10 : Clw
- Input "";G$;
- G$=Left$(G$,70)
- Window 11 : Clw
- Input "";H$;
- H$=Left$(H$,70)
- Window 12 : Clw
- Input "";I$;
- I$=Left$(I$,70)
- Window 13 : Clw
- Input "";J$;
- J$=Left$(J$,70)
- Put 1,R
- Loop
- Close 1
- XIT:
- End Proc
- Procedure DELETE_BASE
- BASE_SCREEN
- Window 2 : Clw
- Input "Base File Name ";F$;
- If F$="" Then Goto XIT
- If Not Exist(F$)
- Window 3 : Clw
- Print "File ";F$;" does not exist!";
- While Inkey$<>"" : Wend
- While Inkey$="" : Wend
- Goto XIT
- End If
- Window 3 : Clw
- Print "/!\ IRREVERSIBLE /!\ Delete ";F$;" Y/N ? ";
- Do
- A$=Inkey$
- If(A$="Y") or(A$="y") Then Kill F$ : Exit
- If(A$="N") or(A$="n") Then Exit
- Loop
- XIT:
- End Proc
- '
- Procedure HELP
- Cls 0
- On Error Goto ER
- Goto OK
- ER:
- ERR
- Resume XIT
- OK:
- Screen Open 2,640,256,4,Hires
- Curs Off : Colour 0,$77 : Paper 0 : Cls 0 : CB[0]
- Colour 1,$FF
- Locate 0,5 : Centre " EasyBase "
- Locate 0,10 : Centre "Free Form !!"
- Locate 0,13 : Centre "50 Records"
- Locate 0,16 : Centre "10 Items per Record"
- Locate 0,19 : Centre "70 Characters per Item"
- Ink 1 : Box 50,10 To 580,220
- While Mouse Key<>0 : Wend
- While Key State(90)=True : Wend
- Do
- If(Mouse Key=1) or(Key State(95)) Then Exit
- Loop
- Screen Close 2
- Wait 50
- XIT:
- End Proc
- '
- Procedure ERR
- On Error Goto ER
- Goto OK
- ER:
- Resume XIT
- OK:
- Screen Open 3,320,48,4,Hires
- Screen Display 3,200,100,320,48
- Curs Off : Cls 1 : Colour 0,$70
- Print : Centre "Error - Out of Memory/Range?"
- Print
- Print : Centre "Press Left Mouse Key"
- Wait 50
- Do : Exit If Mouse Key=1 : Loop
- Screen Close 3
- XIT:
- End Proc
- '
- Procedure CB[IV]
- On Error Goto ER
- Goto OK
- ER:
- ERR
- Resume XIT
- OK:
- Colour Back(Colour(IV))
- Rem Dummy Screen
- Screen Open 6,16,8,2,Lowres
- Screen Display 6,0,0,16,8
- Screen Close 6
- Wait 50
- XIT:
- End Proc
- '
- Rem
- Rem ***********
- Rem **** End ****
- Rem ***************************************************