DVX_GUI/docs/dvx_basic_reference.html

2846 lines
142 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DVX BASIC IDE Guide</title>
<style>
body { font-family: sans-serif; margin: 0; padding: 0; display: flex; }
nav { width: 250px; min-width: 250px; background: #f0f0f0; padding: 16px;
border-right: 1px solid #ccc; height: 100vh; overflow-y: auto;
position: sticky; top: 0; box-sizing: border-box; }
nav ul { list-style: none; padding-left: 16px; margin: 4px 0; }
nav > ul { padding-left: 0; }
nav a { text-decoration: none; color: #0066cc; }
nav a:hover { text-decoration: underline; }
main { flex: 1; padding: 24px 32px; max-width: 800px; }
h1 { border-bottom: 2px solid #333; padding-bottom: 4px; }
h2 { border-bottom: 1px solid #999; padding-bottom: 2px; margin-top: 32px; }
h3 { margin-top: 24px; }
pre { background: #f8f8f8; border: 1px solid #ddd; padding: 8px;
overflow-x: auto; font-size: 14px; }
blockquote { background: #fffde7; border-left: 4px solid #ffc107;
padding: 8px 12px; margin: 12px 0; }
hr { border: none; border-top: 1px solid #ccc; margin: 24px 0; }
img { max-width: 100%; }
.topic { margin-bottom: 48px; }
</style>
</head>
<body>
<nav>
<h3>Contents</h3>
<ul>
<li><a href="#ide.overview">Overview</a>
<ul>
<li><a href="#ide.menu.file">Menu Reference</a>
<ul>
<li><a href="#ide.menu.file">File Menu</a></li>
<li><a href="#ide.menu.edit">Edit Menu</a></li>
<li><a href="#ide.menu.run">Run Menu</a></li>
<li><a href="#ide.menu.view">View Menu</a></li>
<li><a href="#ide.menu.window">Window Menu</a></li>
<li><a href="#ide.menu.tools">Tools Menu</a></li>
<li><a href="#ide.menu.help">Help Menu</a></li>
</ul>
</li>
<li><a href="#ide.toolbar">Toolbar</a></li>
<li><a href="#ide.editor">Code Editor</a></li>
<li><a href="#ide.designer">Form Designer</a></li>
<li><a href="#ide.project">Project System</a></li>
<li><a href="#ide.properties">Properties Panel</a></li>
<li><a href="#ide.toolbox">Toolbox</a></li>
<li><a href="#ide.debugger">Debugger</a></li>
<li><a href="#ide.debug.locals">Debug Windows</a>
<ul>
<li><a href="#ide.debug.locals">Locals Window</a></li>
<li><a href="#ide.debug.callstack">Call Stack Window</a></li>
<li><a href="#ide.debug.watch">Watch Window</a></li>
<li><a href="#ide.debug.breakpoints">Breakpoints Window</a></li>
</ul>
</li>
<li><a href="#ide.immediate">Immediate Window</a></li>
<li><a href="#ide.output">Output Window</a></li>
<li><a href="#ide.findreplace">Find / Replace</a></li>
<li><a href="#ide.preferences">Preferences</a></li>
<li><a href="#ide.shortcuts">Keyboard Shortcuts</a></li>
</ul>
</li>
<li><a href="#lang.datatypes">Data Types</a>
<ul>
<li><a href="#lang.operators">Operators</a></li>
<li><a href="#lang.statements">Statements</a>
<ul>
<li><a href="#lang.declarations">Declarations</a></li>
<li><a href="#lang.conditionals">Conditionals</a></li>
<li><a href="#lang.loops">Loops</a></li>
<li><a href="#lang.procedures">Procedures</a></li>
<li><a href="#lang.flow">Flow Control</a></li>
<li><a href="#lang.io">Input/Output</a></li>
<li><a href="#lang.misc">Miscellaneous Statements</a></li>
</ul>
</li>
<li><a href="#lang.fileio">File I/O</a></li>
<li><a href="#lang.func.string">Built-in Functions</a>
<ul>
<li><a href="#lang.func.string">String Functions</a></li>
<li><a href="#lang.func.math">Math Functions</a></li>
<li><a href="#lang.func.conversion">Conversion Functions</a></li>
<li><a href="#lang.func.fileio">File I/O Functions</a></li>
<li><a href="#lang.func.misc">Miscellaneous Functions</a></li>
</ul>
</li>
<li><a href="#lang.forms">Form and Control Statements</a></li>
<li><a href="#lang.sql">SQL Functions</a></li>
<li><a href="#lang.app">App Object</a></li>
<li><a href="#lang.ini">INI Functions</a></li>
<li><a href="#lang.constants">Predefined Constants</a></li>
</ul>
</li>
<li><a href="#ctrl.common.props">Common Properties, Events, and Methods</a>
<ul>
<li><a href="#ctrl.databinding">Data Binding</a></li>
<li><a href="#ctrl.menus">Menu System</a></li>
<li><a href="#ctrl.arrays">Control Arrays</a></li>
<li><a href="#ctrl.frm">FRM File Format</a></li>
<li><a href="#ctrl.form">Form</a></li>
<li><a href="#ctrl.terminal">Special Controls</a></li>
<li><a href="#ctrl.terminal">Terminal</a></li>
<li><a href="#ctrl.frame">Frame</a></li>
<li><a href="#ctrl.hbox">HBox</a></li>
<li><a href="#ctrl.vbox">VBox</a></li>
<li><a href="#ctrl.button">CommandButton</a></li>
<li><a href="#ctrl.picturebox">PictureBox</a></li>
<li><a href="#ctrl.checkbox">CheckBox</a></li>
<li><a href="#ctrl.combobox">ComboBox</a></li>
<li><a href="#ctrl.data">Data Controls</a></li>
<li><a href="#ctrl.data">Data</a></li>
<li><a href="#ctrl.dbgrid">DBGrid</a></li>
<li><a href="#ctrl.dropdown">DropDown</a></li>
<li><a href="#ctrl.imagebutton">ImageButton</a></li>
<li><a href="#ctrl.image">Image</a></li>
<li><a href="#ctrl.label">Label</a></li>
<li><a href="#ctrl.listbox">ListBox</a></li>
<li><a href="#ctrl.listview">Data Display Controls</a></li>
<li><a href="#ctrl.listview">ListView</a></li>
<li><a href="#ctrl.progressbar">ProgressBar</a></li>
<li><a href="#ctrl.optionbutton">OptionButton</a></li>
<li><a href="#ctrl.scrollpane">ScrollPane</a></li>
<li><a href="#ctrl.line">Decorative Controls</a></li>
<li><a href="#ctrl.line">Line</a></li>
<li><a href="#ctrl.hscrollbar">HScrollBar</a></li>
<li><a href="#ctrl.spacer">Spacer</a></li>
<li><a href="#ctrl.spinbutton">SpinButton</a></li>
<li><a href="#ctrl.splitter">Splitter</a></li>
<li><a href="#ctrl.statusbar">StatusBar</a></li>
<li><a href="#ctrl.tabstrip">Tabbed and Split Controls</a></li>
<li><a href="#ctrl.tabstrip">TabStrip</a></li>
<li><a href="#ctrl.textbox">TextBox</a></li>
<li><a href="#ctrl.textarea">TextArea</a></li>
<li><a href="#ctrl.timer">Timer</a></li>
<li><a href="#ctrl.toolbar">Bar Controls</a></li>
<li><a href="#ctrl.toolbar">Toolbar</a></li>
<li><a href="#ctrl.treeview">TreeView</a></li>
<li><a href="#ctrl.wrapbox">WrapBox</a></li>
</ul>
</li>
</ul>
<h3>Index</h3>
<ul>
<li><a href="#ide.overview">DVX BASIC</a></li>
<li><a href="#ide.overview">IDE</a></li>
<li><a href="#ide.overview">Visual Basic</a></li>
<li><a href="#ide.overview">Development Environment</a></li>
<li><a href="#ide.menu.file">File Menu</a></li>
<li><a href="#ide.menu.file">New Project</a></li>
<li><a href="#ide.menu.file">Open Project</a></li>
<li><a href="#ide.menu.file">Save Project</a></li>
<li><a href="#ide.menu.file">Close Project</a></li>
<li><a href="#ide.menu.file">Project Properties</a></li>
<li><a href="#ide.menu.file">Add File</a></li>
<li><a href="#ide.menu.file">Save File</a></li>
<li><a href="#ide.menu.file">Save All</a></li>
<li><a href="#ide.menu.file">Remove File</a></li>
<li><a href="#ide.menu.file">Exit</a></li>
<li><a href="#ide.menu.edit">Edit Menu</a></li>
<li><a href="#ide.menu.edit">Cut</a></li>
<li><a href="#ide.menu.edit">Copy</a></li>
<li><a href="#ide.menu.edit">Paste</a></li>
<li><a href="#ide.menu.edit">Select All</a></li>
<li><a href="#ide.menu.edit">Delete</a></li>
<li><a href="#ide.menu.edit">Find</a></li>
<li><a href="#ide.menu.edit">Find Next</a></li>
<li><a href="#ide.menu.edit">Replace</a></li>
<li><a href="#ide.menu.run">Run Menu</a></li>
<li><a href="#ide.menu.run">Run</a></li>
<li><a href="#ide.menu.run">Debug</a></li>
<li><a href="#ide.menu.run">Run Without Recompile</a></li>
<li><a href="#ide.menu.run">Stop</a></li>
<li><a href="#ide.menu.run">Step Into</a></li>
<li><a href="#ide.menu.run">Step Over</a></li>
<li><a href="#ide.menu.run">Step Out</a></li>
<li><a href="#ide.menu.run">Run to Cursor</a></li>
<li><a href="#ide.menu.run">Toggle Breakpoint</a></li>
<li><a href="#ide.menu.run">Clear Output</a></li>
<li><a href="#ide.menu.run">Save on Run</a></li>
<li><a href="#ide.menu.view">View Menu</a></li>
<li><a href="#ide.menu.view">Code View</a></li>
<li><a href="#ide.menu.view">Design View</a></li>
<li><a href="#ide.menu.view">Toolbar Toggle</a></li>
<li><a href="#ide.menu.view">Status Bar Toggle</a></li>
<li><a href="#ide.menu.view">Menu Editor</a></li>
<li><a href="#ide.menu.window">Window Menu</a></li>
<li><a href="#ide.menu.tools">Tools Menu</a></li>
<li><a href="#ide.menu.tools">Preferences</a></li>
<li><a href="#ide.menu.tools">Debug Layout</a></li>
<li><a href="#ide.menu.help">Help Menu</a></li>
<li><a href="#ide.menu.help">About</a></li>
<li><a href="#ide.toolbar">Toolbar</a></li>
<li><a href="#ide.editor">Code Editor</a></li>
<li><a href="#ide.editor">Syntax Highlighting</a></li>
<li><a href="#ide.editor">Object Dropdown</a></li>
<li><a href="#ide.editor">Function Dropdown</a></li>
<li><a href="#ide.editor">Line Numbers</a></li>
<li><a href="#ide.editor">Auto-indent</a></li>
<li><a href="#ide.designer">Form Designer</a></li>
<li><a href="#ide.designer">Design Surface</a></li>
<li><a href="#ide.designer">Grid Snapping</a></li>
<li><a href="#ide.designer">Grab Handles</a></li>
<li><a href="#ide.designer">Control Placement</a></li>
<li><a href="#ide.designer">WYSIWYG</a></li>
<li><a href="#ide.project">Project System</a></li>
<li><a href="#ide.project">Project Files</a></li>
<li><a href="#ide.project">.dbp Files</a></li>
<li><a href="#ide.project">Project Explorer</a></li>
<li><a href="#ide.project">Source Map</a></li>
<li><a href="#ide.properties">Properties Panel</a></li>
<li><a href="#ide.properties">Control Properties</a></li>
<li><a href="#ide.properties">Property List</a></li>
<li><a href="#ide.properties">Control Tree</a></li>
<li><a href="#ide.toolbox">Toolbox</a></li>
<li><a href="#ide.toolbox">Controls</a></li>
<li><a href="#ide.toolbox">Widget Palette</a></li>
<li><a href="#ide.debugger">Debugger</a></li>
<li><a href="#ide.debugger">Breakpoints</a></li>
<li><a href="#ide.debugger">Stepping</a></li>
<li><a href="#ide.debugger">Debug Mode</a></li>
<li><a href="#ide.debugger">DBG_IDLE</a></li>
<li><a href="#ide.debugger">DBG_RUNNING</a></li>
<li><a href="#ide.debugger">DBG_PAUSED</a></li>
<li><a href="#ide.debug.locals">Locals Window</a></li>
<li><a href="#ide.debug.locals">Variable Inspection</a></li>
<li><a href="#ide.debug.callstack">Call Stack</a></li>
<li><a href="#ide.debug.callstack">Stack Trace</a></li>
<li><a href="#ide.debug.watch">Watch Window</a></li>
<li><a href="#ide.debug.watch">Watch Expressions</a></li>
<li><a href="#ide.debug.breakpoints">Breakpoints Window</a></li>
<li><a href="#ide.immediate">Immediate Window</a></li>
<li><a href="#ide.immediate">REPL</a></li>
<li><a href="#ide.immediate">Expression Evaluation</a></li>
<li><a href="#ide.immediate">Variable Assignment</a></li>
<li><a href="#ide.output">Output Window</a></li>
<li><a href="#ide.output">PRINT Output</a></li>
<li><a href="#ide.output">Runtime Errors</a></li>
<li><a href="#ide.output">Compile Errors</a></li>
<li><a href="#ide.findreplace">Find</a></li>
<li><a href="#ide.findreplace">Replace</a></li>
<li><a href="#ide.findreplace">Find Next</a></li>
<li><a href="#ide.findreplace">Search</a></li>
<li><a href="#ide.preferences">Preferences</a></li>
<li><a href="#ide.preferences">Settings</a></li>
<li><a href="#ide.preferences">Tab Width</a></li>
<li><a href="#ide.preferences">Option Explicit</a></li>
<li><a href="#ide.shortcuts">Keyboard Shortcuts</a></li>
<li><a href="#ide.shortcuts">Hotkeys</a></li>
<li><a href="#ide.shortcuts">Accelerators</a></li>
<li><a href="#lang.datatypes">Data Types</a></li>
<li><a href="#lang.datatypes">Integer</a></li>
<li><a href="#lang.datatypes">Long</a></li>
<li><a href="#lang.datatypes">Single</a></li>
<li><a href="#lang.datatypes">Double</a></li>
<li><a href="#lang.datatypes">String</a></li>
<li><a href="#lang.datatypes">Boolean</a></li>
<li><a href="#lang.operators">Operators</a></li>
<li><a href="#lang.operators">Precedence</a></li>
<li><a href="#lang.operators">AND</a></li>
<li><a href="#lang.operators">OR</a></li>
<li><a href="#lang.operators">NOT</a></li>
<li><a href="#lang.operators">XOR</a></li>
<li><a href="#lang.operators">EQV</a></li>
<li><a href="#lang.operators">IMP</a></li>
<li><a href="#lang.operators">MOD</a></li>
<li><a href="#lang.statements">Statements</a></li>
<li><a href="#lang.statements">REM</a></li>
<li><a href="#lang.statements">Comments</a></li>
<li><a href="#lang.declarations">DIM</a></li>
<li><a href="#lang.declarations">REDIM</a></li>
<li><a href="#lang.declarations">CONST</a></li>
<li><a href="#lang.declarations">TYPE</a></li>
<li><a href="#lang.declarations">END TYPE</a></li>
<li><a href="#lang.declarations">DECLARE</a></li>
<li><a href="#lang.declarations">DECLARE LIBRARY</a></li>
<li><a href="#lang.declarations">SHARED</a></li>
<li><a href="#lang.declarations">STATIC</a></li>
<li><a href="#lang.declarations">OPTION</a></li>
<li><a href="#lang.declarations">OPTION BASE</a></li>
<li><a href="#lang.declarations">OPTION COMPARE</a></li>
<li><a href="#lang.declarations">OPTION EXPLICIT</a></li>
<li><a href="#lang.declarations">DEFINT</a></li>
<li><a href="#lang.declarations">DEFLNG</a></li>
<li><a href="#lang.declarations">DEFSNG</a></li>
<li><a href="#lang.declarations">DEFDBL</a></li>
<li><a href="#lang.declarations">DEFSTR</a></li>
<li><a href="#lang.declarations">LET</a></li>
<li><a href="#lang.declarations">SWAP</a></li>
<li><a href="#lang.declarations">ERASE</a></li>
<li><a href="#lang.conditionals">IF</a></li>
<li><a href="#lang.conditionals">THEN</a></li>
<li><a href="#lang.conditionals">ELSE</a></li>
<li><a href="#lang.conditionals">ELSEIF</a></li>
<li><a href="#lang.conditionals">END IF</a></li>
<li><a href="#lang.conditionals">SELECT CASE</a></li>
<li><a href="#lang.conditionals">CASE</a></li>
<li><a href="#lang.conditionals">CASE ELSE</a></li>
<li><a href="#lang.conditionals">END SELECT</a></li>
<li><a href="#lang.loops">FOR</a></li>
<li><a href="#lang.loops">NEXT</a></li>
<li><a href="#lang.loops">STEP</a></li>
<li><a href="#lang.loops">DO</a></li>
<li><a href="#lang.loops">LOOP</a></li>
<li><a href="#lang.loops">WHILE</a></li>
<li><a href="#lang.loops">WEND</a></li>
<li><a href="#lang.loops">UNTIL</a></li>
<li><a href="#lang.loops">EXIT FOR</a></li>
<li><a href="#lang.loops">EXIT DO</a></li>
<li><a href="#lang.procedures">SUB</a></li>
<li><a href="#lang.procedures">END SUB</a></li>
<li><a href="#lang.procedures">FUNCTION</a></li>
<li><a href="#lang.procedures">END FUNCTION</a></li>
<li><a href="#lang.procedures">DEF FN</a></li>
<li><a href="#lang.procedures">BYVAL</a></li>
<li><a href="#lang.procedures">BYREF</a></li>
<li><a href="#lang.procedures">EXIT SUB</a></li>
<li><a href="#lang.procedures">EXIT FUNCTION</a></li>
<li><a href="#lang.flow">EXIT</a></li>
<li><a href="#lang.flow">CALL</a></li>
<li><a href="#lang.flow">GOTO</a></li>
<li><a href="#lang.flow">GOSUB</a></li>
<li><a href="#lang.flow">RETURN</a></li>
<li><a href="#lang.flow">ON GOTO</a></li>
<li><a href="#lang.flow">ON GOSUB</a></li>
<li><a href="#lang.io">PRINT</a></li>
<li><a href="#lang.io">INPUT</a></li>
<li><a href="#lang.io">DATA</a></li>
<li><a href="#lang.io">READ</a></li>
<li><a href="#lang.io">RESTORE</a></li>
<li><a href="#lang.io">SPC</a></li>
<li><a href="#lang.io">TAB</a></li>
<li><a href="#lang.io">PRINT USING</a></li>
<li><a href="#lang.misc">ON ERROR</a></li>
<li><a href="#lang.misc">RESUME</a></li>
<li><a href="#lang.misc">RESUME NEXT</a></li>
<li><a href="#lang.misc">ERROR</a></li>
<li><a href="#lang.misc">ERR</a></li>
<li><a href="#lang.misc">SHELL</a></li>
<li><a href="#lang.misc">SLEEP</a></li>
<li><a href="#lang.misc">RANDOMIZE</a></li>
<li><a href="#lang.misc">END</a></li>
<li><a href="#lang.misc">RANDOMIZE TIMER</a></li>
<li><a href="#lang.fileio">OPEN</a></li>
<li><a href="#lang.fileio">CLOSE</a></li>
<li><a href="#lang.fileio">PRINT #</a></li>
<li><a href="#lang.fileio">INPUT #</a></li>
<li><a href="#lang.fileio">LINE INPUT</a></li>
<li><a href="#lang.fileio">WRITE #</a></li>
<li><a href="#lang.fileio">GET</a></li>
<li><a href="#lang.fileio">PUT</a></li>
<li><a href="#lang.fileio">SEEK</a></li>
<li><a href="#lang.fileio">FOR INPUT</a></li>
<li><a href="#lang.fileio">FOR OUTPUT</a></li>
<li><a href="#lang.fileio">FOR APPEND</a></li>
<li><a href="#lang.fileio">FOR RANDOM</a></li>
<li><a href="#lang.fileio">FOR BINARY</a></li>
<li><a href="#lang.func.string">ASC</a></li>
<li><a href="#lang.func.string">CHR$</a></li>
<li><a href="#lang.func.string">FORMAT$</a></li>
<li><a href="#lang.func.string">HEX$</a></li>
<li><a href="#lang.func.string">INSTR</a></li>
<li><a href="#lang.func.string">LCASE$</a></li>
<li><a href="#lang.func.string">LEFT$</a></li>
<li><a href="#lang.func.string">LEN</a></li>
<li><a href="#lang.func.string">LTRIM$</a></li>
<li><a href="#lang.func.string">MID$</a></li>
<li><a href="#lang.func.string">RIGHT$</a></li>
<li><a href="#lang.func.string">RTRIM$</a></li>
<li><a href="#lang.func.string">SPACE$</a></li>
<li><a href="#lang.func.string">STR$</a></li>
<li><a href="#lang.func.string">STRING$</a></li>
<li><a href="#lang.func.string">TRIM$</a></li>
<li><a href="#lang.func.string">UCASE$</a></li>
<li><a href="#lang.func.string">VAL</a></li>
<li><a href="#lang.func.math">ABS</a></li>
<li><a href="#lang.func.math">ATN</a></li>
<li><a href="#lang.func.math">COS</a></li>
<li><a href="#lang.func.math">EXP</a></li>
<li><a href="#lang.func.math">FIX</a></li>
<li><a href="#lang.func.math">INT</a></li>
<li><a href="#lang.func.math">LOG</a></li>
<li><a href="#lang.func.math">RND</a></li>
<li><a href="#lang.func.math">SGN</a></li>
<li><a href="#lang.func.math">SIN</a></li>
<li><a href="#lang.func.math">SQR</a></li>
<li><a href="#lang.func.math">TAN</a></li>
<li><a href="#lang.func.math">TIMER</a></li>
<li><a href="#lang.func.conversion">CDBL</a></li>
<li><a href="#lang.func.conversion">CINT</a></li>
<li><a href="#lang.func.conversion">CLNG</a></li>
<li><a href="#lang.func.conversion">CSNG</a></li>
<li><a href="#lang.func.conversion">CSTR</a></li>
<li><a href="#lang.func.fileio">EOF</a></li>
<li><a href="#lang.func.fileio">FREEFILE</a></li>
<li><a href="#lang.func.fileio">INPUT$</a></li>
<li><a href="#lang.func.fileio">LOC</a></li>
<li><a href="#lang.func.fileio">LOF</a></li>
<li><a href="#lang.func.fileio">LBOUND</a></li>
<li><a href="#lang.func.fileio">UBOUND</a></li>
<li><a href="#lang.func.misc">DATE$</a></li>
<li><a href="#lang.func.misc">TIME$</a></li>
<li><a href="#lang.func.misc">ENVIRON$</a></li>
<li><a href="#lang.forms">LOAD</a></li>
<li><a href="#lang.forms">UNLOAD</a></li>
<li><a href="#lang.forms">Show</a></li>
<li><a href="#lang.forms">Hide</a></li>
<li><a href="#lang.forms">Me</a></li>
<li><a href="#lang.forms">DoEvents</a></li>
<li><a href="#lang.forms">DOEVENTS</a></li>
<li><a href="#lang.forms">MsgBox</a></li>
<li><a href="#lang.forms">MSGBOX</a></li>
<li><a href="#lang.forms">InputBox$</a></li>
<li><a href="#lang.forms">INPUTBOX$</a></li>
<li><a href="#lang.forms">vbModal</a></li>
<li><a href="#lang.forms">Control Arrays</a></li>
<li><a href="#lang.forms">Event Handlers</a></li>
<li><a href="#lang.sql">SQLOpen</a></li>
<li><a href="#lang.sql">SQLClose</a></li>
<li><a href="#lang.sql">SQLExec</a></li>
<li><a href="#lang.sql">SQLAffected</a></li>
<li><a href="#lang.sql">SQLQuery</a></li>
<li><a href="#lang.sql">SQLNext</a></li>
<li><a href="#lang.sql">SQLEof</a></li>
<li><a href="#lang.sql">SQLField$</a></li>
<li><a href="#lang.sql">SQLFieldInt</a></li>
<li><a href="#lang.sql">SQLFieldDbl</a></li>
<li><a href="#lang.sql">SQLFieldCount</a></li>
<li><a href="#lang.sql">SQLFreeResult</a></li>
<li><a href="#lang.sql">SQLError$</a></li>
<li><a href="#lang.sql">SQLite</a></li>
<li><a href="#lang.app">App</a></li>
<li><a href="#lang.app">App.Path</a></li>
<li><a href="#lang.app">App.Config</a></li>
<li><a href="#lang.app">App.Data</a></li>
<li><a href="#lang.ini">IniRead</a></li>
<li><a href="#lang.ini">IniWrite</a></li>
<li><a href="#lang.ini">INI</a></li>
<li><a href="#lang.constants">vbOKOnly</a></li>
<li><a href="#lang.constants">vbOKCancel</a></li>
<li><a href="#lang.constants">vbYesNo</a></li>
<li><a href="#lang.constants">vbYesNoCancel</a></li>
<li><a href="#lang.constants">vbRetryCancel</a></li>
<li><a href="#lang.constants">vbInformation</a></li>
<li><a href="#lang.constants">vbExclamation</a></li>
<li><a href="#lang.constants">vbCritical</a></li>
<li><a href="#lang.constants">vbQuestion</a></li>
<li><a href="#lang.constants">vbOK</a></li>
<li><a href="#lang.constants">vbCancel</a></li>
<li><a href="#lang.constants">vbYes</a></li>
<li><a href="#lang.constants">vbNo</a></li>
<li><a href="#lang.constants">vbRetry</a></li>
<li><a href="#lang.constants">True</a></li>
<li><a href="#lang.constants">False</a></li>
<li><a href="#lang.constants">Predefined Constants</a></li>
<li><a href="#ctrl.common.props">Common Properties</a></li>
<li><a href="#ctrl.common.props">Common Events</a></li>
<li><a href="#ctrl.common.props">Common Methods</a></li>
<li><a href="#ctrl.common.props">Properties</a></li>
<li><a href="#ctrl.common.props">Events</a></li>
<li><a href="#ctrl.common.props">Methods</a></li>
<li><a href="#ctrl.databinding">Data Binding</a></li>
<li><a href="#ctrl.databinding">DataSource</a></li>
<li><a href="#ctrl.databinding">DataField</a></li>
<li><a href="#ctrl.databinding">Master-Detail</a></li>
<li><a href="#ctrl.menus">Menu</a></li>
<li><a href="#ctrl.menus">Menu Bar</a></li>
<li><a href="#ctrl.menus">Submenu</a></li>
<li><a href="#ctrl.menus">Separator</a></li>
<li><a href="#ctrl.arrays">Control Arrays</a></li>
<li><a href="#ctrl.arrays">Index Property</a></li>
<li><a href="#ctrl.frm">FRM</a></li>
<li><a href="#ctrl.frm">.frm</a></li>
<li><a href="#ctrl.frm">Form File</a></li>
<li><a href="#ctrl.form">Form</a></li>
<li><a href="#ctrl.form">Window</a></li>
<li><a href="#ctrl.form">Caption</a></li>
<li><a href="#ctrl.form">AutoSize</a></li>
<li><a href="#ctrl.form">Resizable</a></li>
<li><a href="#ctrl.form">Load</a></li>
<li><a href="#ctrl.form">Unload</a></li>
<li><a href="#ctrl.form">Show</a></li>
<li><a href="#ctrl.form">Hide</a></li>
<li><a href="#ctrl.terminal">Terminal</a></li>
<li><a href="#ctrl.terminal">ANSI Terminal</a></li>
<li><a href="#ctrl.terminal">VT100</a></li>
<li><a href="#ctrl.terminal">CommAttach</a></li>
<li><a href="#ctrl.terminal">CommOpen</a></li>
<li><a href="#ctrl.frame">Frame</a></li>
<li><a href="#ctrl.frame">Container</a></li>
<li><a href="#ctrl.hbox">HBox</a></li>
<li><a href="#ctrl.hbox">Horizontal Layout</a></li>
<li><a href="#ctrl.vbox">VBox</a></li>
<li><a href="#ctrl.vbox">Vertical Layout</a></li>
<li><a href="#ctrl.button">CommandButton</a></li>
<li><a href="#ctrl.button">Button</a></li>
<li><a href="#ctrl.button">Click</a></li>
<li><a href="#ctrl.picturebox">PictureBox</a></li>
<li><a href="#ctrl.picturebox">Canvas</a></li>
<li><a href="#ctrl.picturebox">Drawing</a></li>
<li><a href="#ctrl.picturebox">SetPenColor</a></li>
<li><a href="#ctrl.picturebox">SetPenSize</a></li>
<li><a href="#ctrl.checkbox">CheckBox</a></li>
<li><a href="#ctrl.checkbox">Value</a></li>
<li><a href="#ctrl.combobox">ComboBox</a></li>
<li><a href="#ctrl.data">Data</a></li>
<li><a href="#ctrl.data">Database</a></li>
<li><a href="#ctrl.data">SQLite</a></li>
<li><a href="#ctrl.data">DatabaseName</a></li>
<li><a href="#ctrl.data">RecordSource</a></li>
<li><a href="#ctrl.data">MoveFirst</a></li>
<li><a href="#ctrl.data">MoveNext</a></li>
<li><a href="#ctrl.data">AddNew</a></li>
<li><a href="#ctrl.data">Reposition</a></li>
<li><a href="#ctrl.data">Validate</a></li>
<li><a href="#ctrl.dbgrid">DBGrid</a></li>
<li><a href="#ctrl.dbgrid">Data-Bound Grid</a></li>
<li><a href="#ctrl.dropdown">DropDown</a></li>
<li><a href="#ctrl.imagebutton">ImageButton</a></li>
<li><a href="#ctrl.image">Image</a></li>
<li><a href="#ctrl.image">Picture</a></li>
<li><a href="#ctrl.image">BMP</a></li>
<li><a href="#ctrl.label">Label</a></li>
<li><a href="#ctrl.label">Caption</a></li>
<li><a href="#ctrl.label">Alignment</a></li>
<li><a href="#ctrl.listbox">ListBox</a></li>
<li><a href="#ctrl.listbox">ListIndex</a></li>
<li><a href="#ctrl.listbox">ListCount</a></li>
<li><a href="#ctrl.listbox">AddItem</a></li>
<li><a href="#ctrl.listbox">RemoveItem</a></li>
<li><a href="#ctrl.listview">ListView</a></li>
<li><a href="#ctrl.listview">Multi-Column List</a></li>
<li><a href="#ctrl.listview">SetColumns</a></li>
<li><a href="#ctrl.listview">SetSort</a></li>
<li><a href="#ctrl.progressbar">ProgressBar</a></li>
<li><a href="#ctrl.optionbutton">OptionButton</a></li>
<li><a href="#ctrl.optionbutton">Radio Button</a></li>
<li><a href="#ctrl.optionbutton">SetSelected</a></li>
<li><a href="#ctrl.scrollpane">ScrollPane</a></li>
<li><a href="#ctrl.scrollpane">Scrollable Container</a></li>
<li><a href="#ctrl.line">Line</a></li>
<li><a href="#ctrl.line">Separator</a></li>
<li><a href="#ctrl.hscrollbar">HScrollBar</a></li>
<li><a href="#ctrl.hscrollbar">Slider</a></li>
<li><a href="#ctrl.spacer">Spacer</a></li>
<li><a href="#ctrl.spinbutton">SpinButton</a></li>
<li><a href="#ctrl.spinbutton">Spinner</a></li>
<li><a href="#ctrl.spinbutton">SetRange</a></li>
<li><a href="#ctrl.spinbutton">SetStep</a></li>
<li><a href="#ctrl.spinbutton">RealMode</a></li>
<li><a href="#ctrl.spinbutton">Decimals</a></li>
<li><a href="#ctrl.splitter">Splitter</a></li>
<li><a href="#ctrl.splitter">Split Pane</a></li>
<li><a href="#ctrl.statusbar">StatusBar</a></li>
<li><a href="#ctrl.tabstrip">TabStrip</a></li>
<li><a href="#ctrl.tabstrip">TabControl</a></li>
<li><a href="#ctrl.tabstrip">SetActive</a></li>
<li><a href="#ctrl.textbox">TextBox</a></li>
<li><a href="#ctrl.textbox">Text</a></li>
<li><a href="#ctrl.textbox">DataSource</a></li>
<li><a href="#ctrl.textbox">DataField</a></li>
<li><a href="#ctrl.textarea">TextArea</a></li>
<li><a href="#ctrl.textarea">FindNext</a></li>
<li><a href="#ctrl.textarea">ReplaceAll</a></li>
<li><a href="#ctrl.textarea">GoToLine</a></li>
<li><a href="#ctrl.textarea">CursorLine</a></li>
<li><a href="#ctrl.textarea">LineNumbers</a></li>
<li><a href="#ctrl.textarea">AutoIndent</a></li>
<li><a href="#ctrl.timer">Timer</a></li>
<li><a href="#ctrl.timer">Interval</a></li>
<li><a href="#ctrl.timer">Start</a></li>
<li><a href="#ctrl.timer">Stop</a></li>
<li><a href="#ctrl.toolbar">Toolbar</a></li>
<li><a href="#ctrl.treeview">TreeView</a></li>
<li><a href="#ctrl.treeview">AddItem</a></li>
<li><a href="#ctrl.treeview">AddChildItem</a></li>
<li><a href="#ctrl.wrapbox">WrapBox</a></li>
<li><a href="#ctrl.wrapbox">Flow Layout</a></li>
</ul>
</nav>
<main>
<div class="topic" id="ide.overview">
<h1>DVX BASIC IDE Guide</h1>
<p>DVX BASIC is a Visual BASIC development environment for the DVX GUI System. It provides a VB3-style integrated development environment with a code editor, form designer, project system, and a full interactive debugger -- all running natively on DOS under the DVX windowing system.</p>
<p>This guide covers every feature of the IDE: menus, toolbar, editor, form designer, project management, debugger, and auxiliary windows.</p>
<h2>IDE Windows</h2>
<p>The DVX BASIC IDE is modeled after Visual Basic 3.0. It consists of several floating windows arranged on the DVX desktop:</p>
<ul>
<li>Main Toolbar Window -- anchored at the top of the screen. Contains the menu bar, toolbar buttons, and status bar.</li>
<li>Code Editor -- the primary editing surface for BASIC source code, with Object/Event dropdowns, syntax highlighting, and line numbers.</li>
<li>Form Designer -- a visual design surface for .frm files, showing a WYSIWYG preview of the form with grab handles for resizing controls.</li>
<li>Project Explorer -- a tree view listing all files in the project.</li>
<li>Toolbox -- a palette of available controls for placing on forms.</li>
<li>Properties Panel -- a tree of controls and a list of editable properties for the selected control.</li>
<li>Output Window -- displays PRINT output and runtime errors.</li>
<li>Immediate Window -- an interactive REPL for evaluating expressions and modifying variables at runtime.</li>
</ul>
<p>Debug Windows -- Locals, Call Stack, Watch, and Breakpoints windows that appear automatically when debugging.</p>
<p>The IDE compiles BASIC source into bytecode and runs it in an integrated virtual machine (VM). Programs execute in cooperative slices (10,000 VM steps per slice), yielding to the DVX event loop between slices so the GUI remains responsive.</p>
<p><a href="#ide.menu.file">File Menu</a></p>
<p><a href="#ide.menu.edit">Edit Menu</a></p>
<p><a href="#ide.menu.run">Run Menu</a></p>
<p><a href="#ide.menu.view">View Menu</a></p>
<p><a href="#ide.menu.window">Window Menu</a></p>
<p><a href="#ide.menu.tools">Tools Menu</a></p>
<p><a href="#ide.menu.help">Help Menu</a></p>
<p><a href="#ide.toolbar">Toolbar</a></p>
<p><a href="#ide.editor">Code Editor</a></p>
<p><a href="#ide.designer">Form Designer</a></p>
<p><a href="#ide.project">Project System</a></p>
<p><a href="#ide.properties">Properties Panel</a></p>
<p><a href="#ide.toolbox">Toolbox</a></p>
<p><a href="#ide.debugger">Debugger</a></p>
<p><a href="#ide.debug.locals">Locals Window</a></p>
<p><a href="#ide.debug.callstack">Call Stack Window</a></p>
<p><a href="#ide.debug.watch">Watch Window</a></p>
<p><a href="#ide.debug.breakpoints">Breakpoints Window</a></p>
<p><a href="#ide.immediate">Immediate Window</a></p>
<p><a href="#ide.output">Output Window</a></p>
<p><a href="#ide.findreplace">Find / Replace</a></p>
<p><a href="#ide.preferences">Preferences</a></p>
<p><a href="#ide.shortcuts">Keyboard Shortcuts</a></p>
</div>
<div class="topic" id="ide.menu.file">
<h1>File Menu</h1>
<pre> Menu Item Shortcut Description
--------- -------- -----------
New Project... Create a new DVX BASIC project.
Open Project... Open an existing .dbp project file.
Save Project Save the current project file to disk.
Close Project Close the current project (prompts to save unsaved changes).
---
Project Properties... Edit project metadata (name, author, version, startup form, icon, etc.).
---
Add File... Ctrl+O Add a .bas or .frm file to the project. If no project is open, creates an implicit project from the file.
Save File Ctrl+S Save the active file to disk.
Save All Save all modified files in the project.
---
Remove File Remove the selected file from the project (prompts to save if modified).
---
Exit Close the IDE (prompts to save unsaved changes).</pre>
<p><a href="#ide.menu.edit">Edit Menu</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.menu.edit">
<h1>Edit Menu</h1>
<pre> Menu Item Shortcut Description
--------- -------- -----------
Cut Ctrl+X Cut selected text to the clipboard.
Copy Ctrl+C Copy selected text to the clipboard.
Paste Ctrl+V Paste text from the clipboard.
---
Select All Ctrl+A Select all text in the active editor.
---
Delete Del Delete the selected text or control (in the form designer).
---
Find... Ctrl+F Open the Find/Replace dialog.
Find Next F3 Find the next occurrence of the search text.
Replace... Ctrl+H Open the Find/Replace dialog with replace enabled.</pre>
<p><a href="#ide.menu.run">Run Menu</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.menu.run">
<h1>Run Menu</h1>
<pre> Menu Item Shortcut Description
--------- -------- -----------
Run F5 Compile and run the program. If paused at a breakpoint, resumes execution with debugging disabled (runs free).
Debug Shift+F5 Compile and run with the debugger active. Breakpoints are active but execution does not pause at the first statement. If paused, resumes to the next breakpoint.
Run Without Recompile Ctrl+F5 Re-run the last compiled module without recompiling.
Stop Esc Stop the running program immediately.
---
Step Into F8 Execute one statement, stepping into SUB/FUNCTION calls. If idle, starts a debug session and breaks at the first statement.
Step Over Shift+F8 Execute one statement, stepping over SUB/FUNCTION calls.
Step Out Ctrl+Shift+F8 Run until the current SUB/FUNCTION returns.
Run to Cursor Ctrl+F8 Run until execution reaches the line where the cursor is positioned.
---
Toggle Breakpoint F9 Toggle a breakpoint on the current editor line.
---
Clear Output Clear the Output window.
---
Save on Run Checkbox: when enabled, all modified files are saved automatically before compiling. Persisted in preferences.</pre>
<p><a href="#ide.menu.view">View Menu</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.menu.view">
<h1>View Menu</h1>
<pre> Menu Item Shortcut Description
--------- -------- -----------
Code F7 Switch to Code view for the active file (or the file selected in the Project Explorer).
Designer Shift+F7 Switch to Design view for the active form file.
---
Toolbar Checkbox: show or hide the toolbar. Persisted in preferences.
Status Bar Checkbox: show or hide the status bar. Persisted in preferences.
---
Menu Editor... Ctrl+E Open the Menu Editor dialog for the active form. Allows designing menu bars with captions, names, levels, checked state, and enabled state.</pre>
<p><a href="#ide.menu.window">Window Menu</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.menu.window">
<h1>Window Menu</h1>
<pre> Menu Item Description
--------- -----------
Code Editor Show or raise the Code Editor window.
Output Show or raise the Output window.
Immediate Show or raise the Immediate window.
Locals Show or raise the Locals debug window.
Call Stack Show or raise the Call Stack debug window.
Watch Show or raise the Watch debug window.
Breakpoints Show or raise the Breakpoints window.
---
Project Explorer Show or raise the Project Explorer window.
Toolbox Show or raise the Toolbox window.
Properties Show or raise the Properties panel.</pre>
<p><a href="#ide.menu.tools">Tools Menu</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.menu.tools">
<h1>Tools Menu</h1>
<pre> Menu Item Description
--------- -----------
Preferences... Open the Preferences dialog (editor settings and project defaults).
---
Debug Layout Checkbox: toggle a debug overlay that shows widget layout boundaries. Useful for diagnosing widget layout issues.</pre>
<p><a href="#ide.menu.help">Help Menu</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.menu.help">
<h1>Help Menu</h1>
<pre> Menu Item Description
--------- -----------
About DVX BASIC... Show the About dialog with version and copyright information.</pre>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.toolbar">
<h1>Toolbar</h1>
<p>The toolbar is organized into four groups separated by vertical dividers. Each button has a tooltip showing its name and keyboard shortcut.</p>
<h2>File Group</h2>
<pre> Button Shortcut Action
------ -------- ------
Open Ctrl+O Add a file to the project (same as File &gt; Add File).
Save Ctrl+S Save the active file.</pre>
<h2>Run Group</h2>
<pre> Button Shortcut Action
------ -------- ------
Run F5 Compile and run the program.
Stop Esc Stop the running program.</pre>
<h2>Debug Group</h2>
<pre> Button Shortcut Action
------ -------- ------
Debug Shift+F5 Start or resume a debug session.
Step Into F8 Step into the next statement.
Step Over Shift+F8 Step over the next statement.
Step Out Ctrl+Shift+F8 Step out of the current procedure.
Run to Cursor Ctrl+F8 Run to the cursor position.</pre>
<h2>View Group</h2>
<pre> Button Shortcut Action
------ -------- ------
Code F7 Switch to Code view.
Design Shift+F7 Switch to Design view.</pre>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.editor">
<h1>Code Editor</h1>
<p>The Code Editor is the primary editing window for BASIC source code. It occupies the center of the screen, below the toolbar and above the Output and Immediate windows.</p>
<h2>Object and Function Dropdowns</h2>
<p>At the top of the Code Editor are two dropdown lists:</p>
<ul>
<li>Object -- lists (General) plus all objects (form name, control names, menu item names). Selecting an object filters the Function dropdown.</li>
</ul>
<p>Function -- lists all event handlers (procedures) for the selected object. Implemented handlers are listed first (plain text); unimplemented handlers follow in brackets (e.g., [Click]). Selecting an unimplemented event creates a new event handler stub.</p>
<p>The editor shows one procedure at a time. Each procedure has its own buffer, and switching between them is instantaneous. The (General) section contains module-level declarations and code.</p>
<h2>Syntax Highlighting</h2>
<p>The editor applies real-time syntax coloring as you type. The following categories are highlighted in distinct colors:</p>
<pre> Category Examples
-------- --------
Keywords IF, THEN, FOR, NEXT, SUB, FUNCTION, DIM, PRINT, SELECT, CASE, DO, LOOP, WHILE, WEND, END, EXIT, CALL, GOSUB, GOTO, RETURN, DECLARE, CONST, TYPE, AND, OR, NOT, XOR, MOD, etc.
Type names INTEGER, LONG, SINGLE, DOUBLE, STRING, BOOLEAN, BYTE, TRUE, FALSE
String literals &quot;Hello, World!&quot;
Comments ' This is a comment, REM This is a comment
Numbers 42, 3.14
Operators =, &lt;, &gt;, +, -, *, /, \, &amp;</pre>
<h2>Editor Features</h2>
<ul>
<li>Line numbers -- displayed in the gutter on the left side.</li>
<li>Auto-indent -- new lines are automatically indented to match the previous line.</li>
<li>Tab handling -- the Tab key is captured by the editor. Tab width and whether to insert spaces or tab characters are configurable in Preferences (default: 3 spaces).</li>
<li>Gutter click -- clicking in the line number gutter toggles a breakpoint on that line.</li>
</ul>
<p>Line decorations -- breakpoint lines show a red dot in the gutter. The current debug line (when paused) is highlighted with a yellow background.</p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.designer">
<h1>Form Designer</h1>
<p>The Form Designer provides a visual design surface for editing .frm files. Switch to it with Shift+F7 or the Design toolbar button. It opens in a separate window showing a WYSIWYG preview of the form.</p>
<h2>Design Surface</h2>
<ul>
<li>Grid snapping -- controls snap to an 8-pixel grid (DSGN_GRID_SIZE) when placed or resized.</li>
<li>Selection -- click a control to select it. The selected control is highlighted with grab handles.</li>
<li>Grab handles -- 6x6 pixel handles appear on the right edge (E), bottom edge (S), and bottom-right corner (SE) of the selected control. Drag a handle to resize the control.</li>
<li>Reordering -- drag a control vertically to reorder it within the form's layout (VBox/HBox).</li>
<li>Placing controls -- select a control type in the Toolbox, then click on the form to place a new instance. The control is auto-named (e.g., Command1, Command2). Clicking the same tool again deselects it (toggles back to pointer mode).</li>
<li>Menu bar preview -- if the form has menu items (defined via the Menu Editor), a preview menu bar is rendered on the design window.</li>
</ul>
<p>Delete key -- removes the selected control from the form.</p>
<h2>Form Properties</h2>
<p>Forms have the following design-time properties: Name, Caption, Width, Height, Left, Top, Layout (VBox or HBox), Centered, AutoSize, and Resizable.</p>
<p><a href="#ide.properties">Properties Panel</a></p>
<p><a href="#ide.toolbox">Toolbox</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.project">
<h1>Project System</h1>
<h2>Project Files (.dbp)</h2>
<p>A DVX BASIC project is stored as a .dbp file (DVX BASIC Project). The project file records:</p>
<ul>
<li>Name -- the project display name (up to 32 characters).</li>
<li>Startup Form -- which form to show automatically when the program starts.</li>
<li>Metadata -- Author, Company, Version, Copyright, Description, and Icon Path (for compiled binaries).</li>
</ul>
<p>File list -- relative paths (8.3 DOS names) of all .bas and .frm files in the project. Each entry tracks whether it is a form file.</p>
<h2>Source Map</h2>
<p>When the project is compiled, all files are concatenated into a single source stream. A source map tracks which lines belong to which file, enabling accurate error reporting and debugger navigation across multiple files. For .frm files, an injected BEGINFORM directive is prepended to the code section.</p>
<h2>Project Operations</h2>
<pre> Operation Description
--------- -----------
New Project Creates a blank project with a name and directory. A default .frm file is added automatically.
Open Project Opens a .dbp file and loads all referenced files into memory.
Save Project Writes the .dbp file to disk.
Close Project Closes the project, prompting to save unsaved changes.
Add File Adds a .bas or .frm file to the project. Opening a file without a project auto-creates an implicit project.
Remove File Removes a file from the project (prompts to save if modified).
Project Properties Opens a dialog for editing project metadata (name, author, company, version, copyright, description, icon, startup form).</pre>
<h2>Project Explorer</h2>
<p>The Project Explorer is a tree view window listing all project files. Double-click a file to open it: .bas files open in Code view, .frm files open in Design view. The selected file in the Project Explorer determines the target for View &gt; Code and View &gt; Designer commands.</p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.properties">
<h1>Properties Panel</h1>
<p>The Properties panel (Window &gt; Properties) has two sections:</p>
<ul>
<li>Control tree -- a TreeView at the top listing the form and all its controls in layout order. Click a control name to select it in both the Properties panel and the Form Designer. Drag items in the tree to reorder controls in the form's layout.</li>
</ul>
<p>Property list -- a two-column ListView below the tree showing property names and values for the selected control. Double-click a property value to edit it via an InputBox dialog. Changes take effect immediately in the designer preview.</p>
<p>Each control type exposes different properties (e.g., Caption, Text, Width, Height, MaxWidth, MaxHeight, Weight, Alignment, Enabled, Visible, and type-specific properties like DataSource and DataField for data-bound controls).</p>
<p><a href="#ide.designer">Form Designer</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.toolbox">
<h1>Toolbox</h1>
<p>The Toolbox (Window &gt; Toolbox) is a floating palette of buttons, one for each available control type. Controls are loaded dynamically from the widget plugin registry -- any widget DXE that provides a basName appears in the toolbox.</p>
<p>Click a tool to select it (the active tool name is stored in the designer state), then click on the form to place a new instance. Click the same tool again to deselect it and return to pointer mode.</p>
<h2>Available Controls</h2>
<pre> VB Name Description
------- -----------
CommandButton Push button that triggers a Click event.
Label Static text label.
TextBox Single-line text input field.
TextArea Multi-line text editor.
CheckBox On/off checkbox.
OptionButton Radio button (mutually exclusive within a group).
ListBox Scrollable list of items.
ComboBox Drop-down combo box.
DropDown Simple drop-down list.
PictureBox Canvas for drawing and images.
Image Static image display.
ImageButton Clickable image button.
Frame Grouping container with a labeled border.
VBox Vertical layout container.
HBox Horizontal layout container.
WrapBox Flow layout container that wraps items to the next row.
Splitter Resizable split between two child panes.
ScrollPane Scrollable container for large content.
TabStrip Tabbed container with multiple pages.
ListView Multi-column list with headers.
TreeView Hierarchical tree control.
ProgressBar Progress indicator bar.
HScrollBar Horizontal slider/scrollbar.
SpinButton Numeric up/down spinner.
Line Horizontal or vertical separator line.
Spacer Invisible spacing element for layout.
Timer Non-visual timer that fires periodic events.
Toolbar Toolbar container for buttons.
StatusBar Status bar at the bottom of a form.
Terminal ANSI terminal emulator control.
Data Data control for binding to a database.
DBGrid Data-bound grid for displaying database query results.</pre>
<p><a href="#ide.designer">Form Designer</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.debugger">
<h1>Debugger</h1>
<p>The DVX BASIC IDE includes a full interactive debugger. The debugger operates as a state machine with three states:</p>
<pre> State Description
----- -----------
DBG_IDLE No program loaded or running.
DBG_RUNNING Program is executing (VM running in slices).
DBG_PAUSED Execution is paused at a breakpoint or step point. The IDE GUI is fully interactive.</pre>
<h2>Starting a Debug Session</h2>
<ul>
<li>Shift+F5 (Debug) -- compiles the project and starts execution in debug mode. Breakpoints are active but execution does not pause at the first statement.</li>
<li>F8 (Step Into) -- if idle, starts a debug session and breaks at the first statement.</li>
</ul>
<p>F5 (Run) -- compiles and runs without the debugger. No breakpoints are active. If already paused, resumes execution with debugging disabled.</p>
<h2>Breakpoints</h2>
<h3>Setting Breakpoints</h3>
<ul>
<li>Press F9 to toggle a breakpoint on the current editor line.</li>
</ul>
<p>Click in the line number gutter to toggle a breakpoint on that line.</p>
<h3>Breakpoint Validation</h3>
<p>Not every line can have a breakpoint. The IDE validates the line content and silently refuses to set breakpoints on:</p>
<ul>
<li>Blank lines</li>
<li>Comment lines (' or REM)</li>
<li>SUB and FUNCTION declaration lines</li>
</ul>
<p>END SUB and END FUNCTION lines</p>
<h3>Breakpoint Storage</h3>
<p>Each breakpoint records the project file index, the code line number within the file, the procedure index, and the procedure name (as Object.Event). When the project is compiled, breakpoints are converted to concatenated source line numbers that match the VM's OP_LINE opcodes.</p>
<h3>Visual Indicators</h3>
<ul>
<li>Breakpoint lines show a red dot in the gutter.</li>
</ul>
<p>The current debug line (when paused) has a yellow background.</p>
<h3>Breakpoint Adjustment on Edit</h3>
<p>When lines are added or removed in the editor, breakpoints below the edit point are automatically shifted to stay on the correct line.</p>
<h2>Stepping</h2>
<pre> Action Shortcut Behavior
------ -------- --------
Step Into F8 Execute one statement. If the statement is a SUB/FUNCTION call, step into it.
Step Over Shift+F8 Execute one statement. If the statement is a SUB/FUNCTION call, execute the entire call and break at the next line in the current scope.
Step Out Ctrl+Shift+F8 Run until the current SUB/FUNCTION returns to its caller.
Run to Cursor Ctrl+F8 Run until execution reaches the line under the cursor.</pre>
<h2>The Debug Run Loop</h2>
<p>When a program is running in debug mode, the IDE enters a cooperative loop:</p>
<ul>
<li>The VM executes up to 10,000 steps per slice.</li>
<li>If the VM hits a breakpoint (BAS_VM_BREAKPOINT), the state transitions to DBG_PAUSED. The IDE navigates the code editor to the breakpoint line, highlights it in yellow, auto-opens the Locals and Call Stack windows, and updates all debug windows.</li>
<li>While paused, the IDE pumps dvxUpdate() continuously, keeping the GUI responsive. The user can inspect variables, modify them in the Immediate window, step, continue, or stop.</li>
</ul>
<p>When the user resumes (F5/Shift+F5/F8/etc.), the state transitions back to DBG_RUNNING and the loop continues.</p>
<h2>Stopping</h2>
<p>Press Esc or click the Stop toolbar button at any time to halt execution. The VM is destroyed, debug state resets to DBG_IDLE, and the IDE restores the designer windows that were hidden at run start.</p>
<p><a href="#ide.debug.locals">Locals Window</a></p>
<p><a href="#ide.debug.callstack">Call Stack Window</a></p>
<p><a href="#ide.debug.watch">Watch Window</a></p>
<p><a href="#ide.debug.breakpoints">Breakpoints Window</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.debug.locals">
<h1>Locals Window</h1>
<p>When the debugger pauses, the Locals and Call Stack windows are auto-opened (if not already visible). The Watch and Breakpoints windows can be opened manually from the Window menu.</p>
<p>Shows variables for the current execution scope. Displayed as a three-column ListView:</p>
<pre> Column Content
------ -------
Name Variable name (internal mangled names like static variable placeholders are filtered out).
Type Data type: Integer, Long, Single, Double, String, Boolean, Array, UDT. Array types show the element type (e.g., Integer()).
Value Current value. Strings are shown in quotes. Booleans as True/False. Arrays show bounds and element count (e.g., Integer(0 To 9) [10]). Uninitialized arrays show (uninitialized).</pre>
<p>The Locals window displays:</p>
<ul>
<li>Local variables for the current procedure (matched by proc index).</li>
<li>Global (module-level) variables.</li>
</ul>
<p>Form-scoped variables for the current form (if the program is executing within a form context).</p>
<p>Up to 64 variables are displayed. The window is resizable.</p>
<p><a href="#ide.debug.callstack">Call Stack Window</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.debug.callstack">
<h1>Call Stack Window</h1>
<p>Shows the current call chain as a two-column ListView:</p>
<pre> Column Content
------ -------
Procedure Procedure name (or (module) for module-level code).
Line Line number where execution is paused (shown for the topmost frame).</pre>
<p>The current location is shown first, followed by each caller in the call stack (walking from the deepest frame back to the module entry point). Up to 32 frames are displayed.</p>
<p><a href="#ide.debug.watch">Watch Window</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.debug.watch">
<h1>Watch Window</h1>
<p>Allows monitoring arbitrary expressions while debugging. The window has a text input at the top and a two-column ListView below:</p>
<pre> Column Content
------ -------
Expression The watch expression text.
Value Evaluated result (or &lt;error&gt; if evaluation fails). Blank when not paused.</pre>
<h2>Adding Watch Expressions</h2>
<p>Type an expression in the text input and press Enter. Up to 16 watch expressions can be active at once.</p>
<h2>Watch Expression Syntax</h2>
<p>Watch expressions support:</p>
<ul>
<li>Simple variable names: x, count</li>
<li>Array subscripts: arr(5), matrix(2, 3)</li>
<li>UDT field access: player.name</li>
<li>Combined: items(i).price</li>
</ul>
<p>Arbitrary BASIC expressions (compiled and evaluated against the paused VM's state): x + y * 2, Len(name$)</p>
<h2>Editing and Deleting</h2>
<ul>
<li>Double-click or press Enter on a watch entry to move it back into the input box for editing.</li>
</ul>
<p>Press Delete to remove the selected watch expression.</p>
<p><a href="#ide.debug.breakpoints">Breakpoints Window</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.debug.breakpoints">
<h1>Breakpoints Window</h1>
<p>Lists all set breakpoints as a three-column ListView:</p>
<pre> Column Content
------ -------
File Project file path.
Procedure Procedure name (Object.Event format, or (General)).
Line Code line number within the file.</pre>
<ul>
<li>Double-click a breakpoint to navigate the code editor to that location.</li>
</ul>
<p>Press Delete to remove selected breakpoints (multi-select is supported).</p>
<p><a href="#ide.debugger">Debugger</a></p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.immediate">
<h1>Immediate Window</h1>
<p>The Immediate window is an interactive REPL at the bottom-right of the screen. Type a line of BASIC and press Enter to evaluate it. Results appear inline below your input.</p>
<h2>Expression Evaluation</h2>
<p>If the input is not a recognized statement keyword, it is automatically wrapped in a PRINT statement. For example, typing 2 + 2 evaluates as PRINT 2 + 2 and displays 4.</p>
<p>You can also type full statements:</p>
<ul>
<li>PRINT x * 2 -- evaluate and print an expression.</li>
<li>DIM tmp As Integer -- declare a temporary variable.</li>
</ul>
<p>LET x = 42 -- explicit assignment (see below).</p>
<p>Parse or runtime errors are displayed inline with an Error: prefix.</p>
<h2>Inspecting Variables While Paused</h2>
<p>When the debugger is paused at a breakpoint, the Immediate window has access to the running VM's state. Global variable values are copied into the evaluation VM, so expressions like count or name$ &amp; &quot; test&quot; display live values.</p>
<h2>Assigning Variables While Paused</h2>
<p>When paused, you can modify variables in the running program directly from the Immediate window using assignment syntax:</p>
<pre><code>variableName = newValue</code></pre>
<p>The optional LET keyword is also accepted:</p>
<pre><code>LET variableName = newValue</code></pre>
<p>Assignment works for:</p>
<ul>
<li>Scalar variables -- x = 42, name$ = &quot;test&quot;</li>
<li>Array elements -- arr(5) = 100, matrix(2, 3) = 7.5</li>
<li>UDT fields -- player.score = 1000</li>
</ul>
<p>Combined -- items(0).price = 9.99</p>
<p>The new value is written directly into the VM's live variable slot (local, global, or form scope). A confirmation message is displayed, and the Locals and Watch windows update automatically to reflect the change.</p>
<p>If the assignment target cannot be resolved (unknown variable, out-of-bounds index, wrong type), an error message is displayed.</p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.output">
<h1>Output Window</h1>
<p>The Output window is a read-only TextArea at the bottom-left of the screen. It displays:</p>
<ul>
<li>PRINT output -- all PRINT statement output from the running program is appended here.</li>
<li>Runtime errors -- if the VM encounters a runtime error (division by zero, out-of-bounds, etc.), the error message and line number are displayed in the output with an Error on line N: prefix.</li>
</ul>
<p>Compile errors -- if compilation fails, the error message and location are shown.</p>
<p>The output buffer holds up to 32,768 characters. Use Run &gt; Clear Output to clear it.</p>
<p>INPUT statements prompt the user via a modal InputBox dialog; the prompt text is also echoed to the Output window.</p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.findreplace">
<h1>Find / Replace</h1>
<p>Open with Ctrl+F (Find) or Ctrl+H (Replace). The Find/Replace dialog is modeless -- it stays open while you continue editing.</p>
<h2>Dialog Controls</h2>
<pre> Control Description
------- -----------
Find input The text to search for.
Replace checkbox + input Enable replacement mode and enter replacement text.
Scope Radio group: Function, Object, File, or Project. Default is Project.
Direction Radio group: Forward or Backward.
Match Case Checkbox: case-sensitive search.</pre>
<h2>Buttons</h2>
<pre> Button Action
------ ------
Find Next Find the next occurrence. Wraps across procedures, files, and the entire project depending on the scope setting.
Replace Replace the current match and find the next one.
Replace All Replace all occurrences within the selected scope.
Close Close the dialog.</pre>
<h2>Keyboard Shortcut</h2>
<p>F3 repeats the last search (Find Next) without opening the dialog.</p>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.preferences">
<h1>Preferences</h1>
<p>Open via Tools &gt; Preferences. Settings are saved to dvxbasic.ini in the app's config directory.</p>
<h2>Editor Section</h2>
<pre> Setting Description Default
------- ----------- -------
Skip comments/strings when renaming When renaming a control or form, skip occurrences inside comments and string literals. On
Require variable declaration (OPTION EXPLICIT) When enabled, variables must be declared with DIM before use. Off
Tab width Number of spaces per tab stop (1-8). 3
Insert spaces instead of tabs When enabled, pressing Tab inserts spaces. When disabled, inserts a real tab character. On</pre>
<h2>New Project Defaults Section</h2>
<p>These fields set the default values for new project metadata:</p>
<pre> Field Description Default
----- ----------- -------
Author Default author name. (empty)
Company Default company name. (empty)
Version Default version string. 1.0
Copyright Default copyright notice. (empty)
Description Default project description (multi-line). (empty)</pre>
<p><a href="#ide.overview">Back to Overview</a></p>
</div>
<div class="topic" id="ide.shortcuts">
<h1>Keyboard Shortcuts</h1>
<pre> Shortcut Action
-------- ------
Ctrl+O Add File
Ctrl+S Save File
Ctrl+A Select All
Ctrl+X Cut
Ctrl+C Copy
Ctrl+V Paste
Ctrl+F Find
Ctrl+H Replace
Ctrl+E Menu Editor
F3 Find Next
F5 Run
Shift+F5 Debug
Ctrl+F5 Run Without Recompile
Esc Stop
F7 Code View
Shift+F7 Design View
F8 Step Into
Shift+F8 Step Over
Ctrl+Shift+F8 Step Out
Ctrl+F8 Run to Cursor
F9 Toggle Breakpoint
Del Delete</pre>
<hr>
<p>DVX BASIC 1.0 -- Copyright 2026 Scott Duensing</p>
</div>
<div class="topic" id="lang.datatypes">
<h1>Data Types</h1>
<p>DVX BASIC supports the following data types. Each type has a corresponding type suffix character that can be appended to variable names.</p>
<h2>Primary Types</h2>
<pre> Type Size Suffix Range / Description
---- ---- ------ -------------------
Integer 2 bytes % -32768 to 32767
Long 4 bytes &amp; -2147483648 to 2147483647
Single 4 bytes ! 32-bit float, approximately 7 digits precision
Double 8 bytes # 64-bit float, approximately 15 digits precision
String variable $ Variable-length, reference-counted, dynamic string
Boolean 2 bytes (none) True (-1) or False (0)</pre>
<h2>Internal Types</h2>
<p>These types are not directly declarable but are used internally by the runtime.</p>
<pre> Internal Type Description
------------- -----------
Array Reference-counted multi-dimensional array (up to 8 dimensions)
UDT User-defined type instance (created with TYPE...END TYPE)
Object Opaque host object (form reference, control reference)
Ref ByRef pointer to a variable slot (used for ByRef parameters)</pre>
<h2>Type Suffixes</h2>
<p>Type suffixes can be appended to variable names to declare their type implicitly:</p>
<pre><code>count% = 42 ' Integer
total&amp; = 100000 ' Long
rate! = 3.14 ' Single
pi# = 3.14159265 ' Double
name$ = &quot;Hello&quot; ' String</code></pre>
<h2>Numeric Literals</h2>
<pre> Form Example Description
---- ------- -----------
Decimal integer 42 Values -32768..32767 are Integer; larger are Long
Hex integer &amp;HFF Hexadecimal literal
Long suffix 42&amp;, &amp;HFF&amp; Force Long type
Floating-point 3.14, 1.5E10 Double by default
Single suffix 3.14! Force Single type
Double suffix 3.14# Force Double type</pre>
<h2>Type Promotion</h2>
<p>When mixing types in expressions, values are automatically promoted to a common type: Integer -&gt; Long -&gt; Single -&gt; Double. Strings are not automatically converted to numbers (use VAL and STR$).</p>
<p><a href="#lang.func.conversion">See also: Conversion Functions</a></p>
</div>
<div class="topic" id="lang.operators">
<h1>Operators</h1>
<p>Operators listed from highest precedence (evaluated first) to lowest precedence (evaluated last).</p>
<pre> Precedence Operator Description
---------- -------- -----------
1 (highest) ^ Exponentiation
2 - (unary) Negation
3 * / \ MOD Multiply, float div, integer div, modulus
4 + - Addition, subtraction
5 &amp; String concatenation
6 = &lt;&gt; &lt; &gt; &lt;= &gt;= Comparison (returns Boolean)
7 NOT Logical/bitwise NOT
8 AND Logical/bitwise AND
9 XOR Logical/bitwise XOR
10 OR Logical/bitwise OR
11 EQV Logical/bitwise equivalence
12 (lowest) IMP Logical/bitwise implication</pre>
<h2>String Concatenation</h2>
<p>Use &amp; to concatenate strings. The + operator also concatenates when both operands are strings.</p>
<pre><code>result$ = &quot;Hello&quot; &amp; &quot; &quot; &amp; &quot;World&quot;
result$ = firstName$ &amp; &quot; &quot; &amp; lastName$</code></pre>
</div>
<div class="topic" id="lang.statements">
<h1>Statements</h1>
<p>Multiple statements can appear on one line separated by :. Lines can be continued with _ at the end. Comments start with ' or REM.</p>
<p><a href="#lang.declarations">Declaration Statements (DIM, REDIM, CONST, TYPE)</a></p>
<p><a href="#lang.conditionals">Conditional Statements (IF, SELECT CASE)</a></p>
<p><a href="#lang.loops">Loop Statements (FOR, DO, WHILE)</a></p>
<p><a href="#lang.procedures">Procedures (SUB, FUNCTION, DEF FN)</a></p>
<p><a href="#lang.flow">Flow Control (EXIT, CALL, GOTO, GOSUB, ON)</a></p>
<p><a href="#lang.io">Input/Output (PRINT, INPUT, DATA/READ)</a></p>
<p><a href="#lang.misc">Miscellaneous Statements</a></p>
</div>
<div class="topic" id="lang.declarations">
<h1>Declaration Statements</h1>
<h2>DIM</h2>
<p>Declares variables and arrays with an explicit type.</p>
<pre><code>DIM variable AS type
DIM variable(upperBound) AS type
DIM variable(lower TO upper) AS type
DIM variable(dim1, dim2, ...) AS type
DIM variable AS UdtName
DIM variable AS STRING * n
DIM SHARED variable AS type</code></pre>
<p>Examples:</p>
<pre><code>Dim name As String
Dim count As Integer
Dim values(100) As Double
Dim matrix(1 To 10, 1 To 10) As Single
Dim Shared globalFlag As Boolean
Dim record As PersonType
Dim fixedStr As String * 20</code></pre>
<blockquote><strong>Note:</strong> DIM SHARED makes a variable accessible from all procedures without passing it as a parameter.</blockquote>
<h2>REDIM</h2>
<p>Reallocates a dynamic array, optionally preserving existing data.</p>
<pre><code>REDIM array(newBounds) AS type
REDIM PRESERVE array(newBounds) AS type</code></pre>
<pre><code>ReDim items(newSize) As String
ReDim Preserve scores(1 To newCount) As Integer</code></pre>
<h2>CONST</h2>
<p>Declares a named constant. The value must be a literal (integer, float, string, or boolean).</p>
<pre><code>CONST name = value</code></pre>
<pre><code>Const MAX_SIZE = 100
Const PI = 3.14159265
Const APP_NAME = &quot;DVX App&quot;
Const DEBUG_MODE = True</code></pre>
<h2>TYPE...END TYPE</h2>
<p>Defines a user-defined type (record/structure).</p>
<pre><code>TYPE TypeName
fieldName AS type
...
END TYPE</code></pre>
<pre><code>Type PersonType
firstName As String
lastName As String
age As Integer
End Type
Dim p As PersonType
p.firstName = &quot;Scott&quot;
p.age = 30</code></pre>
<p>UDT fields can themselves be UDTs (nested types).</p>
<h2>DECLARE</h2>
<p>Forward-declares a SUB or FUNCTION. Required when a procedure is called before it is defined.</p>
<pre><code>DECLARE SUB name ([BYVAL] param AS type, ...)
DECLARE FUNCTION name ([BYVAL] param AS type, ...) AS returnType</code></pre>
<h2>DECLARE LIBRARY</h2>
<p>Declares external native functions from a dynamically loaded library. This allows BASIC programs to call functions exported by DXE libraries.</p>
<pre><code>DECLARE LIBRARY &quot;libraryName&quot;
DECLARE SUB name ([BYVAL] param AS type, ...)
DECLARE FUNCTION name ([BYVAL] param AS type, ...) AS returnType
END DECLARE</code></pre>
<pre><code>Declare Library &quot;rs232&quot;
Declare Function ComOpen(ByVal port As Integer) As Integer
Declare Sub ComClose(ByVal port As Integer)
Declare Sub ComSend(ByVal port As Integer, ByVal data$ As String)
End Declare</code></pre>
<h2>STATIC</h2>
<p>Declares a local variable that retains its value between calls.</p>
<pre><code>STATIC variable AS type</code></pre>
<pre><code>Sub Counter()
Static count As Integer
count = count + 1
Print count
End Sub</code></pre>
<h2>OPTION</h2>
<p>Sets compiler options. Must appear before any executable code.</p>
<pre><code>OPTION BASE 0 ' Arrays start at index 0 (default)
OPTION BASE 1 ' Arrays start at index 1
OPTION COMPARE BINARY ' Case-sensitive string comparisons (default)
OPTION COMPARE TEXT ' Case-insensitive string comparisons
OPTION EXPLICIT ' All variables must be declared with DIM</code></pre>
<h2>DEFtype Statements</h2>
<p>Set the default type for variables based on their first letter.</p>
<pre><code>DEFINT letterRange
DEFLNG letterRange
DEFSNG letterRange
DEFDBL letterRange
DEFSTR letterRange</code></pre>
<pre><code>DefInt I-N ' Variables starting with I through N default to Integer
DefStr S ' Variables starting with S default to String</code></pre>
<h2>Assignment</h2>
<p>Assigns a value to a variable, array element, or UDT field.</p>
<pre><code>variable = expression
array(index) = expression
udt.field = expression
LET variable = expression</code></pre>
<p>The LET keyword is optional and supported for compatibility.</p>
<h2>SWAP</h2>
<p>Exchanges the values of two variables.</p>
<pre><code>SWAP variable1, variable2</code></pre>
<pre><code>Swap a, b</code></pre>
<h2>ERASE</h2>
<p>Frees the memory of an array and resets it.</p>
<pre><code>ERASE arrayName</code></pre>
</div>
<div class="topic" id="lang.conditionals">
<h1>Conditional Statements</h1>
<h2>IF...THEN...ELSE...END IF</h2>
<p>Conditional execution. Supports single-line and multi-line forms.</p>
<h3>Single-line form</h3>
<pre><code>IF condition THEN statement
IF condition THEN statement ELSE statement</code></pre>
<h3>Multi-line form</h3>
<pre><code>IF condition THEN
statements
ELSEIF condition THEN
statements
ELSE
statements
END IF</code></pre>
<pre><code>If x &gt; 10 Then
Print &quot;Large&quot;
ElseIf x &gt; 5 Then
Print &quot;Medium&quot;
Else
Print &quot;Small&quot;
End If
If ready Then Print &quot;Go!&quot;</code></pre>
<h2>SELECT CASE</h2>
<p>Multi-way branch based on an expression value.</p>
<pre><code>SELECT CASE expression
CASE value
statements
CASE value1, value2
statements
CASE low TO high
statements
CASE IS operator value
statements
CASE ELSE
statements
END SELECT</code></pre>
<pre><code>Select Case grade
Case 90 To 100
Print &quot;A&quot;
Case 80 To 89
Print &quot;B&quot;
Case Is &gt;= 70
Print &quot;C&quot;
Case 60, 65
Print &quot;D (borderline)&quot;
Case Else
Print &quot;F&quot;
End Select</code></pre>
<p>CASE items can be combined with commas. The IS keyword allows comparison operators: &lt;, &gt;, &lt;=, &gt;=, =, &lt;&gt;.</p>
</div>
<div class="topic" id="lang.loops">
<h1>Loop Statements</h1>
<h2>FOR...NEXT</h2>
<p>Counted loop with an optional step value.</p>
<pre><code>FOR variable = start TO limit [STEP step]
statements
NEXT [variable]</code></pre>
<pre><code>For i = 1 To 10
Print i
Next i
For x = 10 To 0 Step -2
Print x
Next</code></pre>
<p>The variable name after NEXT is optional. Use EXIT FOR to break out early.</p>
<h2>DO...LOOP</h2>
<p>General-purpose loop with pre-test, post-test, or infinite forms.</p>
<pre><code>DO [WHILE condition | UNTIL condition]
statements
LOOP [WHILE condition | UNTIL condition]</code></pre>
<pre><code>' Pre-test
Do While count &lt; 10
count = count + 1
Loop
' Post-test
Do
line$ = ReadLine()
Loop Until line$ = &quot;quit&quot;
' Infinite loop (exit with EXIT DO)
Do
DoEvents
If done Then Exit Do
Loop</code></pre>
<h2>WHILE...WEND</h2>
<p>Simple pre-test loop (legacy form; prefer DO...LOOP).</p>
<pre><code>WHILE condition
statements
WEND</code></pre>
<pre><code>While Not EOF(1)
Line Input #1, line$
Print line$
Wend</code></pre>
</div>
<div class="topic" id="lang.procedures">
<h1>Procedures</h1>
<h2>SUB...END SUB</h2>
<p>Defines a subroutine (no return value).</p>
<pre><code>SUB name ([BYVAL] param AS type, ...)
statements
END SUB</code></pre>
<pre><code>Sub Greet(ByVal name As String)
Print &quot;Hello, &quot; &amp; name
End Sub</code></pre>
<p>Parameters are passed ByRef by default. Use ByVal for value semantics. Use EXIT SUB to return early.</p>
<h2>FUNCTION...END FUNCTION</h2>
<p>Defines a function with a return value.</p>
<pre><code>FUNCTION name ([BYVAL] param AS type, ...) AS returnType
statements
name = returnValue
END FUNCTION</code></pre>
<pre><code>Function Square(ByVal n As Double) As Double
Square = n * n
End Function</code></pre>
<p>Assign to the function name to set the return value. Use EXIT FUNCTION to return early.</p>
<h2>DEF FN</h2>
<p>Defines a single-expression function.</p>
<pre><code>DEF FNname(params) = expression</code></pre>
<pre><code>Def FnSquare(x) = x * x
Print FnSquare(5) ' prints 25</code></pre>
</div>
<div class="topic" id="lang.flow">
<h1>Flow Control</h1>
<h2>EXIT</h2>
<p>Exits the current block early.</p>
<pre><code>EXIT FOR
EXIT DO
EXIT SUB
EXIT FUNCTION</code></pre>
<h2>CALL</h2>
<p>Explicitly calls a subroutine or function. The return value (if any) is discarded.</p>
<pre><code>CALL name
CALL name(args)</code></pre>
<p>Normally you can omit CALL and just use the name directly.</p>
<h2>GOTO / GOSUB / RETURN</h2>
<pre><code>GOTO label
GOSUB label
RETURN</code></pre>
<p>GOSUB pushes the return address, executes code at the label, and RETURN jumps back. At module level, RETURN returns from a GOSUB. Inside a SUB/FUNCTION, RETURN returns from the procedure.</p>
<pre><code>GoSub Initialize
Print &quot;Done&quot;
End
Initialize:
count = 0
name$ = &quot;&quot;
Return</code></pre>
<h2>ON...GOTO / ON...GOSUB</h2>
<p>Computed branch based on an integer expression.</p>
<pre><code>ON expression GOTO label1, label2, ...
ON expression GOSUB label1, label2, ...</code></pre>
<p>If the expression evaluates to 1, control goes to the first label; 2, the second; and so on. If out of range, execution falls through.</p>
</div>
<div class="topic" id="lang.io">
<h1>Input/Output Statements</h1>
<h2>PRINT</h2>
<p>Outputs text to the console or to a file channel.</p>
<pre><code>PRINT [expression] [{; | ,} expression] ...
PRINT #channel, expression
PRINT USING format$; expression [; expression] ...</code></pre>
<ul>
<li>; between items -- no separator (items are concatenated)</li>
<li>, between items -- advance to the next 14-column tab zone</li>
<li>Trailing ; or , suppresses the newline</li>
</ul>
<p>? is an alias for PRINT</p>
<p>Special functions inside PRINT:</p>
<ul>
<li>SPC(n) -- print n spaces</li>
</ul>
<p>TAB(n) -- advance to column n</p>
<pre><code>Print &quot;Name:&quot;; Tab(20); name$
Print Using &quot;###.##&quot;; total
Print #1, &quot;Written to file&quot;</code></pre>
<h2>INPUT</h2>
<p>Reads a line of text from the user or from a file channel.</p>
<pre><code>INPUT variable
INPUT &quot;prompt&quot;; variable
INPUT #channel, variable</code></pre>
<pre><code>Input &quot;Enter your name: &quot;; name$
Input #1, line$</code></pre>
<h2>DATA / READ / RESTORE</h2>
<p>Inline data pool for constants.</p>
<pre><code>DATA value1, value2, &quot;string&quot;, ...
READ variable1, variable2, ...
RESTORE</code></pre>
<p>DATA statements define a pool of values. READ reads the next value from the pool into a variable. RESTORE resets the read pointer to the beginning.</p>
<pre><code>Data 10, 20, 30, &quot;Hello&quot;
Read a, b, c, msg$
Print a; b; c; msg$
Restore</code></pre>
</div>
<div class="topic" id="lang.misc">
<h1>Miscellaneous Statements</h1>
<h2>Error Handling</h2>
<pre><code>ON ERROR GOTO label ' Enable error handler
ON ERROR GOTO 0 ' Disable error handler
RESUME ' Retry the statement that caused the error
RESUME NEXT ' Continue at the next statement after the error
ERROR n ' Raise a runtime error with error number n</code></pre>
<p>The ERR keyword returns the current error number in expressions.</p>
<pre><code>On Error GoTo ErrorHandler
Open &quot;missing.txt&quot; For Input As #1
Exit Sub
ErrorHandler:
Print &quot;Error number:&quot;; Err
Resume Next</code></pre>
<h2>SHELL</h2>
<p>Executes an operating system command.</p>
<pre><code>SHELL &quot;command&quot;</code></pre>
<p>When used as a function, returns the exit code of the command.</p>
<pre><code>Shell &quot;DIR /B&quot;
exitCode = Shell(&quot;COPY A.TXT B.TXT&quot;)</code></pre>
<h2>SLEEP</h2>
<p>Pauses execution for a specified number of seconds.</p>
<pre><code>SLEEP seconds</code></pre>
<h2>RANDOMIZE</h2>
<p>Seeds the random number generator.</p>
<pre><code>RANDOMIZE seed
RANDOMIZE TIMER ' Seed from system clock</code></pre>
<h2>END</h2>
<p>Terminates program execution immediately.</p>
<pre><code>END</code></pre>
</div>
<div class="topic" id="lang.fileio">
<h1>File I/O</h1>
<h2>OPEN</h2>
<p>Opens a file for reading, writing, or appending.</p>
<pre><code>OPEN filename$ FOR INPUT AS #channel
OPEN filename$ FOR OUTPUT AS #channel
OPEN filename$ FOR APPEND AS #channel
OPEN filename$ FOR RANDOM AS #channel [LEN = recordSize]
OPEN filename$ FOR BINARY AS #channel</code></pre>
<pre> Mode Description
---- -----------
INPUT Open for sequential reading. File must exist.
OUTPUT Open for sequential writing. Creates or truncates.
APPEND Open for sequential writing at end of file.
RANDOM Open for random-access record I/O.
BINARY Open for raw binary I/O.</pre>
<h2>CLOSE</h2>
<p>Closes an open file channel.</p>
<pre><code>CLOSE #channel</code></pre>
<h2>PRINT #</h2>
<p>Writes text to a file.</p>
<pre><code>PRINT #channel, expression</code></pre>
<h2>INPUT #</h2>
<p>Reads comma-delimited data from a file.</p>
<pre><code>INPUT #channel, variable</code></pre>
<h2>LINE INPUT #</h2>
<p>Reads an entire line from a file into a string variable.</p>
<pre><code>LINE INPUT #channel, variable$</code></pre>
<h2>WRITE #</h2>
<p>Writes comma-delimited data to a file. Strings are enclosed in quotes, numbers are undecorated. Each statement writes a newline at the end.</p>
<pre><code>WRITE #channel, expr1, expr2, ...</code></pre>
<pre><code>Write #1, &quot;Scott&quot;, 42, 3.14
' Output: &quot;Scott&quot;,42,3.14</code></pre>
<h2>GET / PUT</h2>
<p>Read and write records in RANDOM or BINARY mode files.</p>
<pre><code>GET #channel, [recordNum], variable
PUT #channel, [recordNum], variable</code></pre>
<h2>SEEK</h2>
<p>Sets the file position. As a function, returns the current position.</p>
<pre><code>SEEK #channel, position ' Statement: set position
pos = SEEK(channel) ' Function: get current position</code></pre>
</div>
<div class="topic" id="lang.func.string">
<h1>String Functions</h1>
<pre> Function Returns Description
-------- ------- -----------
ASC(s$) Integer ASCII code of first character of s$
CHR$(n) String Character with ASCII code n
FORMAT$(value, fmt$) String Formats a numeric value using format string
HEX$(n) String Hexadecimal representation of n
INSTR(s$, find$) Integer Position of find$ in s$ (1-based), 0 if not found
INSTR(start, s$, find$) Integer Search starting at position start
LCASE$(s$) String Converts s$ to lowercase
LEFT$(s$, n) String Leftmost n characters of s$
LEN(s$) Integer Length of s$
LTRIM$(s$) String Removes leading spaces from s$
MID$(s$, start [, length]) String Substring from position start (1-based)
RIGHT$(s$, n) String Rightmost n characters of s$
RTRIM$(s$) String Removes trailing spaces from s$
SPACE$(n) String String of n spaces
STR$(n) String Converts number n to string
STRING$(n, char) String String of n copies of char
TRIM$(s$) String Removes leading and trailing spaces from s$
UCASE$(s$) String Converts s$ to uppercase
VAL(s$) Double Converts string s$ to a numeric value</pre>
<h2>MID$ Assignment</h2>
<p>MID$ can also be used on the left side of an assignment to replace a portion of a string:</p>
<pre><code>Mid$(s$, 3, 2) = &quot;XY&quot; ' Replace 2 characters starting at position 3</code></pre>
</div>
<div class="topic" id="lang.func.math">
<h1>Math Functions</h1>
<pre> Function Returns Description
-------- ------- -----------
ABS(n) Double Absolute value of n
ATN(n) Double Arctangent of n (in radians)
COS(n) Double Cosine of n (radians)
EXP(n) Double e raised to the power n
FIX(n) Integer Truncates n toward zero (removes fractional part)
INT(n) Integer Largest integer less than or equal to n (floor)
LOG(n) Double Natural logarithm (base e) of n
RND[(n)] Double Random number between 0 (inclusive) and 1 (exclusive)
SGN(n) Integer Sign of n: -1, 0, or 1
SIN(n) Double Sine of n (radians)
SQR(n) Double Square root of n
TAN(n) Double Tangent of n (radians)
TIMER Double Number of seconds since midnight</pre>
<blockquote><strong>Note:</strong> RND with a negative argument seeds and returns. RND(0) returns the previous value. Use RANDOMIZE to seed the generator.</blockquote>
</div>
<div class="topic" id="lang.func.conversion">
<h1>Conversion Functions</h1>
<pre> Function Returns Description
-------- ------- -----------
CDBL(n) Double Converts n to Double
CINT(n) Integer Converts n to Integer (with banker's rounding)
CLNG(n) Long Converts n to Long
CSNG(n) Single Converts n to Single
CSTR(n) String Converts n to its String representation</pre>
</div>
<div class="topic" id="lang.func.fileio">
<h1>File I/O Functions</h1>
<pre> Function Returns Description
-------- ------- -----------
EOF(channel) Boolean True if file pointer is at end of file
FREEFILE Integer Next available file channel number
INPUT$(n, #channel) String Reads n characters from the file
LOC(channel) Long Current read/write position in the file
LOF(channel) Long Length of the file in bytes
SEEK(channel) Long Current file position (function form)
LBOUND(array [, dim]) Integer Lower bound of an array dimension
UBOUND(array [, dim]) Integer Upper bound of an array dimension</pre>
</div>
<div class="topic" id="lang.func.misc">
<h1>Miscellaneous Functions</h1>
<pre> Function Returns Description
-------- ------- -----------
DATE$ String Current date as &quot;MM-DD-YYYY&quot;
TIME$ String Current time as &quot;HH:MM:SS&quot;
ENVIRON$(name$) String Value of environment variable name$
ERR Integer Current runtime error number (0 if no error)</pre>
</div>
<div class="topic" id="lang.forms">
<h1>Form and Control Statements</h1>
<p>DVX BASIC supports Visual Basic-style forms and controls for building graphical user interfaces. Forms are defined in .frm files and loaded at runtime.</p>
<h2>Loading and Unloading Forms</h2>
<pre><code>LOAD FormName
UNLOAD FormName</code></pre>
<p>LOAD creates the form and its controls in memory. UNLOAD destroys the form and frees its resources.</p>
<h2>Showing and Hiding Forms</h2>
<pre><code>FormName.Show [modal]
FormName.Hide
Me.Show [modal]
Me.Hide</code></pre>
<p>Pass vbModal (1) to Show for a modal dialog.</p>
<pre><code>Form2.Show vbModal
Me.Hide</code></pre>
<h2>Property Access</h2>
<p>Read and write control properties using dot notation:</p>
<pre><code>ControlName.Property = value
value = ControlName.Property</code></pre>
<pre><code>Text1.Text = &quot;Hello&quot;
label1.Caption = &quot;Name: &quot; &amp; name$
x = Text1.Left</code></pre>
<h2>Method Calls</h2>
<pre><code>ControlName.Method [args]</code></pre>
<pre><code>List1.AddItem &quot;New entry&quot;
List1.Clear</code></pre>
<h2>Me Keyword</h2>
<p>Me refers to the current form. Use it to access the form's own properties, controls, and methods from within event handlers.</p>
<pre><code>Me.Caption = &quot;Updated Title&quot;
Me.Text1.Text = &quot;&quot;
Me.Hide</code></pre>
<h2>Control Arrays</h2>
<p>Multiple controls can share a name with unique indices. Access individual controls with parenthesized indices:</p>
<pre><code>Option1(0).Value = True
Label1(idx).Caption = &quot;Item &quot; &amp; Str$(idx)
Me.Label1(i).Visible = True</code></pre>
<h2>DoEvents</h2>
<p>Yields control to the DVX event loop, allowing the GUI to process pending events. Call this in long-running loops to keep the UI responsive.</p>
<pre><code>DOEVENTS</code></pre>
<pre><code>For i = 1 To 10000
' process data
If i Mod 100 = 0 Then DoEvents
Next</code></pre>
<h2>MsgBox</h2>
<p>Displays a message box dialog. Can be used as a statement (discards result) or as a function (returns the button clicked).</p>
<pre><code>MSGBOX message$ [, flags]
result = MSGBOX(message$ [, flags])</code></pre>
<pre><code>MsgBox &quot;Operation complete&quot;
answer = MsgBox(&quot;Continue?&quot;, vbYesNo + vbQuestion)
If answer = vbYes Then
' proceed
End If</code></pre>
<h2>InputBox$</h2>
<p>Displays an input dialog and returns the user's text entry.</p>
<pre><code>result$ = INPUTBOX$(prompt$ [, title$ [, default$]])</code></pre>
<pre><code>name$ = InputBox$(&quot;Enter your name:&quot;, &quot;Name Entry&quot;, &quot;&quot;)</code></pre>
<h2>Event Handler Convention</h2>
<p>Event handlers are named ControlName_EventName and defined as SUBs:</p>
<pre><code>Sub Command1_Click()
MsgBox &quot;Button clicked!&quot;
End Sub
Sub Form_Load()
Me.Caption = &quot;My App&quot;
End Sub
Sub Text1_Change()
Label1.Caption = &quot;You typed: &quot; &amp; Text1.Text
End Sub</code></pre>
<h3>Common Events</h3>
<pre> Event Description
----- -----------
Click Control was clicked
DblClick Control was double-clicked
Change Control value/text changed
KeyPress Key was pressed (receives key code)
KeyDown Key went down (receives key code and shift state)
KeyUp Key was released
MouseDown Mouse button pressed
MouseUp Mouse button released
MouseMove Mouse moved over control
GotFocus Control received input focus
LostFocus Control lost input focus
Form_Load Form is being loaded
Form_Unload Form is being unloaded
Form_Resize Form was resized
Timer Timer interval elapsed</pre>
</div>
<div class="topic" id="lang.sql">
<h1>SQL Functions</h1>
<p>DVX BASIC includes built-in SQLite database support through a set of SQL functions. All functions use database handles and result set handles (integers) returned by SQLOpen and SQLQuery.</p>
<h2>Opening and Closing Databases</h2>
<h3>SQLOpen</h3>
<p>Opens a SQLite database file and returns a database handle.</p>
<pre><code>db = SQLOPEN(path$)</code></pre>
<pre><code>db = SQLOpen(App.Data &amp; &quot;\mydata.db&quot;)</code></pre>
<h3>SQLClose</h3>
<p>Closes an open database.</p>
<pre><code>SQLCLOSE db</code></pre>
<h2>Executing SQL</h2>
<h3>SQLExec</h3>
<p>Executes a SQL statement that does not return data (INSERT, UPDATE, DELETE, CREATE TABLE, etc.). Can be used as a statement or as a function returning a Boolean success flag.</p>
<pre><code>SQLEXEC db, sql$
ok = SQLEXEC(db, sql$)</code></pre>
<pre><code>SQLExec db, &quot;CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)&quot;
SQLExec db, &quot;INSERT INTO users (name) VALUES ('Scott')&quot;
ok = SQLExec(db, &quot;DELETE FROM users WHERE id = 5&quot;)</code></pre>
<h3>SQLAffected</h3>
<p>Returns the number of rows affected by the last INSERT, UPDATE, or DELETE.</p>
<pre><code>count = SQLAFFECTED(db)</code></pre>
<h2>Querying Data</h2>
<h3>SQLQuery</h3>
<p>Executes a SELECT query and returns a result set handle.</p>
<pre><code>rs = SQLQUERY(db, sql$)</code></pre>
<pre><code>rs = SQLQuery(db, &quot;SELECT id, name FROM users ORDER BY name&quot;)</code></pre>
<h3>SQLNext</h3>
<p>Advances to the next row in the result set. Can be used as a statement or as a function returning True if a row is available.</p>
<pre><code>SQLNEXT rs
hasRow = SQLNEXT(rs)</code></pre>
<h3>SQLEof</h3>
<p>Returns True if there are no more rows in the result set.</p>
<pre><code>done = SQLEOF(rs)</code></pre>
<h2>Reading Fields</h2>
<h3>SQLField$</h3>
<p>Returns a field value as a string. The field can be specified by column index (0-based) or by column name.</p>
<pre><code>value$ = SQLFIELD$(rs, columnIndex)
value$ = SQLFIELD$(rs, &quot;columnName&quot;)</code></pre>
<pre><code>name$ = SQLField$(rs, &quot;name&quot;)
first$ = SQLField$(rs, 0)</code></pre>
<h3>SQLFieldInt</h3>
<p>Returns a field value as an integer.</p>
<pre><code>value = SQLFIELDINT(rs, columnIndex)</code></pre>
<h3>SQLFieldDbl</h3>
<p>Returns a field value as a double.</p>
<pre><code>value# = SQLFIELDDBL(rs, columnIndex)</code></pre>
<h3>SQLFieldCount</h3>
<p>Returns the number of columns in the result set.</p>
<pre><code>count = SQLFIELDCOUNT(rs)</code></pre>
<h2>Result Set Cleanup</h2>
<h3>SQLFreeResult</h3>
<p>Frees a result set. Always call this when done iterating a query.</p>
<pre><code>SQLFREERESULT rs</code></pre>
<h2>Error Information</h2>
<h3>SQLError$</h3>
<p>Returns the last error message for the database.</p>
<pre><code>msg$ = SQLERROR$(db)</code></pre>
<h2>Complete SQL Example</h2>
<pre><code>Dim db As Long
Dim rs As Long
db = SQLOpen(App.Data &amp; &quot;\contacts.db&quot;)
SQLExec db, &quot;CREATE TABLE IF NOT EXISTS contacts (name TEXT, phone TEXT)&quot;
SQLExec db, &quot;INSERT INTO contacts VALUES ('Alice', '555-1234')&quot;
rs = SQLQuery(db, &quot;SELECT name, phone FROM contacts&quot;)
Do While Not SQLEof(rs)
SQLNext rs
Print SQLField$(rs, &quot;name&quot;); Tab(20); SQLField$(rs, &quot;phone&quot;)
Loop
SQLFreeResult rs
SQLClose db</code></pre>
</div>
<div class="topic" id="lang.app">
<h1>App Object</h1>
<p>The App object provides read-only properties for the application's directory paths.</p>
<pre> Property Returns Description
-------- ------- -----------
App.Path String Directory containing the application's executable
App.Config String Directory for application configuration files
App.Data String Directory for application data files (databases, etc.)</pre>
<pre><code>configFile$ = App.Config &amp; &quot;\settings.ini&quot;
dbPath$ = App.Data &amp; &quot;\myapp.db&quot;
Print &quot;Running from: &quot; &amp; App.Path</code></pre>
</div>
<div class="topic" id="lang.ini">
<h1>INI Functions</h1>
<p>DVX BASIC provides built-in functions for reading and writing standard INI configuration files.</p>
<h2>IniRead</h2>
<p>Reads a value from an INI file. Returns the default value if the key is not found.</p>
<pre><code>value$ = INIREAD(file$, section$, key$, default$)</code></pre>
<pre><code>name$ = IniRead(App.Config &amp; &quot;\app.ini&quot;, &quot;User&quot;, &quot;Name&quot;, &quot;Unknown&quot;)
fontSize = Val(IniRead(App.Config &amp; &quot;\app.ini&quot;, &quot;Display&quot;, &quot;FontSize&quot;, &quot;12&quot;))</code></pre>
<h2>IniWrite</h2>
<p>Writes a value to an INI file. Creates the file, section, or key if they do not exist.</p>
<pre><code>INIWRITE file$, section$, key$, value$</code></pre>
<pre><code>IniWrite App.Config &amp; &quot;\app.ini&quot;, &quot;User&quot;, &quot;Name&quot;, &quot;Scott&quot;
IniWrite App.Config &amp; &quot;\app.ini&quot;, &quot;Display&quot;, &quot;FontSize&quot;, Str$(fontSize)</code></pre>
</div>
<div class="topic" id="lang.constants">
<h1>Predefined Constants</h1>
<p>The following constants are predefined by the compiler and available in all programs.</p>
<h2>MsgBox Button Style Flags</h2>
<pre> Constant Value Description
-------- ----- -----------
vbOKOnly 0 OK button only (default)
vbOKCancel 1 OK and Cancel buttons
vbYesNo 2 Yes and No buttons
vbYesNoCancel 3 Yes, No, and Cancel buttons
vbRetryCancel 4 Retry and Cancel buttons</pre>
<h2>MsgBox Icon Flags</h2>
<p>Add an icon flag to the button style to display an icon in the message box.</p>
<pre> Constant Value Description
-------- ----- -----------
vbInformation &amp;H10 Information icon
vbExclamation &amp;H20 Warning icon
vbCritical &amp;H30 Error/critical icon
vbQuestion &amp;H40 Question mark icon</pre>
<h2>MsgBox Return Values</h2>
<pre> Constant Value Description
-------- ----- -----------
vbOK 1 User clicked OK
vbCancel 2 User clicked Cancel
vbYes 3 User clicked Yes
vbNo 4 User clicked No
vbRetry 5 User clicked Retry</pre>
<h2>Show Mode Flags</h2>
<pre> Constant Value Description
-------- ----- -----------
vbModal 1 Show form as modal dialog</pre>
<h2>Boolean Constants</h2>
<pre> Constant Value Description
-------- ----- -----------
True -1 Boolean true
False 0 Boolean false</pre>
</div>
<div class="topic" id="ctrl.common.props">
<h1>Common Properties, Events, and Methods</h1>
<p>Every control in DVX BASIC inherits a set of common properties, events, and methods. These are handled by the form runtime before dispatching to widget-specific interface descriptors.</p>
<h2>Common Properties</h2>
<pre> Property Type R/W Description
---------- ------- --- -------------------------------------------
Name String R The control's name (e.g. &quot;Command1&quot;). Read-only at runtime.
Left Integer R/W X position in pixels relative to the parent container.
Top Integer R/W Y position in pixels relative to the parent container.
Width Integer R/W Current width in pixels. Setting this changes the minimum width constraint.
Height Integer R/W Current height in pixels. Setting this changes the minimum height constraint.
MinWidth Integer R/W Minimum width for layout. Alias for Width in the setter.
MinHeight Integer R/W Minimum height for layout. Alias for Height in the setter.
MaxWidth Integer R/W Maximum width cap (0 = no limit, stretch to fill).
MaxHeight Integer R/W Maximum height cap (0 = no limit, stretch to fill).
Weight Integer R/W Layout weight. 0 = fixed size, &gt;0 = share extra space proportionally.
Visible Boolean R/W Whether the control is visible.
Enabled Boolean R/W Whether the control accepts user input.
BackColor Long R/W Background color as a 32-bit ARGB value.
ForeColor Long R/W Foreground (text) color as a 32-bit ARGB value.
TabIndex Integer R Accepted for VB compatibility but ignored. DVX has no tab order.</pre>
<h2>Common Events</h2>
<p>These events are wired on every control loaded from a .frm file. Controls created dynamically at runtime via code only receive Click, DblClick, Change, GotFocus, and LostFocus; the keyboard, mouse, and scroll events below require the control to be defined in the .frm file.</p>
<pre> Event Parameters Description
--------- ------------------------------------------- -------------------------------------------
Click (none) Fires when the control is clicked.
DblClick (none) Fires when the control is double-clicked.
Change (none) Fires when the control's value or text changes.
GotFocus (none) Fires when the control receives keyboard focus.
LostFocus (none) Fires when the control loses keyboard focus.
KeyPress KeyAscii As Integer Fires when a printable key is pressed. KeyAscii is the ASCII code.
KeyDown KeyCode As Integer, Shift As Integer Fires when any key is pressed down. KeyCode is the scan code; Shift indicates modifier keys.
KeyUp KeyCode As Integer, Shift As Integer Fires when a key is released.
MouseDown Button As Integer, X As Integer, Y As Integer Fires when a mouse button is pressed over the control.
MouseUp Button As Integer, X As Integer, Y As Integer Fires when a mouse button is released over the control.
MouseMove Button As Integer, X As Integer, Y As Integer Fires when the mouse moves over the control.
Scroll Delta As Integer Fires when the control is scrolled (mouse wheel or scrollbar).</pre>
<h2>Common Methods</h2>
<pre> Method Parameters Description
-------- ---------- -------------------------------------------
SetFocus (none) Gives keyboard focus to this control.
Refresh (none) Forces the control to repaint.</pre>
<p><a href="#ctrl.form">Form</a></p>
<p><a href="#ctrl.databinding">Data Binding</a></p>
<p><a href="#ctrl.frm">FRM File Format</a></p>
</div>
<div class="topic" id="ctrl.databinding">
<h1>Data Binding</h1>
<p>DVX BASIC provides VB3-style data binding through three properties that can be set on most controls:</p>
<pre> Property Set On Description
---------- ----------- -------------------------------------------
DataSource Any control Name of the Data control to bind to (e.g. &quot;Data1&quot;).
DataField Any control Column name from the Data control's recordset to display.</pre>
<h2>How It Works</h2>
<ul>
<li>Place a Data control on the form and set its DatabaseName and RecordSource properties.</li>
<li>Place one or more display/edit controls (TextBox, Label, etc.) and set their DataSource to the Data control's name and DataField to a column name.</li>
<li>When the form loads, the Data control auto-refreshes: it opens the database, runs the query, and navigates to the first record.</li>
<li>Bound controls are updated automatically each time the Data control repositions (the Reposition event fires, and the runtime pushes the current record's field values into all bound controls).</li>
</ul>
<p>When a bound control loses focus (LostFocus), its current text is written back to the Data control's record cache, and Update is called automatically to persist changes.</p>
<h2>Master-Detail Binding</h2>
<p>For hierarchical data (e.g. orders and order items), use two Data controls:</p>
<ul>
<li>A master Data control bound to the parent table.</li>
</ul>
<p>A detail Data control with its MasterSource set to the master's name, MasterField set to the key column in the master, and DetailField set to the foreign key column in the detail table.</p>
<p>When the master record changes, the detail Data control automatically re-queries using the master's current value for filtering. All controls bound to the detail are refreshed.</p>
<h2>DBGrid Binding</h2>
<p>Set the DBGrid's DataSource to a Data control name. The grid auto-populates columns from the query results and refreshes whenever the Data control refreshes.</p>
<h2>Example</h2>
<pre><code>VERSION DVX 1.00
Begin Form frmData
Caption = &quot;Data Binding Example&quot;
AutoSize = False
Width = 400
Height = 280
Begin Data Data1
DatabaseName = &quot;myapp.db&quot;
RecordSource = &quot;customers&quot;
End
Begin Label lblName
Caption = &quot;Name:&quot;
End
Begin TextBox txtName
DataSource = &quot;Data1&quot;
DataField = &quot;name&quot;
End
Begin Label lblEmail
Caption = &quot;Email:&quot;
End
Begin TextBox txtEmail
DataSource = &quot;Data1&quot;
DataField = &quot;email&quot;
End
End
Sub Data1_Reposition ()
Print &quot;Current record changed&quot;
End Sub
Sub Data1_Validate (Cancel As Integer)
If txtName.Text = &quot;&quot; Then
MsgBox &quot;Name cannot be empty!&quot;
Cancel = 1
End If
End Sub</code></pre>
<p><a href="#ctrl.data">Data</a></p>
<p><a href="#ctrl.dbgrid">DBGrid</a></p>
</div>
<div class="topic" id="ctrl.menus">
<h1>Menu System</h1>
<p>Menus are defined in the .frm file using Begin Menu blocks. Each menu item has a name, caption, and nesting level. Menu items fire Click events dispatched as MenuName_Click.</p>
<h2>FRM Syntax</h2>
<pre><code>Begin Form Form1
Caption = &quot;Menu Demo&quot;
Begin Menu mnuFile
Caption = &quot;&amp;File&quot;
Begin Menu mnuOpen
Caption = &quot;&amp;Open&quot;
End
Begin Menu mnuSave
Caption = &quot;&amp;Save&quot;
End
Begin Menu mnuSep1
Caption = &quot;-&quot;
End
Begin Menu mnuExit
Caption = &quot;E&amp;xit&quot;
End
End
Begin Menu mnuEdit
Caption = &quot;&amp;Edit&quot;
Begin Menu mnuCopy
Caption = &quot;&amp;Copy&quot;
End
Begin Menu mnuPaste
Caption = &quot;&amp;Paste&quot;
End
End
End</code></pre>
<h2>Menu Item Properties</h2>
<pre> Property Type Description
-------- ------- -------------------------------------------
Caption String The text displayed. Use &amp; for accelerator key. Set to &quot;-&quot; for a separator.
Checked Boolean Whether the menu item shows a checkmark.
Enabled Boolean Whether the menu item is enabled (default True).</pre>
<h2>Nesting</h2>
<p>Menu items are nested by placing Begin Menu blocks inside other Begin Menu blocks:</p>
<ul>
<li>Level 0: top-level menu bar headers (e.g. &quot;File&quot;, &quot;Edit&quot;).</li>
<li>Level 1: items within a top-level menu.</li>
</ul>
<p>Level 2+: submenu items.</p>
<p>A level-0 menu that contains children becomes a top-level menu header. A non-level-0 menu that contains children becomes a submenu.</p>
<h2>Event Dispatch</h2>
<p>Each clickable menu item (not headers, not separators) receives a unique numeric ID at load time. When clicked, the form's onMenu handler maps the ID to the menu item's name and fires MenuName_Click.</p>
<pre><code>Sub mnuOpen_Click ()
MsgBox &quot;Open was clicked&quot;
End Sub
Sub mnuExit_Click ()
Unload Form1
End Sub</code></pre>
<p><a href="#ctrl.form">Form</a></p>
<p><a href="#ctrl.frm">FRM File Format</a></p>
</div>
<div class="topic" id="ctrl.arrays">
<h1>Control Arrays</h1>
<p>DVX BASIC supports VB-style control arrays. Multiple controls can share the same name, differentiated by an Index property. When an event fires on a control array element, the element's index is passed as the first parameter.</p>
<h2>Defining Control Arrays in FRM</h2>
<pre><code>Begin CommandButton Command1
Caption = &quot;Button A&quot;
Index = 0
End
Begin CommandButton Command1
Caption = &quot;Button B&quot;
Index = 1
End
Begin CommandButton Command1
Caption = &quot;Button C&quot;
Index = 2
End</code></pre>
<h2>Event Handler Convention</h2>
<p>When a control has an Index property (&gt;= 0), the event handler receives Index As Integer as the first parameter, before any event-specific parameters.</p>
<pre><code>Sub Command1_Click (Index As Integer)
Select Case Index
Case 0
MsgBox &quot;Button A clicked&quot;
Case 1
MsgBox &quot;Button B clicked&quot;
Case 2
MsgBox &quot;Button C clicked&quot;
End Select
End Sub</code></pre>
<h2>Accessing Array Elements in Code</h2>
<p>Use the indexed form ControlName(Index) to access a specific element:</p>
<pre><code>Command1(0).Caption = &quot;New Text&quot;
Command1(1).Enabled = False</code></pre>
<blockquote><strong>Note:</strong> Control array elements share the same event handler Sub. The runtime prepends the Index argument automatically. If you define parameters on the Sub, Index comes first, followed by the event's own parameters (e.g. KeyPress would be Sub Ctrl1_KeyPress (Index As Integer, KeyAscii As Integer)).</blockquote>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
<p><a href="#ctrl.frm">FRM File Format</a></p>
</div>
<div class="topic" id="ctrl.frm">
<h1>FRM File Format</h1>
<p>The .frm file is a text file that describes a form's layout, controls, menus, and code. It follows a format compatible with VB3 .frm files, with DVX-specific extensions.</p>
<h2>Structure</h2>
<pre><code>VERSION DVX 1.00
Begin Form FormName
form-level properties...
Begin Menu mnuFile
Caption = &quot;&amp;File&quot;
Begin Menu mnuOpen
Caption = &quot;&amp;Open&quot;
End
End
Begin TypeName ControlName
property = value
...
End
Begin Frame Frame1
Caption = &quot;Group&quot;
Begin TypeName ChildName
...
End
End
End
BASIC code follows...
Sub FormName_Load ()
...
End Sub</code></pre>
<h2>Rules</h2>
<ul>
<li>The VERSION line is optional. VERSION DVX 1.00 marks a native DVX form. VB forms with version &lt;= 2.0 are accepted for import.</li>
<li>The form block begins with Begin Form Name and ends with End.</li>
<li>Controls are nested with Begin TypeName Name / End.</li>
<li>Container controls (Frame, VBox, HBox, Toolbar, TabStrip, ScrollPane, Splitter, WrapBox) can have child controls nested inside them.</li>
<li>Properties are assigned as Key = Value. String values are optionally quoted.</li>
<li>Everything after the form's closing End is BASIC source code.</li>
<li>Comments in the form section use ' (single quote).</li>
</ul>
<p>Blank lines are ignored in the form section.</p>
<h2>Common FRM Properties</h2>
<pre> Property Applies To Description
----------------------- --------------- -------------------------------------------
Caption Form, controls Display text or window title.
Text TextBox, ComboBox Initial text content.
MinWidth / Width Controls Minimum width. Both names are accepted.
MinHeight / Height Controls Minimum height. Both names are accepted.
MaxWidth Controls Maximum width (0 = no cap).
MaxHeight Controls Maximum height (0 = no cap).
Weight Controls Layout weight for flexible sizing.
Left Form, controls X position (used by Form when Centered=False; informational for controls).
Top Form, controls Y position.
Index Controls Control array index (-1 or absent = not in array).
Visible Controls Initial visibility.
Enabled Controls Initial enabled state.
Layout Form &quot;VBox&quot; or &quot;HBox&quot;.
AutoSize Form Auto-fit window to content.
Resizable Form Allow runtime resizing.
Centered Form Center window on screen.
DatabaseName Data SQLite database file path.
RecordSource Data Table name or SQL query.
DataSource Bound controls Name of the Data control.
DataField Bound controls Column name in the recordset.</pre>
<p><a href="#ctrl.form">Form</a></p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
<p><a href="#ctrl.menus">Menu System</a></p>
<p><a href="#ctrl.arrays">Control Arrays</a></p>
</div>
<div class="topic" id="ctrl.form">
<h1>Form</h1>
<p>VB Equivalent: Form -- DVX Widget: Window + VBox/HBox root</p>
<p>The Form is the top-level container representing a DVX window. It is declared in the .frm file with Begin Form FormName. All controls are children of the form's content box, which uses either VBox (default) or HBox layout.</p>
<h2>Form Properties</h2>
<pre> Property Type Default Description
---------- ------- -------------- -------------------------------------------
Name String &quot;Form1&quot; The form's name, used for event dispatch and Load statement.
Caption String (same as Name) Window title bar text.
Width Integer 400 Window width in pixels. Setting this disables AutoSize.
Height Integer 300 Window height in pixels. Setting this disables AutoSize.
Left Integer 0 Initial X position. Used when Centered is False.
Top Integer 0 Initial Y position. Used when Centered is False.
Layout String &quot;VBox&quot; Content box layout: &quot;VBox&quot; (vertical) or &quot;HBox&quot; (horizontal).
AutoSize Boolean True When True, the window shrink-wraps to fit its content.
Resizable Boolean True Whether the user can resize the window at runtime.
Centered Boolean True When True, the window is centered on screen. When False, Left/Top are used.</pre>
<h2>Form Events</h2>
<pre> Event Parameters Description
----------- --------------------- -------------------------------------------
Load (none) Fires after the form and all controls are created. This is the default event.
Unload (none) Fires when the form is being closed or unloaded.
QueryUnload Cancel As Integer Fires before Unload. Set Cancel = 1 to abort the close.
Resize (none) Fires when the window is resized by the user.
Activate (none) Fires when the window gains focus.
Deactivate (none) Fires when the window loses focus.</pre>
<h2>Form Methods</h2>
<pre> Statement Description
------------------ -------------------------------------------
Load FormName Load the form (creates the window and controls, fires Load event).
Unload FormName Unload the form (fires Unload, destroys window).
FormName.Show Make the form visible.
FormName.Show 1 Show as modal dialog (blocks until closed).
FormName.Hide Hide the form without unloading it.</pre>
<h2>Example</h2>
<pre><code>Sub Form_Load ()
Form1.Caption = &quot;Hello World&quot;
Print &quot;Form loaded!&quot;
End Sub
Sub Form_QueryUnload (Cancel As Integer)
If MsgBox(&quot;Really quit?&quot;, 4) &lt;&gt; 6 Then
Cancel = 1
End If
End Sub
Sub Form_Resize ()
Print &quot;Window resized&quot;
End Sub</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
<p><a href="#ctrl.frm">FRM File Format</a></p>
</div>
<div class="topic" id="ctrl.terminal">
<h1>Terminal</h1>
<p>DVX Extension -- DVX Widget: ansiterm (ANSI terminal emulator)</p>
<p>A VT100/ANSI terminal emulator widget. Supports ANSI escape sequences, scrollback buffer, and serial communication. Default size is 80 columns by 25 rows.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
---------- ------- -------------------------------------------
Cols Integer Number of character columns (read-only).
Rows Integer Number of character rows (read-only).
Scrollback Integer Number of scrollback lines (write-only).</pre>
<h2>Type-Specific Methods</h2>
<pre> Method Description
------ -----------
Clear Clear the terminal screen.
Poll Process pending comm data and update the display.
Write text$ Write text (with ANSI escape processing) to the terminal.</pre>
<p>No default event.</p>
<h2>Serial Communication</h2>
<p>Use the comm.bas library to connect a Terminal to a serial link:</p>
<pre><code>Dim link As Integer
link = CommOpen(1, 115200)
CommHandshake link
CommAttach link, &quot;Terminal1&quot;</code></pre>
<p>See comm.bas for the full communications API.</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.frame">
<h1>Frame</h1>
<p>VB Equivalent: Frame -- DVX Widget: frame (titled VBox container)</p>
<p>A container with a titled border. Child controls are placed inside the frame using VBox layout. In the .frm file, nest Begin/End blocks inside the Frame block.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
-------- ------ -------------------------------------------
Caption String The title displayed in the frame border.</pre>
<p>Container: Yes</p>
<p>Default Event: Click</p>
<h2>Example</h2>
<pre><code>Begin Frame Frame1
Caption = &quot;Options&quot;
Begin CheckBox Check1
Caption = &quot;Option A&quot;
End
Begin CheckBox Check2
Caption = &quot;Option B&quot;
End
End</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.hbox">
<h1>HBox</h1>
<p>DVX Extension -- DVX Widget: hbox (horizontal layout container)</p>
<p>A container that arranges its children horizontally, left to right. Use Weight on children to distribute extra space.</p>
<p>Container: Yes</p>
<p>Default Event: Click</p>
<p>No type-specific properties.</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
<p><a href="#ctrl.vbox">VBox</a></p>
</div>
<div class="topic" id="ctrl.vbox">
<h1>VBox</h1>
<p>DVX Extension -- DVX Widget: vbox (vertical layout container)</p>
<p>A container that arranges its children vertically, top to bottom. No title or border. Use Weight on children to distribute extra space.</p>
<p>Container: Yes</p>
<p>Default Event: Click</p>
<p>No type-specific properties.</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
<p><a href="#ctrl.hbox">HBox</a></p>
</div>
<div class="topic" id="ctrl.button">
<h1>CommandButton</h1>
<p>VB Equivalent: CommandButton -- DVX Widget: button | Name Prefix: Command</p>
<p>A push button that triggers an action when clicked. Created with wgtButton(parent, text).</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
-------- ------ -------------------------------------------
Caption String The text displayed on the button. Use &amp; for accelerator keys (e.g. &quot;&amp;OK&quot;).</pre>
<p>No additional type-specific properties beyond common properties and Caption.</p>
<p>Default Event: Click</p>
<h2>Example</h2>
<pre><code>Begin Form Form1
Caption = &quot;Button Demo&quot;
Begin CommandButton Command1
Caption = &quot;&amp;Click Me!&quot;
End
End
Sub Command1_Click ()
MsgBox &quot;Button was clicked!&quot;
End Sub</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.picturebox">
<h1>PictureBox</h1>
<p>VB Equivalent: PictureBox -- DVX Widget: canvas | Name Prefix: Picture</p>
<p>A drawing surface (canvas). Supports drawing lines, rectangles, circles, text, and individual pixels. Can save and load BMP images. The default canvas size is 64x64 pixels.</p>
<p>Colors are specified as 0x00RRGGBB integers (e.g. &amp;HFF0000 for red).</p>
<h2>Type-Specific Methods</h2>
<pre> Method Description
------ -----------
Clear color% Fill the entire canvas with the specified color.
DrawLine x0%, y0%, x1%, y1%, color% Draw a line between two points.
DrawRect x%, y%, w%, h%, color% Draw a rectangle outline.
DrawText x%, y%, text$ Draw text at the given position.
FillCircle cx%, cy%, radius%, color% Draw a filled circle.
FillRect x%, y%, w%, h%, color% Draw a filled rectangle.
GetPixel(x%, y%) Returns the color at a pixel.
Load path$ Load a BMP image onto the canvas.
Resize w%, h% Resize the canvas to new dimensions.
Save path$ Save the canvas as a BMP file.
SetPenColor color% Set the drawing color for subsequent operations.
SetPenSize size% Set the pen/brush size in pixels.
SetPixel x%, y%, color% Set the color of a single pixel.</pre>
<p>Default Event: Click</p>
<h2>Example</h2>
<pre><code>Picture1.Resize 200, 150
Picture1.Clear &amp;HFFFFFF
Picture1.SetPenSize 2
Picture1.DrawRect 10, 10, 180, 130, &amp;H000000
Picture1.FillCircle 100, 75, 40, &amp;HFF0000
Picture1.DrawText 60, 130, &quot;Hello!&quot;
Picture1.Save &quot;output.bmp&quot;</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.checkbox">
<h1>CheckBox</h1>
<p>VB Equivalent: CheckBox -- DVX Widget: checkbox</p>
<p>A toggle control with a label. Checked state is exposed as a Boolean.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
-------- ------- -------------------------------------------
Caption String The text displayed next to the checkbox.
Value Boolean True if checked, False if unchecked.</pre>
<p>Default Event: Click</p>
<h2>Example</h2>
<pre><code>Begin CheckBox Check1
Caption = &quot;Enable feature&quot;
End
Sub Check1_Click ()
If Check1.Value Then
Label1.Caption = &quot;Feature ON&quot;
Else
Label1.Caption = &quot;Feature OFF&quot;
End If
End Sub</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.combobox">
<h1>ComboBox</h1>
<p>VB Equivalent: ComboBox -- DVX Widget: combobox (editable text field + drop-down list, max 256 chars)</p>
<p>A combination of a text input and a drop-down list. The user can type text or select from the list. Supports the same AddItem/RemoveItem/Clear/List methods as ListBox.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
--------- ------- -------------------------------------------
Text String The text in the editable field.
ListIndex Integer Index of the currently selected list item (-1 = none).
ListCount Integer Number of items in the drop-down list (read-only).</pre>
<h2>Type-Specific Methods</h2>
<p>Same as ListBox: AddItem, RemoveItem, Clear, List.</p>
<p><a href="#ctrl.listbox">See ListBox for details</a></p>
<p>Default Event: Click</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.data">
<h1>Data</h1>
<p>VB Equivalent: Data -- DVX Widget: data (database record navigator)</p>
<p>A data access control that connects to a SQLite database and provides record navigation. Other controls can bind to a Data control via their DataSource and DataField properties.</p>
<p><a href="#ctrl.databinding">See Data Binding for details</a></p>
<h2>Type-Specific Properties</h2>
<pre> Property Type R/W Description
------------ ------- --- -------------------------------------------
DatabaseName String R/W Path to the SQLite database file.
RecordSource String R/W Table name or SQL SELECT query for the recordset.
KeyColumn String R/W Primary key column name (used for UPDATE/DELETE operations).
Caption String R/W Text displayed on the navigator bar.
BOF Boolean R True if the current position is before the first record (read-only).
EOF Boolean R True if the current position is past the last record (read-only).
MasterSource String R/W Name of a master Data control (for master-detail binding).
MasterField String R/W Column in the master recordset to filter by.
DetailField String R/W Column in this recordset that matches the master field.</pre>
<h2>Type-Specific Methods</h2>
<pre> Method Parameters Description
------------ ---------- -------------------------------------------
MoveFirst (none) Navigate to the first record.
MoveLast (none) Navigate to the last record.
MoveNext (none) Navigate to the next record.
MovePrevious (none) Navigate to the previous record.
AddNew (none) Add a new blank record.
Delete (none) Delete the current record.
Refresh (none) Re-query the database and reload records.
Update (none) Write pending changes to the database.</pre>
<h2>Type-Specific Events</h2>
<pre> Event Parameters Description
---------- ----------------- -------------------------------------------
Reposition (none) Fires after the current record changes (navigation). This is the default event.
Validate Cancel As Integer Fires before writing a record. Set Cancel = 1 to abort.</pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
<p><a href="#ctrl.databinding">Data Binding</a></p>
<p><a href="#ctrl.dbgrid">DBGrid</a></p>
</div>
<div class="topic" id="ctrl.dbgrid">
<h1>DBGrid</h1>
<p>VB Equivalent: DBGrid -- DVX Widget: dbgrid</p>
<p>A data-bound grid that displays records from a Data control in a tabular format. Columns are auto-generated from the query results. Bind it using the DataSource property.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
---------- ------- -------------------------------------------
DataSource String Name of the Data control that supplies records.
GridLines Boolean Show or hide grid lines between cells.</pre>
<h2>Type-Specific Methods</h2>
<pre> Method Parameters Description
------- ---------- -------------------------------------------
Refresh (none) Reload and redraw the grid from the Data control.</pre>
<h2>Type-Specific Events</h2>
<pre> Event Parameters Description
-------- ---------- -------------------------------------------
Click (none) Fires when a cell is clicked.
DblClick (none) Fires when a cell is double-clicked. This is the default event.</pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
<p><a href="#ctrl.data">Data</a></p>
<p><a href="#ctrl.databinding">Data Binding</a></p>
</div>
<div class="topic" id="ctrl.dropdown">
<h1>DropDown</h1>
<p>DVX Extension -- DVX Widget: dropdown (non-editable drop-down list)</p>
<p>A read-only drop-down list. Unlike ComboBox, the user cannot type free text; they can only select from the provided items. Supports AddItem/RemoveItem/Clear/List.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
--------- ------- -------------------------------------------
ListIndex Integer Index of the currently selected item.
ListCount Integer Number of items (read-only).</pre>
<h2>Type-Specific Methods</h2>
<p>Same as ListBox: AddItem, RemoveItem, Clear, List.</p>
<p><a href="#ctrl.listbox">See ListBox for details</a></p>
<p>Default Event: Click</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.imagebutton">
<h1>ImageButton</h1>
<p>DVX Extension -- DVX Widget: imagebutton</p>
<p>A button that displays an image instead of text. Like Image, it requires pixel data at creation time and is typically loaded via the Picture property.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
----------- ------- -------------------------------------------
Picture String Path to a BMP file to load (write-only).
ImageWidth Integer Width of the loaded image in pixels (read-only).
ImageHeight Integer Height of the loaded image in pixels (read-only).</pre>
<p>Default Event: Click</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.image">
<h1>Image</h1>
<p>VB Equivalent: Image -- DVX Widget: image</p>
<p>A static image display control. Loads BMP images from file. Cannot be placed via the designer toolbox (requires pixel data at creation time); typically created in code or loaded via the Picture property.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
----------- ------- -------------------------------------------
Picture String Path to a BMP file to load (write-only).
ImageWidth Integer Width of the loaded image in pixels (read-only).
ImageHeight Integer Height of the loaded image in pixels (read-only).</pre>
<p>Default Event: Click</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.label">
<h1>Label</h1>
<p>VB Equivalent: Label -- DVX Widget: label</p>
<p>A static text label. Supports left, center, and right alignment.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
--------- ---- -------------------------------------------
Caption String The text displayed by the label.
Alignment Enum Text alignment: Left (default), Center, or Right.</pre>
<p>Default Event: Click</p>
<h2>Example</h2>
<pre><code>Begin Label Label1
Caption = &quot;Hello, World!&quot;
Alignment = &quot;Center&quot;
End</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.listbox">
<h1>ListBox</h1>
<p>VB Equivalent: ListBox -- DVX Widget: listbox</p>
<p>A scrollable list of selectable items. Items are managed via methods (AddItem, RemoveItem, Clear). Supports single and multi-select modes.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
--------- ------- -------------------------------------------
ListIndex Integer Index of the currently selected item (-1 = no selection).
ListCount Integer Number of items in the list (read-only).</pre>
<h2>Type-Specific Methods</h2>
<pre> Method Parameters Description
--------------- --------------------------------------- -------------------------------------------
AddItem Text As String Add an item to the end of the list.
RemoveItem Index As Integer Remove the item at the given index.
Clear (none) Remove all items from the list.
List Index As Integer Return the text of the item at the given index.
SelectAll (none) Select all items (multi-select mode).
ClearSelection (none) Deselect all items.
SetMultiSelect Multi As Boolean Enable or disable multi-select mode.
SetReorderable Reorderable As Boolean Enable or disable drag-to-reorder.
IsItemSelected Index As Integer Returns True if the item at Index is selected.
SetItemSelected Index As Integer, Selected As Boolean Select or deselect a specific item.
SetItems Items As String Bulk-load items from a pipe-delimited string (e.g. &quot;Red|Green|Blue&quot;).</pre>
<p>Default Event: Click</p>
<h2>Example</h2>
<pre><code>Sub Form_Load ()
List1.AddItem &quot;Apple&quot;
List1.AddItem &quot;Banana&quot;
List1.AddItem &quot;Cherry&quot;
End Sub
Sub List1_Click ()
Dim idx As Integer
idx = List1.ListIndex
If idx &gt;= 0 Then
Label1.Caption = &quot;Selected: &quot; &amp; List1.List(idx)
End If
End Sub</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
<p><a href="#ctrl.combobox">ComboBox</a></p>
<p><a href="#ctrl.dropdown">DropDown</a></p>
</div>
<div class="topic" id="ctrl.listview">
<h1>ListView</h1>
<p>VB Equivalent: ListView -- DVX Widget: listview</p>
<p>A multi-column list with column headers. Supports sorting, multi-select, and drag-to-reorder.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type R/W Description
--------- ------- --- -------------------------------------------
ListIndex Integer R/W Index of the currently selected row (-1 = none).</pre>
<h2>Type-Specific Methods</h2>
<pre> Method Description
------ -----------
AddItem text$ Add a row (sets first column text).
Clear Remove all rows.
ClearSelection Deselect all rows.
GetCell$(row%, col%) Returns the text of a cell.
IsItemSelected(index%) Returns True if the row is selected.
RemoveItem index% Remove a row by index.
RowCount() Returns the number of rows.
SelectAll Select all rows.
SetCell row%, col%, text$ Set the text of a cell.
SetColumns spec$ Define columns. Pipe-delimited &quot;Name,Width|Name,Width&quot; (width in characters).
SetItemSelected index%, selected Select or deselect a row.
SetMultiSelect multi Enable or disable multi-select.
SetReorderable reorderable Enable or disable row reordering.
SetSort col%, dir% Sort by column. dir: 0=none, 1=ascending, 2=descending.</pre>
<p>Default Event: Click</p>
<h2>Example</h2>
<pre><code>ListView1.SetColumns &quot;Name,20|Size,10|Type,15&quot;
ListView1.AddItem &quot;readme.txt&quot;
ListView1.SetCell 0, 1, &quot;1024&quot;
ListView1.SetCell 0, 2, &quot;Text&quot;
ListView1.SetSort 0, 1</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.progressbar">
<h1>ProgressBar</h1>
<p>VB Equivalent: ProgressBar -- DVX Widget: progressbar</p>
<p>A horizontal progress indicator bar.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
-------- ------- -------------------------------------------
Value Integer Current progress value (0-100).</pre>
<p>No type-specific events or methods. No default event.</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.optionbutton">
<h1>OptionButton</h1>
<p>VB Equivalent: OptionButton -- DVX Widget: radio (radio group + radio button) | Name Prefix: Option</p>
<p>A radio button for mutually exclusive choices. DVX uses a radio group container; individual OptionButtons are children of the group. The Value property returns the button's index within its group.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
-------- ------- -------------------------------------------
Caption String The text displayed next to the radio button.
Value Integer The index of this radio button within its group (read-only).</pre>
<h2>Type-Specific Methods</h2>
<pre> Method Parameters Description
----------- ----------------- -------------------------------------------
SetSelected Index As Integer Select the radio button at the given index within the group.</pre>
<p>Default Event: Click</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.scrollpane">
<h1>ScrollPane</h1>
<p>DVX Extension -- DVX Widget: scrollpane | Name Prefix: Scroll</p>
<p>A scrollable container. Place child controls inside and the ScrollPane automatically provides scrollbars when the content exceeds the visible area.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
-------- ------- -------------------------------------------
NoBorder Boolean When True, suppresses the border around the scroll pane.</pre>
<p>Container: Yes</p>
<p>No default event.</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.line">
<h1>Line</h1>
<p>VB Equivalent: Line -- DVX Widget: separator</p>
<p>A visual separator line. The underlying widget supports both horizontal and vertical orientations. The default (via BASIC) is horizontal.</p>
<p>No type-specific properties, events, or methods.</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.hscrollbar">
<h1>HScrollBar</h1>
<p>VB Equivalent: HScrollBar -- DVX Widget: slider | Name Prefix: HScroll</p>
<p>A horizontal slider/scrollbar control. The value ranges between a minimum and maximum set at creation time (default 0 to 100).</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
-------- ------- -------------------------------------------
Value Integer The current slider position (clamped to min/max range).</pre>
<p>Default Event: Change</p>
<h2>Example</h2>
<pre><code>Begin HScrollBar HScroll1
MinWidth = 200
End
Sub HScroll1_Change ()
Label1.Caption = &quot;Value: &quot; &amp; Str$(HScroll1.Value)
End Sub</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.spacer">
<h1>Spacer</h1>
<p>DVX Extension -- DVX Widget: spacer</p>
<p>An invisible layout spacer. Takes up space in the layout without rendering anything. Useful for pushing controls apart. Give it a Weight to absorb extra space.</p>
<p>No type-specific properties, events, or methods.</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.spinbutton">
<h1>SpinButton</h1>
<p>DVX Extension -- DVX Widget: spinner | Name Prefix: Spin</p>
<p>A numeric input with up/down buttons. Supports integer mode (default) and real-number mode with configurable decimal places.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
-------- ------- -------------------------------------------
Value Integer Current integer value (in integer mode).
RealMode Boolean True to use floating-point mode; False for integer mode.
Decimals Integer Number of decimal places shown in real mode.</pre>
<h2>Type-Specific Methods</h2>
<pre> Method Parameters Description
-------- ------------------------------ -------------------------------------------
SetRange Min As Integer, Max As Integer Set the allowed value range.
SetStep Step As Integer Set the increment per button click.</pre>
<p>Default Event: Change</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.splitter">
<h1>Splitter</h1>
<p>DVX Extension -- DVX Widget: splitter</p>
<p>A resizable split pane. Holds exactly two child widgets separated by a draggable divider. Default orientation is vertical (top/bottom split).</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
-------- ------- -------------------------------------------
Position Integer Position of the divider in pixels from the top (or left).</pre>
<p>Container: Yes</p>
<p>No default event.</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.statusbar">
<h1>StatusBar</h1>
<p>VB Equivalent: StatusBar -- DVX Widget: statusbar</p>
<p>A horizontal container styled as a status bar, typically placed at the bottom of a form. At the C API level it accepts child widgets, but it is not registered as a container in the form runtime, so child controls cannot be nested inside it in .frm files. Set its Caption property to display status text.</p>
<p>No type-specific properties, events, or methods.</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.tabstrip">
<h1>TabStrip</h1>
<p>VB Equivalent: TabStrip -- DVX Widget: tabcontrol</p>
<p>A tabbed container. Each tab page is a separate container that holds child controls. Switching tabs shows one page and hides others.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
-------- ------- -------------------------------------------
TabIndex Integer Index of the active tab (0-based). Note: this property name collides with the common VB-compatibility TabIndex property, which shadows it at runtime. Use the SetActive method instead to switch tabs.</pre>
<h2>Type-Specific Methods</h2>
<pre> Method Description
------ -----------
AddPage title$ Add a new tab page with the given title.
GetActive() Returns the index of the active tab.
SetActive index% Switch to the tab at the given index. This is the recommended way to change tabs at runtime (the TabIndex property is shadowed by the common property handler).</pre>
<p>Container: Yes</p>
<p>Default Event: Click</p>
<blockquote><strong>Warning:</strong> The TabIndex property is shadowed by the common property handler at runtime. Use the SetActive method to change tabs programmatically.</blockquote>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.textbox">
<h1>TextBox</h1>
<p>VB Equivalent: TextBox -- DVX Widget: textbox (single-line text input, max 256 chars)</p>
<p>A single-line text input field. Supports data binding via DataSource and DataField properties.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
---------- ------ -------------------------------------------
Text String The text content of the input field.
DataSource String Name of a Data control for data binding.
DataField String Column name for data binding.</pre>
<p>Default Event: Change</p>
<h2>Example</h2>
<pre><code>Begin TextBox Text1
Text = &quot;Enter text here&quot;
End
Sub Text1_Change ()
Label1.Caption = &quot;You typed: &quot; &amp; Text1.Text
End Sub</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
<p><a href="#ctrl.databinding">Data Binding</a></p>
</div>
<div class="topic" id="ctrl.textarea">
<h1>TextArea</h1>
<p>VB Equivalent: TextArea (DVX extension) -- DVX Widget: textarea (multi-line text input, max 4096 chars)</p>
<p>A multi-line text editing area. This is a DVX extension with no direct VB3 equivalent (VB uses a TextBox with MultiLine=True). Supports line numbers, auto-indent, find/replace, and tab configuration.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type R/W Description
---------- ------- --- -------------------------------------------
Text String R/W The full text content.
CursorLine Integer R Current cursor line number (0-based).</pre>
<h2>Type-Specific Methods</h2>
<pre> Method Description
------ -----------
FindNext needle$, caseSensitive, forward Search for text. Returns True if found.
GetWordAtCursor() Returns the word under the cursor.
GoToLine line% Scroll to and position cursor at the given line.
ReplaceAll needle$, replacement$, caseSensitive Replace all occurrences. Returns count of replacements.
SetAutoIndent enabled Enable or disable automatic indentation.
SetCaptureTabs enabled When True, Tab key inserts a tab/spaces instead of moving focus.
SetShowLineNumbers show Show or hide the line number gutter.
SetSyntaxMode mode$ Activate built-in syntax highlighting. Modes: &quot;dhs&quot; (help source), &quot;bas&quot; (BASIC). Pass &quot;&quot; to disable.
SetTabWidth width% Set the tab stop width in characters.
SetUseTabChar useChar When True, Tab inserts a tab character; when False, inserts spaces.</pre>
<p>Default Event: Change</p>
<h2>Example</h2>
<pre><code>TextArea1.SetShowLineNumbers True
TextArea1.SetAutoIndent True
TextArea1.SetTabWidth 4
TextArea1.SetCaptureTabs True
' Search for text
If TextArea1.FindNext(&quot;TODO&quot;, False, True) Then
Print &quot;Found at line&quot;; TextArea1.CursorLine
End If
' Replace all occurrences
Dim count As Integer
count = TextArea1.ReplaceAll(&quot;old&quot;, &quot;new&quot;, False)
Print &quot;Replaced&quot;; count; &quot;occurrences&quot;</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.timer">
<h1>Timer</h1>
<p>VB Equivalent: Timer -- DVX Widget: timer (non-visual)</p>
<p>A non-visual control that fires its event at a regular interval. The Timer widget is invisible at runtime -- it has no on-screen representation.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
-------- ------- -------------------------------------------
Enabled Boolean True to start the timer, False to stop it.
Interval Integer Timer interval in milliseconds (write-only from BASIC).</pre>
<h2>Type-Specific Methods</h2>
<pre> Method Parameters Description
------ ---------- -------------------------------------------
Start (none) Start the timer.
Stop (none) Stop the timer.</pre>
<h2>Type-Specific Events</h2>
<pre> Event Parameters Description
----- ---------- -------------------------------------------
Timer (none) Fires each time the interval elapses. This is the default event.</pre>
<blockquote><strong>Note:</strong> The Timer control fires the Timer event instead of Change. The onChange callback on the underlying widget is remapped automatically.</blockquote>
<h2>Example</h2>
<pre><code>Begin Timer Timer1
Interval = 1000
Enabled = True
End
Dim counter As Integer
Sub Timer1_Timer ()
counter = counter + 1
Label1.Caption = &quot;Ticks: &quot; &amp; Str$(counter)
End Sub</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.toolbar">
<h1>Toolbar</h1>
<p>VB Equivalent: Toolbar -- DVX Widget: toolbar</p>
<p>A horizontal container styled as a toolbar, with compact padding and spacing. Place buttons, labels, or other controls inside.</p>
<p>Container: Yes</p>
<p>No type-specific properties, events, or methods.</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.treeview">
<h1>TreeView</h1>
<p>VB Equivalent: TreeView -- DVX Widget: treeview</p>
<p>A hierarchical tree of expandable/collapsible nodes. Supports multi-select and drag-to-reorder. Items are accessed by depth-first index (0-based).</p>
<h2>Type-Specific Methods</h2>
<pre> Method Description
------ -----------
AddChildItem parentIndex%, text$ Add a child node under the node at the given index.
AddItem text$ Add a root-level node.
Clear Remove all nodes.
GetItemText$(index%) Returns the text of the node at the given index.
IsExpanded(index%) Returns True if the node at the given index is expanded.
IsItemSelected(index%) Returns True if the node at the given index is selected.
ItemCount() Returns the total number of nodes (all levels).
SetExpanded index%, expanded Expand or collapse the node at the given index.
SetItemSelected index%, selected Select or deselect the node at the given index.
SetMultiSelect multi Enable or disable multi-select mode.
SetReorderable reorderable Enable or disable node reordering.</pre>
<p>Default Event: Click</p>
<h2>Example</h2>
<pre><code>TreeView1.AddItem &quot;Animals&quot;
TreeView1.AddChildItem 0, &quot;Cat&quot;
TreeView1.AddChildItem 0, &quot;Dog&quot;
TreeView1.AddItem &quot;Plants&quot;
TreeView1.AddChildItem 3, &quot;Oak&quot;
TreeView1.SetExpanded 0, True
Print &quot;Items:&quot;; TreeView1.ItemCount()</code></pre>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
<div class="topic" id="ctrl.wrapbox">
<h1>WrapBox</h1>
<p>DVX Extension -- DVX Widget: wrapbox</p>
<p>A container that arranges children in a flowing layout, wrapping to the next row when the available width is exceeded. Similar to CSS flexbox with flex-wrap: wrap.</p>
<h2>Type-Specific Properties</h2>
<pre> Property Type Description
--------- ---- -------------------------------------------
Alignment Enum Horizontal alignment of items: Left, Center, or Right.</pre>
<p>Container: Yes</p>
<p>Default Event: Click</p>
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
</div>
</main>
</body>
</html>