Sys(2335)
This function gives us the ability to turn off the dialog boxes that hang our EXE servers, so that we can trap problems with the error handler instead.
Usage |
nSetting = SYS(2335 [, nNewSetting ] ) |
Parameter |
Value |
Meaning |
nNewSetting |
Omitted |
Returns the current setting of SYS(2335), in VFP runtime only. In the development environment, returns the empty string. |
0 |
Unattended mode. If a dialog attempts to force your EXE into a modal condition, an error (number 2031, "User Interface operation not allowed at this time") is generated instead. |
|
1 |
Normal mode. This is the default, where dialogs can interrupt the operation of your application. |
|
nSetting |
Empty String |
Returned in development mode. |
"0" or "1" |
Returns the current mode of the EXE—not the previous mode, but the mode after the SYS() function has been executed. |
SYS(2335) reports that a DLL starts out in mode 1, but that is incorrect. An attempt to start a dialog within an in-process DLL always fires an error 2031. We think SYS(2335) should report that you are in unattended mode. Instead, you need to check both this function and the StartMode property to determine if your application has started as an EXE or DLL. |
Example |
lnOldMode = SYS(2335) && preserve the old mode lnNewMode = SYS(2335,0) && and set it as desired. |
See Also |