Must Initialize Toolbox-Routine Parameters; GetDirName Sample (38374)
This article was previously published under Q38374
SUMMARY
The first reference to a variable cannot be in a toolbox-library
routine. All variables used with library routines must be explicitly
initialized (assigned to a certain value) before you use them with a
library statement. If this is not done, incorrect program behavior may
occur, as shown in the example below.
QuickBASIC DOES NOT warn you about uninitialized variables passed to
toolbox-library routines, thus you must remember to initialize them.
Note that QuickBASIC DOES warn you with a "Type Mismatch" message at
run time if you pass the incorrect variable type (string, integer,
single precision, or double precision) to a toolbox routine or to many
calls of the ToolBox statement. The type-checking information for a
toolbox-library routine is stored in that routine's MBLC resource in
QuickBASIC. For the ToolBox statement, which is a special MBLC
routine, the type-checking information is stored in the MBTS resource
in QuickBASIC and can be modified.
Modification Type: |
Minor |
Last Reviewed: |
1/8/2003 |
Keywords: |
KB38374 |
|