Xbasic

_debug Function

Syntax

N _debug(N switch)

Arguments

switchNumeric

Debugger action to take. Can be one of the following values:

Value
Description
-2

Toggle Debugger

-1

Ask if Debugger is on

0

Turn off Debugger

1

Turn on Debugger

Description

Forces an application thread to break in the Xbasic debugger.

Discussion

When a component is run in Live Preview, you can launch the Xbasic debugger from an Xbasic script using the debug() function. This is helpful for diagnosing scripts and exploring server-side events. However, some scripts and events cannot be run in Live or Working Preview -- such as Login events. To fully test an application, you need to Live Test the app on an Application Server, such as the local Development Server.

The _debug() function can be used to launch the Xbasic debugger when testing an application on the local Development Server. This enables you to test functionality that otherwise cannot be run in a preview environment -- including the security framework.

To open the Xbasic debugger while testing your app on the Development Server, either using a Live Test or publishing to Localhost, add the following statement to your Xbasic script:

_debug(1)

When the _debug(1) statement is encountered, the Xbasic debugger will open in the Alpha Anywhere IDE. The Alpha Anywhere IDE must be open and running in order to use this function.

The _debug() function is similar to the debug() function in that it launches the Xbasic debugger when encountered, however only the _debug() function will open the debugger when running on the Development Server.

Limitations

Developer Environment Only

See Also