Input loop: Difference between revisions
Content added Content deleted
(Added uBasic/4tH version) |
(Added another uBasic/4tH version) |
||
Line 714: | Line 714: | ||
Print Show(Tok(0)) |
Print Show(Tok(0)) |
||
Loop |
Loop |
||
Close a |
|||
</lang> |
|||
This version tokenizes the line read and prints all individual words. |
|||
<lang>If Set (a, Open ("myfile.bas", "r")) < 0 Then Print "Cannot open \qmyfile.bas\q" : End |
|||
Do While Read (a) ' get next line |
|||
Do |
|||
p = Here() ' save cursor position |
|||
s = Tok(Ord(" ")) ' tokenize next word |
|||
Until p = Here() ' quit if cursor didn't progress |
|||
If Len(s) Then Print Show(s) ' print only full words |
|||
Loop ' next word |
|||
Loop ' next line |
|||
Close a |
Close a |