Array Elements Are Passed in Temporary Variables for BC /D (57925)
This article was previously published under Q57925
SUMMARY
In a program compiled with the BC /D debug switch, array elements that
are passed to a SUB or FUNCTION are passed using temporary variables.
A program that is not compiled with the /D debug switch passes actual
array elements and does not use temporary variables.
When using the /D debug switch, taking the VARSEG and VARPTR of an
array element in the module level code returns the address of the
array element in memory. However, when taking the VARSEG and VARPTR of
the array element once it has been passed as a parameter to a SUB or
FUNCTION, VARSEG and VARPTR return the address of the temporary
variable that the array element is stored in.
In addition, a program that is being run in the QB.EXE or QBX.EXE
environment passes array elements using temporary variables since
debug mode is always on in the environment.
This information applies to Microsoft QuickBasic Versions 4.00, 4.00b,
and 4.50, to Microsoft Basic Compiler Versions 6.00 and 6.00b for
MS-DOS and MS OS/2, and to Microsoft Basic Professional Development
System (PDS) Version 7.00 for MS-DOS and MS OS/2.
Modification Type: |
Minor |
Last Reviewed: |
1/8/2003 |
Keywords: |
KB57925 |
|