QB 4.50 Parameter Passed to Separate Module Shows as Garbage (58732)
This article was previously published under Q58732
SYMPTOMS
A QuickBasic 4.50 program that calls a subprogram located in a
separate module (such as in a library or Quick library) can have a
parameter's contents become corrupt under the specific circumstances
described further below. After the parameter has been corrupted,
PRINTing that parameter may display "garbage" instead of the correct
results.
STATUS
Microsoft has confirmed this to be a bug in Microsoft QuickBasic
Version 4.50. We are researching this problem and will post new
information here in the Microsoft Knowledge Base as it becomes available.
This problem does NOT occur in earlier versions of QuickBasic, in
Microsoft Basic Compiler Versions 6.00 or 6.00b for MS-DOS and MS
OS/2, or in Microsoft Basic Professional Development System (PDS)
Version 7.00 for MS-DOS and MS OS/2.
WORKAROUND
One workaround to the problem is to assign the variable located in the
second position of the parameter list to a temporary variable and work
with that temporary variable. At the end of the procedure, assign the
parameter variable the value of the temporary variable. For example,
the procedure in the library or Quick library would look like the
following:
SUB Garbage (x, y, z)
ytemp = y
z = x * ytemp
y = ytemp
PRINT "Printing ytemp "; ytemp
PRINT "Printing y "; y
END SUB
Another workaround is to pass variables through a COMMON SHARED
statement instead of a parameter list.
Modification Type: |
Minor |
Last Reviewed: |
1/9/2003 |
Keywords: |
KB58732 |
|