home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1990-12-11 | 1.4 KB | 63 lines |
- ' Limiting your text input program
- '
- ' By
- '
- ' Graham Stephenson
- '
- ' (aka Hawk/Zircon)
- '
- ' This program will enable you to input a string, without it scrolling onto
- ' the line below. It took me several attempts to get this working correctly,
- ' but now I bring you the full version!
- '
-
- 'Do : K$=Inkey$ : S=Scancode : Print K$;S : Loop
-
- Screen Open 0,640,200,4,Hires
- Flash Off : Paper 0 : Cls 0
-
- TXT$="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 "
- TXT$=TXT$+"!�$%^&*()_+|-=\,.<>/?;:#@[}]{"
-
- TXTX=25 : TXTY=0 : TXTL=20
- Home : Print "Please enter your name: ";
-
- INP_TEXT:
- Locate TXTX,TXTY
- ST$=""
- Do
- K$=Inkey$
- S=Scancode
- If S=65
- If Len(ST$)-1=>0
- ST$=Mid$(ST$,1,Len(ST$)-1)
- Locate TXTX,TXTY : Print ST$;" ";
- End If
- End If
- If S=68
- Goto DISPLAY_ROUTINE
- End If
- If K$<>""
- If Len(ST$)+1<=TXTL
- I=Instr(TXT$,K$)
- If I>0
- ST$=ST$+K$
- Locate TXTX,TXTY : Print ST$;
- End If
- End If
- End If
- Loop
-
- DISPLAY_ROUTINE:
- Cls 0
- Home
- Do
- Print ST$;
- Loop
-
- ' The "Display routine" can just be any series of statements that you
- ' want. Hope you find this useful. This routine can be expanded and used
- ' in most circumstances to make your programs look that little more
- ' user friendly...
- '
- ' Graham Stephenson 11-12-92