Page 1 of 1

WriteLine()

Posted: Thu Sep 13, 2012 10:34 pm
by JurassicC
Is there a way WriteLine() can be used to write multiple strings to a single line of a file opened as #MODE_WRITE

Writeline(2, A$,B$,C$)

I'm looking to output as comma delimated, so creating a simple MS Excel compatable report

Idealy something like Writeline(2, A$,",",B$,",",C$)

Under QBASIC many years ago I seem to remember you could PRINT #2,A$,",",B$,",",C$ as output.csv

Or would I have to do

AA$=AddStr(A$,",")
BB$=AddStr(B$,",")
AAA$=AddStr(AA$,BB$)
BBB$=AddStr(AAA$,C$)
Writeline(2,BBB$)

Just seems a long way around especially if there are 10 variables to join together so one variable can be put into WriteLine()
Or could AddStr be improved to join more than 2 string together eg: AA$=AddStr(A$,",",B$,",",C$) then WriteLine() doesn't need to change ?
Or have i got my blinkers on and am i completely missing a better function that would do what i need ?

Re: WriteLine()

Posted: Thu Sep 13, 2012 11:02 pm
by PEB
This should work:
Writeline(2, A$..","..B$..","..C$)

Re: WriteLine()

Posted: Fri Sep 14, 2012 12:00 pm
by JurassicC
Thanks I'll give it a go


--Edit--
Whoot.. thanks that works great :P