13. Run Applications (Debug and Non-Debug Mode)
13A. Non-Debug Mode
- From LVSCE:
- Right-click program → Run as Web Application (opens in browser).
- Right-click program → Run as Desktop Application (opens LyciaDesktop, requires LyciaDesktop component installed).
- Via LyciaWeb (Browser):
- Open your browser and navigate to http://localhost:9090/LyciaWeb/.
- Enter AppServer instance (default is default) and application name.
- Alternatively, use the direct application URL.
- Example: http://localhost:9090/LyciaWeb/run/default/my_app.exe?params=-d%20informix.
- Pass command-line parameters in the URL using ?params= (spaces are replaced by %20).
- Via LyciaDesktop (Command Line):
- Navigate to the LyciaDesktop installation directory (e.g., /opt/Querix/Lycia/client/).
- Command Example: LyciaDesktop.exe --server=http://localhost:9090 --instance=default --command="your_application.exe" -d informix.
- Runtime Environment Variables (in inet.env): inet.env contains environment variables used at runtime for LyciaDesktop and LyciaWeb.
- DBDATE, DBFORMAT, DBMONEY: For date, numeric, and money formats.
- LINES, COLUMNS: Specify default screen size.
- QXBREAKCH_START, QXBREAKCH_END, QXREP_SPACES: For Informix compatibility string splitting.
- Example: export QX_COMPAT=Informix4GL; export QXBREAKCH_START="-=".
- QX_MDI=1: To enable MDI (Multiple Document Interface) mode.
- QX_MENU_WINDOW=1: To add a "Window" menu item showing running MDI applications.
- QX_MENU_WINDOW_NEW_CHILD=1: To add a "New application" item to the Window menu for launching child applications in MDI mode.
- DBPATH: Paths to search for forms, action defaults, etc.
- Example: export DBPATH=/path/to/forms.
- QX_INITVAR=1: To initialize all variables to non-NULL.
Reference: For more on inet.env and runtime variables see the following pages: inet.env, runtime variables.
13B. Debug Mode
- In LVSCE:
- Set Breakpoints: Click in the editor's margin next to a line of code (red circle).
- Rebuild/Deploy: Right-click your program and select Rebuild/Deploy.
- Debug: Right-click program → Debug as Web Application.
- Debug Toolbar: Use Continue/Pause, Step Into, Step Over, Step Out, Restart, Stop, Disconnect buttons to control debugging.
- Debug Console: Use to inspect variables (e.g., type i and press Enter) or call functions.
- Logpoints: Add logpoints to display messages in Debug Console (e.g., Message: {variable_name}).
- To redirect logpoint messages to a log file instead of a console, set export QX_DA_OUTPUT=logfile in inet.env.
- Function Breakpoints: Add a breakpoint that stops at a function entry point.
- Breakpoint on Change: Set a breakpoint to stop when a variable's value changes.
- Remote Debugging (with SSH in VS Code):
- Install the Remote - SSH extension.
- Configure your SSH host in VS Code's settings.json.
- Set Lycia: Debug: Default Webserver to the remote host's IP/DNS in settings.json.
- Example: "lycia.debug: DefaultWebserver": "198.168.0.25:9090".
- Connect to the remote host via SSH.
- Build/Deploy, set breakpoints, then Debug as Web Application from the remote LVSCE instance.
- Debug Environment Variables (in inet.env or environ):
- QX_UNL=1: Enable building debug cache.
- QXDEBUG: (as above).
- LYCIA_SEVERITY: (as above).
- LYCIA_POST_MORTEM_LENGTH: (as above).
- QX_DEBUGGER_TIMEOUT: Controls debugger session length (in minutes). Set to 0 for unlimited sessions.
- QX_DEBUG_HOSTS: Allow remote debugging from specified client IP addresses.
- Example: export QX_DEBUG_HOSTS=192.168.0.240:104.197.81.121 (colon separator for Linux).
- QX_LOGNATIVESQLERRORS: Specifies which database errors are written to the application log file. Values from 1 to 7 provide different levels of detail.
- Example: export QX_LOGNATIVESQLERRORS=7 (full details).
- QX_QRUN_DUMP=1: Enable the qrun crash dumps.
- FGLSOURCEPATH: Used for debugging in LVSCE, specifies paths to source files (e.g., in remote debugging).
- Example: export FGLSOURCEPATH=/lycia/projects.
- QX_DA_LOG_DIR: Enables Debug Adapter logging and specifies the directory for log files.
- Example: export QX_DA_LOG_DIR=/usr/informix/log.
- Reference: For more on debugging in LVSCE, see the Debugging sub-chapter of LVSCE documentation.
See next: 14. Firewall Considerations (Advanced)