FutureBasic Logo

<<    Index    >> FutureBasic 5

system   function



Syntax:
systemInformation = system(whichInfo)

Description:
This function returns various kinds of information about the system and about the current application. Set whichInfo to one of the values shown here:

whichInfoValueSystem(whichInfo) returns:
_lastCurs0"CURS" resource ID number of the current cursor (if it is a resource).
_aplVol1A working directory reference number for the folder that contains the application file. This is useful in case you want to read or write files in the same folder as the application.
_sysVol2A working directory reference number for the System folder. (Note: to access special folders within the System folder, the preferred method is to use the Toolbox function FindFolder.)
_macPlus3System(_macPlus) always returns 0. This is retained for compatibility with older versions of FutureBasic.
_aplRes4Reference number for the Application file's resource fork (which is always open while your application is running).
_memAvail5Number of free bytes currently available in the application's heap. Returns the same value as Mem(_freeBytes).
_scrnWidth6The width of the main monitor, in pixels.
_scrnHeight7The height of the main monitor, in pixels.
_sysVers8An integer representing the current System version number. For example, 761 represents version 7.6.1.
_aplActive9Returns a positive value if the application is the currently active (foreground) process. Returns a negative value if the application is currently in the background. Note that FutureBasic3 also generates a dialog event every time your application is moved to the foreground or to the background (see the Dialog function).
_maxColors10Maximum color bit-depth available on the main monitor. Use the expression (2 ^ System(_maxColors)) to get the actual number of available colors.
_crntDepth11Current color bit depth on the main monitor. Use the expression (2 ^ System(_crntDepth)) to get the actual number of available colors.
_cpuType12A code indicating the machine's CPU type, for 68k CPU's. Return values: _env68000 (1); _env68010 (2); _env68020 (3); _env68030 (4); _env68040 (5). Note: this value is unreliable for PPC CPU's: to determine
_machType13A code indicating the machine type. Use machName$ = Str#(-16395, System(_machType)) to determine the machine's name.
_aplFlag14System(_aplFlag) returns _false if the project was run and _zTrue if the project was built.
_cpuSpeed (PPC only)15System(_cpuSpeed) returns the current clock speed (in megahertz) of the microprocessor.
_clockSpeed (PPC only)16System(_clockSpeed) returns the Gestalt clock speed (in megahertz) of the microprocessor.
_lastCursType (Appearance Manager)17This function may return 0 (plain), _themeCursorStatic or _themeCursorAnimate.
_aplvRefNum (Appearance Manager)18This is the volume reference number of the running application.
_aplparID (Appearance Manager)19This is the volume parent ID number of the running application.

Note:
The following argument constants are no longer supported:
_lastCurs [0]
_aplVol [1]
_sysVol [2]
_cpuType [12]
_machType [13]
_aplFlag [14]
_lastCursType [17]

Many other kinds of system-wide information can be obtained using the Toolbox function fn GESTALT.