Sys() Functions
What would a new version of VFP be without a half-dozen or more new SYS() functions? There are now 131 known SYS() functions in VFP 7. Yikes! That's as many relatively obscure numbers as some entire languages have functions!Fortunately, IntelliSense really helps out here: When you type "SYS(", VFP displays a list of all the functions (well, not all of them; in fact, only 86 of them appear in the list), showing not only the number but also a short description for each and a longer tool tip for the selected one.SYS() functions are an odd lot. They really have very little in common, other than they almost always return a character value (even when you'd expect a numeric one). We think they creep into the language when the VFP team can't think of a reasonable name to assign to a "real" function.Some of these functions really should be avoided because they've been superseded with "real" functions that do the same or almost the same thing but are much more readable. For example, which would you rather see in code: SYS(2003) or CURDIR()? SYS(2001) or SET()? SYS(22) or ORDER()? In addition, some of these are just plain obsolete: They do nothing at all in VFP. There's also a whole bunch of these that return a value (or at least don't cause an error) but are completely undocumented. We suspect these are used for internal purposes or VFP system testing and aren't really intended for us to use.The following table lists every SYS() function grouped by category.
Category |
Function |
Description |
Get System or VFP Information |
Network machine information |
|
Julian system date |
||
Seconds since midnight |
||
Default drive or volume |
||
VFP serial number |
||
String from Julian day number |
||
Julian day number |
||
Executing program filename |
||
Processor in use |
||
Current control |
||
Bitmap configuration |
||
VFP memory |
||
Number of memory handles |
||
User object memory in use |
||
Current lock status |
||
Memo field block size |
||
System menu name string |
||
Error message parameter |
||
Configuration file name and location |
||
Default disk size |
||
Disk cluster size |
||
Temporary path |
||
Table type |
||
ODBC environment handle |
||
OOP-Related |
Object location |
|
Object's SCX file |
||
Object hierarchy |
||
COM-Related |
ActiveX dual interface support |
|
Automation server invocation mode |
||
Unattended server mode |
||
Critical section support |
||
Call CoFreeUnusedLibraries when COM object is released |
||
NT service support |
||
IDispatch pointer |
||
IDispatch object reference |
||
Add reference to object |
||
Release object reference |
||
International Support |
Character translation |
|
Transform German text |
||
Add or remove codepage |
||
Return locale ID |
||
Set locale ID |
||
Set language and locale IDs |
||
Perform an Action or Update a Setting |
Enable help diagnostic mode |
|
Disable help diagnostic mode |
||
Display Page Setup dialog |
||
Purge cached memory |
||
Activate a menu item |
||
Enable/disable system component debugging |
||
Memory "peek" or "poke" |
||
Enable/disable Accessibility support |
||
Extend event tracking support |
||
Set buffer memory size |
||
Set lock retry interval |
||
Override SET REPROCESS locking |
||
Rushmore optimization level |
||
Specify FOR and WHERE clause complexity |
||
Reread Registry settings |
||
Enable/disable Active Document debugging support |
||
Miscellaneous |
"Unique" file name |
|
Checksum value |
||
Minimum path |
||
Unique procedure name |
||
Obsolete |
Available memory |
|
Printer status |
||
FoxPro EMS memory usage |
||
EMS memory limit |
||
Current graphics card |
||
Cursor shape |
||
Swap cursor shape |
||
CONFIG.SYS file settings |
||
SHOW GETS WINDOW name |
||
Display sign-on screen |
||
Convert DOS paths to Mac notation |
||
Superseded With "Real" Function |
Current printer device; use SET('PRINTER', 1) |
|
Index expression; use KEY() |
||
Controlling index number; use TAGNO() |
||
Controlling tag or index name; use ORDER() |
||
Console setting; use SET('CONSOLE') |
||
Device setting; use SET('DEVICE') |
||
Printer setting; use SET('PRINTER') |
||
Talk setting; use SET('TALK') |
||
Property information; use PEMSTATUS() |
||
Filename wildcard match; use ADIR() |
||
SET command status; use SET() |
||
Turn insertion point on or off; use SET CURSOR |
||
Current directory; use CURDIR() |
||
VFP start directory; use HOME() |
||
Current resource file; use SET('RESOURCE', 1) |
||
Filtered index expression; use FOR() |
||
Unknown Purpose |
SYS(1002) |
|
SYS(1003) |
||
SYS(1004) |
||
SYS(1005) |
||
SYS(1006) |
||
SYS(1007) |
||
SYS(1008) |
||
SYS(1009) |
||
SYS(1010) |
||
SYS(1012) |
||
SYS(1013) |
||
SYS(1014) |
||
SYS(1015) |
||
SYS(1017) |
||
SYS(1022) |
||
SYS(1039) |
||
SYS(1101) |
||
SYS(1102) |
||
SYS(1103) |
||
SYS(1105) |
||
SYS(2024) |
||
SYS(2025) |
||
SYS(2026) |
||
SYS(2050) |
|
|
SYS(2400) |
|
|
SYS(3090) |
|
|
SYS(4000) |
||
SYS(4001) |
||
SYS(4003) |
||
SYS(4004) |
||
SYS(4010) |
||
SYS(4015) |
||
SYS(4201) |
||
Meant for Microsoft Fox Team Use |
Cycles through all the built-in dialogs so spelling or translation can be checked. |
|
SYS(1018) |
Returns "Hold Index Lock during TableUpdate: " followed by "On" or "Off"; pass 0 to get "Off" or 1 for "On" (the default is "On"). |
|
SYS(1020) |
Turns off the diagnostic mode turned on by SYS(1021). |
|
SYS(1021) |
Starts some kind of diagnostic mode, which is turned off by SYS(1020). |
|
SYS(1029) |
Pass 0 to move the Format menu to the end, and add the Database and Record pads. Pass 1 to restore the menu. Doesn't work under all conditions. |
|
SYS(2901) |
Causes exception code C0000005 (formerly known as a General Protection Fault or GPF) if you pass 3045. This is on purpose; it allows the Fox team to test exception code handling. You may want to consider avoiding this one in your finished applications! |
|
SYS(3070) |
"Icecap profiling turned on" displays in the status bar. We're not sure what that means, but we don't want to mess with it. Doesn't work under all conditions. |
|
SYS(3071) |
"Icecap profiling turned off" displays in the status bar. See SYS(3070), directly above. Doesn't work under all conditions. |