Microsoft KB Archive/58820

From BetaArchive Wiki
Knowledge Base

ToolBox "Type Mismatch"; Use VARPTR on Array Parameter

Article ID: 58820

Article Last Modified on 1/9/2003


  • Microsoft QuickBasic Compiler for Macintosh 1.0

This article was previously published under Q58820


Many of the ToolBox statement calls documented in Section E.10.3 (Pages 497-524) of "Microsoft QuickBASIC for Macintosh: Language Reference" incorrectly show passing arrays by simply passing the first element of the array.

In most of these cases, this causes the error "Type Mismatch" on the ToolBox statement. To avoid this error, pass the VARPTR of the first element of the array.

One exception to this rule is the return array for register-based calls. This array can be passed with the first element of the array without using VARPTR.

The following routines on Pages 497-524 should pass the VARPTR of the first array element:

BackPat CopyBits EraseArc FillArc FrameArc InvertArc PaintArc RectInRgn ScrollRect SetPortBits

This information applies to Microsoft QuickBASIC Version 1.00 for the Apple Macintosh.


The following is a correct example of the BackPat ToolBox call:

   DIM pattern%(3)
   ToolBox "i"
   ToolBox "P", &HA87C, VARPTR(pattern%(0))

Additional query words: MQuickB

Keywords: KB58820