Microsoft KB Archive/44796

= SYSTEM Function Returns Macintosh Information =

Article ID: 44796

Article Last Modified on 1/8/2003

-

APPLIES TO


 * Microsoft QuickBasic Compiler for Macintosh 1.0

-



This article was previously published under Q44796



SUMMARY
The SYSTEM function in Microsoft QuickBASIC version 1.00 for the Macintosh can be used to determine information about the system on which the program is running.



MORE INFORMATION
The SYSTEM(n) function returns a single-precision value representing different information, depending on the value of its numeric argument. The SYSTEM(n) function (where n = 0 to 7) returns the following values:   Argument (n)    Information Returned

0              The Macintosh System version number returned as a                   real number

1              The Macintosh computer type returned as an integer code:

Returned Value    System Type

0                 Unknown 1                 Macintosh 512K 2                 Macintosh Plus 3                 Macintosh SE                   4                  Macintosh II                   5                  Macintosh IIx 6                 Macintosh IIcx 7                 Macintosh SE/30 15                 Macintosh Classic    2               QuickBASIC's version number. Note: The call to SYSTEM(2) returns the correct value (1) when compiled, but returns a value of 4 when run within the QuickBASIC version 1.00 interpreter. Microsoft is researching this problem and will post new information here as it becomes available.

3              The math-pack type. A value of 0 indicates binary math; a value of 1 indicates decimal math.

4              The environment flag. A value of 0 means the program is being run from the QuickBASIC environment. A value of 1 indicates the program has been compiled.

5              The width of the screen on this Macintosh.

6              The height of the screen on this Macintosh.

7              The resource file reference number of the currently running compiled application or the currently running interpreted source file. This number can be                  used by MBLC routines to access resources stored in                   the resource fork of the current program file.

Code Example
The following is a code example with the results of a compiled application running on a Macintosh Plus with the Apple System version 6.00: FOR i = 0 TO 6 PRINT i, SYSTEM(i) NEXT i OUTPUT:

0             6  1              2  2              1  3              0  4              1  5              512  6              342

Additional query words: MQuickB

Keywords: KB44796

-

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

© Microsoft Corporation. All rights reserved.