Microsoft KB Archive/59287

= Example of Alert, a QuickBASIC Toolbox Library (MBLC) Routine =

Article ID: 59287

Article Last Modified on 11/21/2006



This article was previously published under Q59287



SUMMARY
Below is an example of using the Alert routine, which is a Toolbox library (MBLC) routine described on Pages 439-441 and 475 of the &quot;Microsoft QuickBASIC for Apple Macintosh: Language Reference&quot; manual.

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



MORE INFORMATION
For a more complete demonstration program, see the Alert Demo program in the QB Demos folder on the QuickBASIC Examples disk.

The syntax for the Alert routine is as follows

alert ref%,type%,id%,item%,a$(0),a$(1),a$(2),a$(3)

where:

ref% = the reference number of an open resource file

type% = the type of icon (if any) displayed in the alert box (see Pages 439 and 475)

id% = ID number of a specific alert box in the opened resource file referenced by ref%

item% = returns the number of the button that was pressed in the alert box

a$ = strings that you can put into the alert box

Code Example
ref%=0 IF SYSTEM(4) THEN   ' If program is compiled, use OpenResFile... n$=&quot;Examples:QB Demos:Demo Resources&quot; 'Specify &quot;disk:folder:file&quot; OpenResFile n$,ref% ELSE ' else if interpreted, get file reference number of QuickBASIC: ref% = SYSTEM(7) END IF ' NOTE: The alert box with ID number 305 is stored in the resource ' fork of Microsoft QuickBASIC (b) and (d), and also in the Demo ' Resources file in the QB Demos folder on the QuickBASIC Examples disk

item% = 0          'Initialize this return argument for alert, 'otherwise you'll get a &quot;TYPE MISMATCH&quot; error. a1$ = &quot;Example using Alert&quot; a2$ = &quot;This is string 2&quot; a3$ = &quot;This is string 3&quot; alert ref%,2,305,item%,a1$,a2$,a3$ 'ref% = reference # of resource file '2   = type of icon displayed. '      Icon 2 is a caution sign. '305 = ID number of alert resource '      in Macintosh QuickBASIC (b) 'item% = returns the number of which '       button was pressed, if any 'a1$, a2$, a3$ = Strings you wish to                                '              put into the alert box IF item% <> -1 THEN PRINT &quot;You have clicked button number =&quot;,item% ELSE PRINT &quot;No button was selected.&quot; END IF WHILE MOUSE(0)<>1 : WEND  ' END

Additional query words: MQuickB

Keywords: KB59287

-

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

© Microsoft Corporation. All rights reserved.