Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 06:48 02 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Guest Book : line input command unexpected behaviour

Author Message
crez

Senior Member

Joined: 24/10/2012
Location: Australia
Posts: 152
Posted: 12:18pm 04 Jun 2021
Copy link to clipboard 
Print this post

Open "doc.txt" For input As #1
Line Input #1,t$
For i= 1 To 10
Print Asc(Mid$(t,i,1)),
Next i
Close #1

Open "doc.txt" For input As #1
t=Input$(10,#1)
For i= 1 To 10
Print Asc(Mid$(t,i,1)),
Next i
Close #1
End


gives
> RUN
97      32      98      32      99      32      100     32      101     32  
97      9       98      9       99      9       100     9       101     9
>

line input returns spaces = chr$(32)
input$ returns tabs = chr$(9) which is what is in doc.txt

Why?
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024