Microsoft KB Archive/39589

From BetaArchive Wiki
Knowledge Base

BUG: Extra $ with PRINT USING "$$" Format in Mac QuickBasic

Article ID: 39589

Article Last Modified on 11/21/2006

This article was previously published under Q39589


Within the interpreter of Microsoft QuickBasic Version 1.00 for the Macintosh, the floating dollar sign ("$$") format of the PRINT USING statement does not work correctly when multiple variables are used in the argument list. The problem does not occur in compiled programs.

The code example below demonstrates the problem. If the first argument uses the floating dollar sign ("$$") in the format string, any subsequent arguments are incorrectly displayed with the floating dollar sign.

A workaround for this problem is to break up the PRINT USING statement into several PRINT USING statements so that each has only one argument.

Microsoft has confirmed this to be a bug in Version 1.00. We are researching this problem and will post more information as it becomes available.


The following code example shows the problem:

 x = 0: y = 1
 PRINT USING "$# ##"; x, y     ' Not a floating dollar problem.
 PRINT USING "$$### ##"; x, y  ' This is a floating dollar problem.

The program above gives the following output:

$0  1             <---- Output OK.
   $0 $1          <---- Problem: Should be no $ on second argument.

A workaround is to print the variables in separate PRINT USING statements:

 PRINT USING "$$###"; x;       ' These two will work. Use semi-colon
 PRINT USING "##"; y           ' to concatenate output.

The following is the output from the above workaround:

   $0  1

Additional query words: MQuickB

Keywords: kbbug KB39589