Page 1 of 1

QB64 Print Using "\ \"

Posted: Fri Jan 15, 2016 4:59 am
by Nigel
I'm using QB64 version 1 on Windows 7 Professional SP1 Intel Xeon CPU E31245 3.3GHz
The following results in a type mismatch on line 3. Why?

x1 = 1543.238
tmp$ = "\ \"
PRINT USING tmp$; x1;

I really need to write to a file but cannot even get it to work on the screen.
I have several columns and rows of variable length figures to output to a file which I need to line up for readability with the headings. I have tried all sorts of configurations for this.
Any suggestions?

Thanks, Nigel

Re: QB64 Print Using "\ \"

Posted: Fri Jan 15, 2016 12:43 pm
by burger2227
You must use # digits instead to create string numbers in the template.

"\ \" is used for string values cut off over spaces + 2 for the \characters. IE it will not show longer strings fully.

template$ = "$$######,.##" ' sets $ sign to start of number with comma thousands and decimal point

See chart of USING character formats

USING also rounds decimal point values up like CINT to values according to decimal places desired.