TAB() Not Working Properly!?

by Jeff (no login)


I'm using qb64 trying to print to a text file several strings on a line/row with separating tabs as follows:

PRINT #1, "A"; "B"; "C"; TAB(5); "XXXX"; TAB(5); "XXXX"; TAB(5); "XXXX"; " D"
The result is:


Am I missing something???
Is there a way around this?

The above does not show the actual print out result because the forum print reformatted it by closing the spaces.
The actual print out placed the 1st tabbed "XXXX"'s one space over from ABC on the 1st line; printed four spaces over to the 2nd XXXX's on a second line; then print four spaces over to the 3rd XXXX's on a third line, and finally the space-D next to that.
Apparently, qb64 doesn't use the TAB() function!?
I was reading from a QBasic manual that shows the above code should print out normally as:


Actually, the "desired" result should show five spaces (tabs) between the "strings" but several sequential spaces are, again, reformatted in this forum to one space between words. Tabs don't work in this forum either.

What I actually need is to code for true tabbed spaces so that when the cursor advances over the tabbed spaces in the text file the cursor jumps across the spaces to the next position as occurs when actually manually tabbing in a text file (e.g. Notepad).

The reason I want to use tabs in this way is because it serves as a seperator between cells when exporting large amounts of processed data to OpenOffice.orgCalc's spreadsheet application, which I use as a database for mail merge applications, etc.

Any help would be greatly appreciated!


Posted on Mar 15, 2011, 4:01 PM

Respond to this message   

Return to Index

Response TitleAuthor and Date
Re: TAB() Not Working Properly!?Jeff on Mar 15
 How the TAB function worksChronoKitsune on Mar 15
TAB is not the same as SPCSolitaire on Mar 15
 * TAB was an AWFUL name for that! It SHOULD have been POS(column%)!Clippy on Mar 18
  Understandable though...TheBOB on Mar 18

 Copyright © 1999-2018 Network54. All rights reserved.   Terms of Use   Privacy Statement