BUG: Boolean Expression Using VAL Function Returns Wrong Value (57374)






This article was previously published under Q57374

SYMPTOMS

A Boolean expression returns an incorrect value if the VAL function is part of the Boolean expression.

This problem applies only to the binary version of Microsoft QuickBasic Version 1.00 for the Macintosh .

To work around this problem, first evaluate the VAL function and assign this to a temporary variable. You can then use the temporary variable in the Boolean expression.

Microsoft has confirmed this to be a bug in Microsoft QuickBasic for the Macintosh Version 1.00. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Code Example

The following code example demonstrates the problem:
   a$ = "3.33"
   variable! = 3.33
   PRINT (variable! = VAL(a$))

   OUTPUT --> 0
				
The following code is a possible workaround:
   a$ = "3.33"
   variable! = 3.33
   temp! = VAL(a$)
   PRINT (variable! = temp!)

   OUTPUT --> -1
				

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: kbbug KB57374