WriteLine()

Discuss any general programming issues here
Post Reply
User avatar
JurassicC
Posts: 36
Joined: Fri May 25, 2012 9:48 pm

WriteLine()

Post 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 ?
AmigaOne X1000 - RadeonHD 7870, 4GB RAM - AmigaOS 4.1ß
AmigaOne X5000 - Radeon R7 250, 2GB RAM - AmigaOS 4.1ß
PEB
Posts: 588
Joined: Sun Feb 21, 2010 1:28 am

Re: WriteLine()

Post by PEB »

This should work:
Writeline(2, A$..","..B$..","..C$)
User avatar
JurassicC
Posts: 36
Joined: Fri May 25, 2012 9:48 pm

Re: WriteLine()

Post by JurassicC »

Thanks I'll give it a go


--Edit--
Whoot.. thanks that works great :P
AmigaOne X1000 - RadeonHD 7870, 4GB RAM - AmigaOS 4.1ß
AmigaOne X5000 - Radeon R7 250, 2GB RAM - AmigaOS 4.1ß
Post Reply