QB64 Print Using "\ \"

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Posts: 1
Joined: Fri Jan 15, 2016 4:18 am

QB64 Print Using "\ \"

Postby Nigel » Fri Jan 15, 2016 4:59 am

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

User avatar
Posts: 2144
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Re: QB64 Print Using "\ \"

Postby burger2227 » Fri Jan 15, 2016 12:43 pm

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.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : http://www.QB64.NET
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

Return to “QBASIC and QB64 Questions & Answers”

Who is online

Users browsing this forum: No registered users and 6 guests