home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
501-525
/
apd520
/
asstd_programs
/
menuprogram.amos
/
menuprogram.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1991-01-02
|
4KB
|
150 lines
If Screen >-1
Screen Close Screen
End If
Screen Open 1,320,256,8,Lowres
Palette 0,$99F,$F00,$F0,$F00,$FF0,$66A,$CCF
Break On : Hide On : Colour Back 0
Change Mouse 1
Cls 0 : Curs Off : Flash Off
Limit Mouse 129,43 To 430,280
Pen 1 : Paper 0
Key Speed 20,3
Dim F$(31)
Global F$()
Unpack 7
Wind Save
If Exist("Menu.Dat")
Open In 1,"Menu.Dat"
For X=1 To 30
Line Input #1,F$(X)
Next
Close 1
End If
DISPMENU[0]
Do
K$=Inkey$ : SC=Scancode : KS=Key Shift : MK=Mouse Key
If KS<8
Colour 4,$F00
DISPMENU[0]
End If
If KS=8
Colour 4,$FF0
DISPMENU[10]
End If
If KS=16 or KS=32
Colour 4,$F0
DISPMENU[20]
End If
If KS=80 or KS=160 or MK=2
EDMENU
Hide On
End If
If SC>79 and SC<90 : PROGRUN[SC,KS] : End If
Loop
Procedure PROGRUN[SC,KS]
If KS=8 : P=10 : End If
If KS=16 or KS=32 : P=20 : End If
X=(SC-79)+P
If F$(X)<>""
If Exist(F$(X))
Cls 0 : Locate 0,11
Centre "Loading"+" "
Print : Print : Centre F$(X)+" "
Print : Print : Centre "Please Wait"+" "
Run F$(X)
Else
Wind Open 1,80,100,20,3
Curs Off : Paper 1 : Pen 0 : Clw
Print : Centre "Can't Find Program"
Bell : Wait 100
Wind Close
End If
End If
End Proc
Procedure DISPMENU[P]
Locate 2,9
For X=1 To 10
If X<6
Print At(5,);Left$("F"+(Str$(X)-" ")+" "+F$(X+P)-".amos"-".AMOS"-".Amos"-".Bak"+Space$(20),15)
Else
Print At(21,);Left$("F"+(Str$(X)-" ")+" "+F$(X+P)-".amos"-".AMOS"-".Amos"-".Bak"+Space$(20),15)
End If
Print : Print
If X=5 : Locate 20,9 : End If
Next
End Proc
Procedure EDMENU
Wind Open 1,36,60,30,18
Paper 1 : Curs Off
Clw : Show On
Reserve Zone 2
Paper 6 : Pen 5
Print At(1,1);" Edit Menu - Esc to Exit "
Pen 0 : Paper 1
Print At(1,3);"Press function key you wish"
Print At(1,4);"to store new program under."
Print At(1,6);"Type name of program."
Print At(1,8);"Then select SAVE, (Alt + S)"
Print At(1,9);"to store new Configuration."
Print At(4,16);Border$(Zone$("Save",1),1)
Print At(22,16);Border$(Zone$("Exit",2),1)
Do
K$=Inkey$ : SC=Scancode : KS=Key Shift : MK=Mouse Click : MZ=Mouse Zone
Exit If SC=69 or(MZ=2 and MK=1)
If KS<8
Colour 4,$F00
End If
If KS=8
Colour 4,$FF0
End If
If KS=16 or KS=32
Colour 4,$F0
End If
If SC>79 and SC<90
Gosub EDLINE
End If
If((KS=16 or KS=32) and SC=33) or(MZ=1 and MK=1)
Print At(3,14);"** Saving 'Menu.Dat' **"
Open Out 1,"Menu.Dat"
For X=1 To 30
Print #1,F$(X)
Next
Close 1
Wait 30
Wind Close : Pop Proc
End If
Loop
If CHANGED=1
Print At(3,14);"Data Has Not Been Saved"
Bell
Do
K$=Inkey$ : SC=Scancode : KS=Key Shift : MK=Mouse Click : MZ=Mouse Zone
Exit If SC=69 or(MZ=2 and MK=1)
If((KS=16 or KS=32) and SC=33) or(MZ=1 and MK=1)
Print At(3,14);"** Saving 'Menu.Dat' **"
Open Out 1,"Menu.Dat"
For X=1 To 30
Print #1,F$(X)
Next
Close 1
Wait 30
End If
Loop
End If
Wind Close
Pop Proc
EDLINE:
P=0 : X$=""
If KS=8 : P=10 : X$="Control + " : End If
If KS=16 or KS=32 : P=20 : X$="Alt + " : End If
X=(SC-79)+P
Print At(3,11);"Key... ";X$;"F"+Str$(X-P)-" ";Space$(10)
Locate 1,13 : Print "Old Name. ";F$(X)
Locate 1,14 : Line Input "New Name. ";A$
Curs Off
Print At(3,11);Space$(20)
Print At(1,13);Space$(30)
Print At(1,14);Space$(30)
If A$<>"" : F$(X)=A$ : CHANGED=1 : End If
Return
End Proc