Qbasicnews.com

Full Version: Function Request
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Now FB has PRINT USING and PRINT # USING implemented, perhaps it's time to fill one of the QB shortcomings, the "format to string", a function returning a string formatted by USING, a sort of C's sprintf...

Probably PRINT USING is already using an internal buffer, it would be a matter of returning that buffer instead of printing.

In QB there was a hack using FIELD and a NUL file, but in FB FIELD has a different meaning...
that would be awesome!
Unfortunately, PRINT USING does not work in exponential format (at least in 0.12b). For instance, the following code:

Code:
x# = 1.23D-5
print using "#.##^^^^"; x#

prints 1.23

It seems that the caret string is simply ignored.

I asked the question on this forum some time ago, but Victor said that this could not be corrected Cry