home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
sourcecode
/
various
/
general_selector.amos
/
general_selector.amosSourceCode
Wrap
AMOS Source Code
|
1993-01-08
|
5KB
|
154 lines
' How to use the procedure - GSEL
'
'
' First choose how many words the user can select
'
W=4
'
' Now define the array F$ with the amount of words you chose
'
Dim F$(W)
'
' Now fill each array with a word
'
F$(1)="Amos"
F$(2)="Amos Tome"
F$(3)="Amos 3D"
F$(4)="Amos Compiler"
'
' Then simply call the procedure
'
GSEL_["Amos Program",4]
'
'("Amos Program" is the title / 4 is the number of words)
'
' The result will now be stored in the variable Param$
'
' So you can simply print it like -:
'
Print "Your result was -: "+Param$
'
'NB. The title of the selector will switch between (a) & (an)
' depending on the first letter being a vowel or not.
'
' All words will be sorted in to alphabetical order
'
' As a default the screen created is screen 4
'
Procedure GSEL_[TYPE$,TF]
' Procedure written by Brett George
Auto View Off : Menu Off
Shared F$()
For Z=0 To TF
If F$(Z)="" Then F$(Z)="�" Else Inc NO_OF_FILES
Next
Screen Open 4,512,125,8,Hires
Flash Off : Curs Off
Palette 0,$888,$777,$BBB,$444,$AAA : Cls 0
_DRAW[90,10,484,124,-1,""] : PUSH[122,25,464,114,"",0]
PUSH[96,36,116,98,"",0] : Ink 0
_DRAW[95,20,117,34,-1,""] : _DRAW[95,100,117,114,-1,""]
_DRAW[98,37,114,97,-1,""]
Reserve Zone 12 : Sort F$(0)
_DRAW[95,20,117,33,1,""] : _DRAW[95,100,117,114,2,""]
Polygon 105,31 To 105,27 To 102,27 To 106,23 To 110,27 To 107,27 To 107,31
Get Block 1,101,22,16,10,0 : Get Block 2,101,22,16,10,0 : Vrev Block 2
Put Block 1 : Put Block 2,100,103 : ZB=0 : POS=0 : Wait Vbl
Paper 2 : Pen 0
If Left$(Upper$(TYPE$),1)="A" Then V$="n " Else Inc QWERTY
If Left$(Upper$(TYPE$),1)="E" Then V$="n " Else Inc QWERTY
If Left$(Upper$(TYPE$),1)="I" Then V$="n " Else Inc QWERTY
If Left$(Upper$(TYPE$),1)="O" Then V$="n " Else Inc QWERTY
If Left$(Upper$(TYPE$),1)="U" Then V$="n " Else Inc QWERTY
If QWERTY=5 Then V$=" "
Locate ,2 : Centre "Please select a"+V$+TYPE$
If NO_OF_FILES=<10
For FP=3 To 2+NO_OF_FILES
If F$(FP-3)<>"�"
Print At(16,FP+1)+Space$(40)
Print At(16,FP+1)+Zone$(F$(FP-3),FP)
End If
Next
Else
For FP=3 To 12
If F$(FP-3)<>"�"
Print At(16,FP+1)+Space$(40)
Print At(16,FP+1)+Zone$(F$(FP-3),FP)
End If
Next
End If
For Z=0 To 70
Screen Display Screen,,150-Z,,Z*2 : View : Wait Vbl
Next
Repeat
While Mouse Key=1
If Mouse Zone=1 and POS>0
If ZB=0
ZB=2 : PUSH[95,20,117,34,"",0] : Put Block 1
End If
Dec POS
For FP=3 To 12
Print At(16,FP+1)+Space$(40)
Print At(16,FP+1)+Zone$(F$(FP-3+POS),FP)
Next
End If
If Mouse Zone=2 and POS+10<NO_OF_FILES
If ZB=0
ZB=1 : PUSH[95,100,117,114,"",0] : Put Block 2,100,103
End If
Inc POS
For FP=3 To 12
Print At(16,FP+1)+Space$(40)
Print At(16,FP+1)+Zone$(F$(FP-3+POS),FP)
Next
End If
If ZB=1 Then _DRAW[95,100,117,114,-1,""] : Put Block 2,100,103 : ZB=0
If ZB=2 Then _DRAW[95,20,117,34,-1,""] : Put Block 1 : ZB=0
For Z=3 To NO_OF_FILES+2
If Mouse Zone=Z
RET$=F$(Z-3+POS) : Exit 3
End If
Next
Wend
Until Mouse Key=2
Curs Off : Reserve Zone : Del Block : ZB=0
For GO=70 To 0 Step True
Screen Display Screen,,150-GO,,GO*2 : View : Wait Vbl
Next
Limit Mouse 128,42 To 447,298+(-Ntsc*55) : Screen Close Screen
Auto View On : POS=0
End Proc[RET$]
Procedure PUSH[X,Y,X1,Y1,MESSAGE$,TIME]
' Procedure written by Brett George
Ink 2 : Bar X,Y To X1,Y1
If MESSAGE$<>""
Ink 0 : Box X-1,Y-1 To X1+1,Y1+1
Ink 1 : Plot X-1,Y-1 : Plot X-1,Y1+1 : Plot X1+1,Y-1 : Plot X1+1,Y1+1
End If
Ink 5 : Draw X1,Y1 To X,Y1 : Draw X1,Y1-1 To X+1,Y1-1
Draw X1,Y1 To X1,Y : Draw X1-1,Y1-1 To X1-1,Y : Ink 4
Draw X,Y To X1,Y : Draw X,Y+1 To X1-1,Y+1 : Draw X,Y To X,Y1
Draw X+1,Y To X+1,Y1-1
If MESSAGE$<>""
_=((X+X1)/2-(Text Length(MESSAGE$))/2)-2 : Gr Writing 0 : Ink 4
Text _,(Y+Y1)/2+Text Base/2,MESSAGE$
Ink 0
Text _-1,((Y+Y1)/2+Text Base/2)-1,MESSAGE$
End If
If TIME>0 Then Wait TIME : _DRAW[X,Y,X1,Y1,-1,MESSAGE$] : Wait TIME
End Proc
Procedure _DRAW[X,Y,X1,Y1,NUM,MESSAGE$]
'Procedure written by Brett George
Ink 0 : Box X-1,Y-1 To X1+1,Y1+1
Ink 1 : Plot X-1,Y-1 : Plot X-1,Y1+1 : Plot X1+1,Y-1 : Plot X1+1,Y1+1
Ink 2 : Bar X,Y To X1,Y1 : Ink 4 : Draw X1,Y1 To X,Y1
Draw X1,Y1-1 To X+1,Y1-1 : Draw X1,Y1 To X1,Y : Draw X1-1,Y1 To X1-1,Y-1
Ink 5 : Draw X,Y To X1,Y : Draw X,Y+1 To X1-1,Y+1
Draw X,Y To X,Y1 : Draw X+1,Y To X+1,Y1-1 : If NUM>0 Then Set Zone NUM,X,Y To X1,Y1 : Ink 0
If MESSAGE$<>""
_=((X+X1)/2-(Text Length(MESSAGE$))/2)-2 : Gr Writing 0 : Ink 4
Text _,(Y+Y1)/2+Text Base/2,MESSAGE$
Ink 0
Text _-1,((Y+Y1)/2+Text Base/2)-1,MESSAGE$
End If
End Proc