Page 1 of 1

tab delimited

Posted: Mon Jul 22, 2002 1:07 am
by Guest
Hello
Is it possible to read a tab-delimited file in Qbasic?
I can read a space-delimeted file but I cant read a tab-delimited one?
How about Quicbasic?
Can I read a tab-delimited file in Quickbasic?
Can you cc the answer to mkeskin@clemson.edu
Thanks

Re: tab delimited

Posted: Tue Jul 23, 2002 3:06 am
by frankiebaby
of course ya can, but ya gotta write the routine urself, i think u can read in on character at a time from the file with  S$=INPUT$(1,#1) then make a loop that keeps addings until it hits tab so like

Dim word$   ' to hold each tab delemited word
do
S$ = INPUT$(1, #1)
is S$ <> chr$(tab) then word$ = word$ + S$
loop until s$ = CHR$(tab)

'i think tab is 9

now word$ = the thingy u wanted to input, and it would skip tabs, since the last thing u read was he tab, running the loop again will start up on the next word

so just make sure the file ends with tab