KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q43786: QB 4.00/4.00b Can Wrongly Assign User-TYPE Variable; 4.50 OK

Article: Q43786
Product(s): See article
Version(s): 4.00 4.00b
Operating System(s): MS-DOS
Keyword(s): ENDUSER | buglist4.00 buglist4.00b fixlist4.50 SR# S890117-41 | mspl13_basic
Last Modified: 27-APR-1989

In the program below, the QB.EXE editor (from QuickBASIC Versions 4.00
and 4.00b) fails to correctly assign a value to a variable of a
user-defined type (f.inx). This variable remains zero at all times.
The problem does not occur when the program is compiled into an .EXE.

Almost any change to the program corrects the error, such as renaming
the variable. It is difficult to find the same problem in a different
program.

Microsoft has confirmed this to be a problem in Versions 4.00 and
4.00b. This problem was corrected in QB.EXE from QuickBASIC Version
4.50.

Code Example

TYPE rectype
  a AS SINGLE
  inx AS INTEGER
END TYPE

DIM f AS rectype

f.a = 355
f.inx = 5

CLS
PRINT f.a
PRINT f.inx   ' this value will print out 0
END

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.