BUG: Internal Error for SWAP of TYPE Elements in SUB Using VAL

ID: Q80412


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2, versions 7.0, 7.1


SYMPTOMS

An "Internal Error" message may occur at compile time if you use the SWAP statement to swap two elements of a user-defined TYPE statement in a SUB program where the VAL function is used to assign values to the elements of the TYPE.


WORKAROUND

All of the following are workarounds to this problem:

  • Compile with the BC /X option. The /X option normally indicates the presence of RESUME statements in the code, and inhibits some compiler optimizations.


  • Avoid using the SWAP statement.


  • Assign the results of the VAL function to a temporary variable before assigning a value to the TYPE element.



STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.


MORE INFORMATION

Code to Reproduce Error


TYPE X
   AAA AS LONG
   BBB AS SINGLE
   CCC AS SINGLE
END TYPE

SUB TEST (Z AS X)
   Z.BBB = VAL("1")
   Z.CCC = VAL("1")
   SWAP Z.BBB, Z.CCC
END SUB 

Additional query words: VBmsdos buglist1.00 buglist7.00 buglist7.10 1.00 7.00 7.10

Keywords :
Version : MS-DOS:1.0; :7.0,7.1
Platform : MS-DOS
Issue type :


Last Reviewed: December 4, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.