_debug Function


N _debug(N switch)



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


Toggle Debugger


Ask if Debugger is on


Turn off Debugger


Turn on Debugger


Forces an application thread to break in the Xbasic debugger.


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:


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.


Developer Environment Only

See Also