Difference between revisions of "Microsoft KB Archive/42983"

From BetaArchive Wiki
(importing KB archive)
m (Text replacement - "&" to "&")
Line 62: Line 62:
<pre class="codesample">  TOOLBOX &quot;I&quot;
<pre class="codesample">  TOOLBOX &quot;I&quot;
   TrapNo% = &amp;HA87C
   TrapNo% = &HA87C
   TOOLBOX &quot;P&quot;, TrapNo%, VARPTR(pattern%(0))
   TOOLBOX &quot;P&quot;, TrapNo%, VARPTR(pattern%(0))

Latest revision as of 14:14, 21 July 2020

Article ID: 42983

Article Last Modified on 1/9/2003


  • Microsoft QuickBasic Compiler for Macintosh 1.0

This article was previously published under Q42983


The CALL BACKPAT statement sets the background pattern that will be used by a subsequent CLS statement, or a subsequent Macintosh Quickdraw ROM routine that performs an erase operation (such as ScrollRect, a Toolbox ROM routine that is documented in the book "Inside Macintosh, Volume I" described below).

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


There are two equivalent ways to invoke BACKPAT; we recommend the first method for better program readability:

Method 1

   CALL BACKPAT (VARPTR(pattern%(0)))

The BACKPAT routine that is built into QuickBASIC is explained in "Microsoft QuickBASIC for Apple Macintosh: Language Reference" on Page 393. The CALL BACKPAT statement actually invokes the BACKPAT ROM toolbox trap described below in Method 2.

Method 2

   TrapNo% = &HA87C
   TOOLBOX "P", TrapNo%, VARPTR(pattern%(0))

Page 505 describes how to directly invoke the BACKPAT ROM toolbox trap with the ToolBox statement in QuickBASIC (however, this page fails to mention that VARPTR must operate on the passed pattern array or else you receive a "Type Mismatch" error).

Programming Notes

The pattern% array must be initialized with a pattern before you can use either method. For articles about using the Pattern Editor program or predefined System patterns, please query in this Knowledge Base on the following keywords:


More information about BACKPAT can be found in "Inside Macintosh, Volume 1" by Apple Computer (published by Addison-Wesley).

Additional query words: MQuickB

Keywords: KB42983