home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1991-12-03 | 1.0 KB | 51 lines |
- Procedure XINPUT[XX,X,Y,PN,BG]
- ' By John Smit
- ' Used to gain greater control over the input into a program.
- ' xx = The maximum number of characters that can be input
- ' X/Y = Location where Text is Printed
- ' pn = colour to print in
- ' bg = Background colour
- ' String returned to veriable Param$
- '
- If XX<1 Then Pop Proc
- Clear Key
- Locate X,Y
- Paper BG
- Cline XX
- Pen PN
- X1=X
- '
- Z=0
- Z$=""
- Curs On
- Repeat
- X$=""
- If Z<>XX Then Curs On
- While X$=""
- X$=Inkey$
- Wend
- Curs Off
- SC=Scancode
- If SC=65 or SC=70
- If Len(Z$)<>0
- Z$=Left$(Z$,(Len(Z$)-1))
- Dec Z
- Dec X1
- Print At(X,Y)+Z$+" "
- Locate X1,Y
- End If
- End If
- If Asc(X$)>31 and Asc(X$)<127 and Z<XX
- Z$=Z$+X$
- Inc Z
- Inc X1
- Print At(X,Y)+Z$
- Locate X1,Y
- End If
- Until Asc(X$)=13
- Curs Off
- End Proc[Z$]
- '
- ' example
- XINPUT[5,5,5,5,8]
- Print At(1,1)+Param$