Microsoft KB Archive/101664

= BUG: VB for MS-DOS Changes Basic PDS 7.0 STRINGs to LONGs =

Article ID: 101664

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft Visual Basic for MS-DOS
 * Microsoft BASIC Professional Development System 7.0

-



This article was previously published under Q101664



SYMPTOMS
Loading a file into Visual Basic version 1.0 for MS-DOS causes "Type Mismatch" or "Illegal Function Call" and possibly other compile-time and run-time errors if the file was originally saved in Microsoft Basic Professional Development System (PDS) version 7.0 binary format.

This problem does not occur in Basic PDS version 7.1 and only occurs when transferring binary format files from PDS version 7.0 to Visual Basic version 1.0 for MS-DOS.



CAUSE
Files saved with the binary format from Basic PDS version 7.0 can be loaded into Visual Basic version 1.0 for MS-DOS, but Function or Sub procedure parameters that have the type STRING specification character (for example, MyString(A$)) are incorrectly converted to a type LONG (for example, MyString(A#)) when loaded into Visual Basic version 1.0 for MS-DOS. This is also true for functions defined to return the STRING type; for example, Function A$ becomes Function A#.

This problem does not occur when moving files from Basic PDS version 7.10 or Microsoft QuickBasic programs to Visual Basic for MS-DOS.



RESOLUTION
To solve this problem, load the program file into Basic PDS version 7.0. Then save the program with the 'Text - Readable by other programs' format selected. Programs saved in the text format load correctly into Visual Basic version 1.0 for MS-DOS.



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
The Microsoft Basic Professional Development System (PDS) version 7.0 supports a Binary Fast Load and Save format option under the FILE : SAVE and FILE : SAVE AS menu options. When upgrading from PDS version 7.00 to Microsoft Visual Basic version 1.0 for MS-DOS, programs that had been saved with the Binary Fast Load and Save format option cause an incorrect change in the type for string parameters and functions defined to return a string if either is declared using the STRING type specification ($).

When saving a file from Microsoft Basic products (the Microsoft QuickBasic series, Basic PDS, and Visual Basic for MS-DOS), you can choose to from two save formats -- text and binary. The files you save with the binary format are actually partially compiled code. They are faster to load because they have already been through the first phase of parsing.

Steps To Reproduce Problem
  In Basic PDS version 7.0, type in the following code: DECLARE FUNCTION myfunction! (a$) DECLARE FUNCTION mystringfunction$

FUNCTION myfunction! (a$) END FUNCTION

FUNCTION mystringfunction$ END FUNCTION

SUB mysub(b$) END SUB  Save the file in Binary - Fast Load and Save format. From the File menu, choose Save As. Type in a file name, and select the 'Binary - Fast Load and Save' format option Exit from Basic PDS version 7.0. Start Visual Basic version 1.0 for MS-DOS, and load the file saved in step 2.  The code appears as follows: DECLARE FUNCTION myfunction! (a#) DECLARE FUNCTION mystringfunction#

FUNCTION myfunction (a#) END FUNCTION

FUNCTION mystringfunction# END FUNCTION

SUB mysub(b#) END SUB </li></ol>

Note that all STRING type specification characters ($) have been changed to LONG type specification characters (#).

Additional query words: VBmsdos BasicCom buglist1.00 B_BasicCom 1.00 7.00

Keywords: kbbug KB101664

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.