Megosztás a következőn keresztül:


SYS(2335) – Unattended Server Mode

Enables or disables modal states for distributable Visual FoxPro .exe automation servers.

SYS(2335 [, 0 | 1])

Return Values

Character

Parameters

  • 0
    Enables unattended mode. When unattended mode is enabled, a Visual FoxPro error is generated whenever a modal state occurs. Your .exe automation server can trap for these errors with an ON ERROR routine.
  • 1
    (Default) Disables unattended mode. Modal states, which require user intervention, can occur. Unattended mode is disabled at startup.

Remarks

Use SYS(2335) to enable or disable modal states in Visual FoxPro .exe automation servers. Automation servers are created with the Project Manager. For additional information about using Visual FoxPro to create .exe automation servers, see Adding OLE.

Modal states occur when dialogs or errors messages are displayed, requiring input from a user to exit the dialog or error message and continue program execution. Modal states can be undesirable in .exe servers that are deployed remotely, possibly without intervention from a user. Program execution is halted, and requires intervention for program execution to continue.

The following table lists some typical examples of modal states that can occur in an .exe server.

Modal State Examples
WAIT command or MESSAGEBOX( ) function Can occur in program code.
Visual FoxPro errors such as "File access is denied" or "Allowed DO nesting level exceeded" Can occur in program code.
Open dialog boxes Can occur when files included in a SQL statement cannot be located.
SQL Connection Login dialog box Can occur after a connection cannot be established.

SYS(2335 ,0) should be executed as soon as possible in unattended .exe automation server program code because a modal state can occur anytime after program execution begins.

Note that SYS(2335) applies only to .exe automation servers for which the StartMode property equals two. Unattended mode is always enabled for in-process .dll automation servers (for which the StartMode property equals three).

Issuing SYS(2335) without an argument in a runtime application returns its current setting.

See Also

ON ERROR | StartMode Property | SYS( ) Functions Overview | Adding OLE