Page 1 of 1

Strings

Posted: Tue Mar 23, 2010 8:48 pm
by levitan
How do i import a 2000 character text file as a single string in QBasic? I am trying to use
OPEN "a.txt" For Input as #1
INPUT #1, a$
but it appends it to about 500 characters.

Any help is much appreciated.

Posted: Wed Mar 24, 2010 3:01 am
by angros47
Use input$

Posted: Wed Mar 24, 2010 3:55 pm
by coma8coma1
angros47 wrote:Use input$
hmm i've never used input$ before...

but i found this http://www.qb64.net/wiki/index.php?titl ... statement) and it seems simple enough. you can read a specific number of bytes at a time.

-,8

Posted: Wed Mar 24, 2010 4:57 pm
by burger2227
Try this link to use INPUT$(bytes%, filenumber%):

http://www.qb64.net/wiki/index.php?title=INPUT$