3303 lines
168 KiB
HTML
3303 lines
168 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.filesystem">File System Statements</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>
|
|
<li><a href="#lang.runtime">Include Libraries</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.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">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.filesystem">KILL</a></li>
|
|
<li><a href="#lang.filesystem">NAME</a></li>
|
|
<li><a href="#lang.filesystem">FILECOPY</a></li>
|
|
<li><a href="#lang.filesystem">MKDIR</a></li>
|
|
<li><a href="#lang.filesystem">RMDIR</a></li>
|
|
<li><a href="#lang.filesystem">CHDIR</a></li>
|
|
<li><a href="#lang.filesystem">CHDRIVE</a></li>
|
|
<li><a href="#lang.filesystem">GETATTR</a></li>
|
|
<li><a href="#lang.filesystem">SETATTR</a></li>
|
|
<li><a href="#lang.filesystem">File Attributes</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">Nothing</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">CreateForm</a></li>
|
|
<li><a href="#lang.forms">CreateControl</a></li>
|
|
<li><a href="#lang.forms">SetEvent</a></li>
|
|
<li><a href="#lang.forms">RemoveControl</a></li>
|
|
<li><a href="#lang.forms">With</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">vbNormal</a></li>
|
|
<li><a href="#lang.constants">vbReadOnly</a></li>
|
|
<li><a href="#lang.constants">vbHidden</a></li>
|
|
<li><a href="#lang.constants">vbSystem</a></li>
|
|
<li><a href="#lang.constants">vbDirectory</a></li>
|
|
<li><a href="#lang.constants">vbArchive</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="#lang.runtime">Include Libraries</a></li>
|
|
<li><a href="#lang.runtime">commdlg.bas</a></li>
|
|
<li><a href="#lang.runtime">sql.bas</a></li>
|
|
<li><a href="#lang.runtime">comm.bas</a></li>
|
|
<li><a href="#lang.runtime">resource.bas</a></li>
|
|
<li><a href="#lang.runtime">help.bas</a></li>
|
|
<li><a href="#lang.runtime">DECLARE LIBRARY</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.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 DVX. It provides a VB3-style integrated development environment with a code editor, form designer, project system, and a full interactive debugger -- all integrated into DVX itself.</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. Programs execute in cooperative slices, yielding to DVX between slices so the GUI remains responsive. Call DoEvents in long-running loops to keep the event loop flowing.</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.
|
|
---
|
|
Make Executable... Compile the project and save it as a standalone .app file. Prompts for a debug or release build.
|
|
---
|
|
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.
|
|
---
|
|
Output Window to Log Checkbox: when enabled, PRINT output is also mirrored to the DVX log. Persisted in preferences.
|
|
---
|
|
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 Shortcut Description
|
|
--------- -------- -----------
|
|
DVX BASIC Help F1 Open the DVX BASIC help (language reference, IDE guide, and control reference).
|
|
DVX API Reference Open the DVX developer API reference.
|
|
---
|
|
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 > 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. Seven categories are highlighted in distinct colors; the colors themselves are editable in Tools > Preferences > Colors.</p>
|
|
<pre> Category Examples
|
|
-------- --------
|
|
Default Text Identifiers, whitespace.
|
|
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.
|
|
Types INTEGER, LONG, SINGLE, DOUBLE, STRING, BOOLEAN, TRUE, FALSE
|
|
Strings "Hello, World!"
|
|
Comments ' This is a comment, REM This is a comment
|
|
Numbers 42, 3.14, &HFF
|
|
Operators =, <, >, +, -, *, /, \, &</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 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 of all .bas and .frm files in the project. Each entry tracks whether it is a form file.</p>
|
|
<h2>How Projects are Compiled</h2>
|
|
<p>When the project is compiled, all source files are concatenated into a single source stream. The IDE tracks which lines belong to which file so error messages and debugger locations point to the correct .bas or .frm file. The code section of each .frm file is preceded by a hidden BEGINFORM marker that ties its code to its form.</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 > Code and View > 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 > 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 > Toolbox) is a floating palette of buttons, one for each available control type. Every widget registered with DVX that has a BASIC name 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 has three states:</p>
|
|
<pre> State Description
|
|
----- -----------
|
|
Idle No program loaded or running.
|
|
Running The program is executing.
|
|
Paused Execution is paused at a breakpoint or step point. The IDE is fully interactive -- you can inspect and change variables, set or clear breakpoints, step, continue, or stop.</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 file it belongs to, the line number within that file, and the procedure name (Object.Event). Breakpoints are stored in the project and survive compilation.</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>Debug Run Behavior</h2>
|
|
<p>When a program is running under the debugger:</p>
|
|
<ul>
|
|
<li>The program runs in short cooperative slices so the IDE remains responsive.</li>
|
|
<li>When the program hits a breakpoint, execution pauses immediately. The IDE switches to Code View, navigates to the breakpoint line, highlights it in yellow, and opens the Locals and Call Stack windows if they are not already visible.</li>
|
|
<li>While paused, you can inspect variables in Locals and Watch, evaluate expressions in the Immediate window, assign new values to variables, toggle breakpoints, step, continue, or stop.</li>
|
|
</ul>
|
|
<p>Resuming (F5, Shift+F5, or any Step command) returns the program to Running state.</p>
|
|
<h2>Stopping</h2>
|
|
<p>Press Esc or click the Stop toolbar button at any time to halt execution. The program is terminated, the debugger returns to Idle, and the IDE restores any designer or code windows that were hidden at the start of the run.</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 <error> 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 program's state. Expressions like count or name$ & " test" 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$ = "test"</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 running program's variable (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 > 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 > Preferences. Settings are saved to dvxbasic.ini in the app's config directory. The dialog has two tabs.</p>
|
|
<h2>General Tab</h2>
|
|
<h3>Editor Section</h3>
|
|
<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, newly created projects have OPTION EXPLICIT on by default. Off
|
|
Tab width Number of spaces per tab stop. 3
|
|
Insert spaces instead of tabs When enabled, pressing Tab inserts spaces. When disabled, inserts a real tab character. On</pre>
|
|
<h3>New Project Defaults Section</h3>
|
|
<p>These fields set the default values for new project metadata:</p>
|
|
<pre> Field Description Default
|
|
----- ----------- -------
|
|
Author Default author name. (empty)
|
|
Publisher Default publisher/company name. (empty)
|
|
Version Default version string. 1.0
|
|
Copyright Default copyright notice. (empty)
|
|
Description Default project description (multi-line). (empty)</pre>
|
|
<h2>Colors Tab</h2>
|
|
<p>Customizes the syntax-highlighting colors used in the code editor. The left side is a list of seven color entries (Default Text, Keywords, Strings, Comments, Numbers, Operators, Types). Select an entry and adjust its red, green, and blue components using the three sliders on the right. The Preview swatch shows the current color. Changes are applied to the open editor when you click OK.</p>
|
|
<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
|
|
F1 DVX BASIC Help
|
|
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 & -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& = 100000 ' Long
|
|
rate! = 3.14 ' Single
|
|
pi# = 3.14159265 ' Double
|
|
name$ = "Hello" ' String</code></pre>
|
|
<h2>Numeric Literals</h2>
|
|
<pre> Form Example Description
|
|
---- ------- -----------
|
|
Decimal integer 42 Values -32768..32767 are Integer; larger are Long
|
|
Hex integer &HFF, &H1234 Hexadecimal literal
|
|
Integer suffix 42% Force Integer type
|
|
Long suffix 42&, &HFF& Force Long type
|
|
Floating-point 3.14, 1.5E10, 2.5D3 Any number containing a decimal point or exponent is Double by default
|
|
Single suffix 3.14! Force Single type
|
|
Double suffix 3.14# Force Double type</pre>
|
|
<blockquote><strong>Note:</strong> Both E and D can introduce an exponent (e.g. 1.5E10 and 2.5D3 are equivalent forms of a scientific-notation double).</blockquote>
|
|
<h2>Type Promotion</h2>
|
|
<p>When mixing types in expressions, values are automatically promoted to a common type: Integer -> Long -> Single -> Double. Strings are not automatically converted to numbers (use VAL and STR$).</p>
|
|
<h2>Boolean Values</h2>
|
|
<p>Boolean values use -1 for True and 0 for False. Any non-zero numeric value is treated as True in a conditional context. The keywords True and False are reserved and may be used anywhere a Boolean value is expected.</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). Parentheses override precedence and may be nested freely.</p>
|
|
<pre> Precedence Operator Description
|
|
---------- -------- -----------
|
|
1 (highest) ^ Exponentiation
|
|
2 - (unary), + (unary) Negation (unary plus is a no-op)
|
|
3 * / \ MOD Multiply, float divide, integer divide, modulus
|
|
4 + - Addition, subtraction (+ also concatenates strings)
|
|
5 & String concatenation
|
|
6 = <> < > <= >= Comparison (returns Boolean)
|
|
7 NOT Logical/bitwise NOT
|
|
8 AND Logical/bitwise AND
|
|
9 XOR Logical/bitwise exclusive-or
|
|
10 OR Logical/bitwise OR
|
|
11 EQV Logical/bitwise equivalence
|
|
12 (lowest) IMP Logical/bitwise implication</pre>
|
|
<h2>Arithmetic Operators</h2>
|
|
<pre> Operator Description
|
|
-------- -----------
|
|
+ Addition (or string concatenation when both operands are strings)
|
|
- Subtraction (or negation when used as a unary prefix)
|
|
* Multiplication
|
|
/ Floating-point division (result is always Single or Double)
|
|
\ Integer division (result is Long, fractional part discarded)
|
|
MOD Integer modulus (remainder)
|
|
^ Exponentiation (result is Double)</pre>
|
|
<h2>Comparison Operators</h2>
|
|
<p>Comparison operators return True (-1) or False (0).</p>
|
|
<pre> Operator Description
|
|
-------- -----------
|
|
= Equal to
|
|
<> Not equal to
|
|
< Less than
|
|
> Greater than
|
|
<= Less than or equal to
|
|
>= Greater than or equal to</pre>
|
|
<p>String comparisons are controlled by OPTION COMPARE. With OPTION COMPARE BINARY (the default) strings are compared by byte value. With OPTION COMPARE TEXT comparisons are case-insensitive.</p>
|
|
<h2>Logical / Bitwise Operators</h2>
|
|
<p>The logical operators work on Boolean values and also perform bitwise operations on integer values.</p>
|
|
<pre> Operator Description
|
|
-------- -----------
|
|
NOT Logical/bitwise complement
|
|
AND Logical/bitwise AND
|
|
OR Logical/bitwise OR
|
|
XOR Logical/bitwise exclusive-or
|
|
EQV Logical/bitwise equivalence (same as NOT (a XOR b))
|
|
IMP Logical/bitwise implication (same as (NOT a) OR b)</pre>
|
|
<h2>String Concatenation</h2>
|
|
<p>Use & to concatenate strings. The + operator also concatenates when both operands are strings. Prefer & because it does not depend on operand types.</p>
|
|
<pre><code>result$ = "Hello" & " " & "World"
|
|
result$ = firstName$ & " " & lastName$
|
|
|
|
' + also concatenates when both operands are strings
|
|
greeting$ = "Hi " + name$</code></pre>
|
|
</div>
|
|
<div class="topic" id="lang.statements">
|
|
<h1>Statements</h1>
|
|
<p>Multiple statements can appear on one line separated by : (colon). A line can be continued onto the next physical line by ending it with an underscore (_) preceded by whitespace. Comments start with ' (apostrophe) or the REM keyword and run to the end of the line. The character ? is a shorthand for PRINT.</p>
|
|
<pre><code>a = 10 : b = 20 : c = a + b ' three statements on one line
|
|
|
|
total = price * quantity _
|
|
+ shipping + tax ' one statement continued across lines
|
|
|
|
REM This is a comment
|
|
' So is this
|
|
? "Hello" ' same as PRINT "Hello"</code></pre>
|
|
<p><a href="#lang.declarations">Declaration Statements (DIM, REDIM, CONST, TYPE, DECLARE)</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 (ON ERROR, SHELL, SLEEP, END)</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. If no type is given, the type defaults to whatever DEFtype (if any) is in effect for the variable's first letter; without a DEFtype statement the default is Single.</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>Multiple variables can be declared at module level so their values persist between procedure calls. Arrays can have up to 8 dimensions. A variable declared with type suffix does not need the AS clause:</p>
|
|
<pre><code>Dim name$, count%, total& ' suffixes infer the types</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 at module level makes a variable accessible from every procedure without passing it as a parameter. Inside a SUB or FUNCTION, DIM declares a local variable that is recreated on each call (use STATIC to retain its value between calls).</blockquote>
|
|
<p>Fixed-length strings (STRING * n) are padded with spaces and truncated when assigned so their length is always exactly n.</p>
|
|
<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, long, float, string, or boolean). Constants are not variables -- you cannot assign a new value to them or pass them by reference.</p>
|
|
<pre><code>CONST name = value
|
|
CONST name AS type = value</code></pre>
|
|
<pre><code>Const MAX_SIZE = 100
|
|
Const PI = 3.14159265
|
|
Const APP_NAME = "DVX App"
|
|
Const DEBUG_MODE = True
|
|
Const HEADER As String = "=== Report ==="</code></pre>
|
|
<p>Constants are scoped to the file or procedure in which they are declared. Constants declared at module level are visible to all procedures in the same module.</p>
|
|
<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 = "Scott"
|
|
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. This is rarely required because the compiler supports forward references within a module, but it is still accepted for compatibility:</p>
|
|
<pre><code>DECLARE SUB name ([BYVAL] [OPTIONAL] param AS type, ...)
|
|
DECLARE FUNCTION name ([BYVAL] [OPTIONAL] param AS type, ...) AS returnType</code></pre>
|
|
<h2>DECLARE LIBRARY</h2>
|
|
<p>Declares external functions from a native library bundled with DVX. This is how BASIC programs reach operating-system services, serial ports, databases, and other native facilities. Rather than writing DECLARE LIBRARY blocks yourself, add one of the shipped include files (such as commdlg.bas or sql.bas) to your project; the include file contains the proper declarations.</p>
|
|
<pre><code>DECLARE LIBRARY "libraryName"
|
|
DECLARE SUB name ([BYVAL] param AS type, ...)
|
|
DECLARE FUNCTION name ([BYVAL] param AS type, ...) AS returnType
|
|
END DECLARE</code></pre>
|
|
<pre><code>Declare Library "basrt"
|
|
Declare Function SQLOpen(ByVal path As String) As Integer
|
|
Declare Sub SQLClose(ByVal db As Integer)
|
|
End Declare</code></pre>
|
|
<p><a href="#lang.runtime">See also: BASIC Runtime Libraries</a></p>
|
|
<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. The variables must be the same type.</p>
|
|
<pre><code>SWAP variable1, variable2</code></pre>
|
|
<pre><code>Swap a, b</code></pre>
|
|
<h2>SET</h2>
|
|
<p>Assigns an object reference (form or control) to a variable. Required when creating a form or control with CreateForm / CreateControl so that the returned reference is stored in the variable:</p>
|
|
<pre><code>SET variable = objectExpression</code></pre>
|
|
<pre><code>Dim frm As Long
|
|
Set frm = CreateForm("MyForm", 320, 240)
|
|
frm.Caption = "Built in code"</code></pre>
|
|
<p>For ordinary numeric or string assignment, SET is not used.</p>
|
|
<h2>ERASE</h2>
|
|
<p>Frees the memory of a dynamic array and resets it to undimensioned state. Fixed-size arrays (declared with constant bounds) reset their elements but keep their shape.</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 > 10 Then
|
|
Print "Large"
|
|
ElseIf x > 5 Then
|
|
Print "Medium"
|
|
Else
|
|
Print "Small"
|
|
End If
|
|
|
|
If ready Then Print "Go!"</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 "A"
|
|
Case 80 To 89
|
|
Print "B"
|
|
Case Is >= 70
|
|
Print "C"
|
|
Case 60, 65
|
|
Print "D (borderline)"
|
|
Case Else
|
|
Print "F"
|
|
End Select</code></pre>
|
|
<p>CASE items can be combined with commas. The IS keyword allows comparison operators: <, >, <=, >=, =, <>.</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 < 10
|
|
count = count + 1
|
|
Loop
|
|
|
|
' Post-test
|
|
Do
|
|
line$ = ReadLine()
|
|
Loop Until line$ = "quit"
|
|
|
|
' 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] [OPTIONAL] param AS type, ...)
|
|
statements
|
|
END SUB</code></pre>
|
|
<pre><code>Sub Greet(ByVal name As String)
|
|
Print "Hello, " & name
|
|
End Sub</code></pre>
|
|
<p>Parameters are passed by reference by default. Use ByVal for value semantics; there is no separate ByRef keyword (omitting ByVal is the by-reference form). Use EXIT SUB to return early. A SUB is called either with or without parentheses; when used as a statement, parentheses are optional:</p>
|
|
<pre><code>Greet "World"
|
|
Greet("World")
|
|
Call Greet("World")</code></pre>
|
|
<h3>Optional Parameters</h3>
|
|
<p>Mark a parameter OPTIONAL to allow callers to omit it. An optional parameter must be positioned after all required parameters and receives an empty/zero default when not supplied.</p>
|
|
<pre><code>Sub Announce(ByVal msg As String, Optional ByVal loud As Integer)
|
|
If loud Then
|
|
Print UCase$(msg)
|
|
Else
|
|
Print msg
|
|
End If
|
|
End Sub
|
|
|
|
Announce "hello" ' loud defaults to 0
|
|
Announce "hello", True ' loud is -1</code></pre>
|
|
<h2>FUNCTION...END FUNCTION</h2>
|
|
<p>Defines a function with a return value.</p>
|
|
<pre><code>FUNCTION name ([BYVAL] [OPTIONAL] 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. The function name begins with FN and is invoked just like a normal function. DEF FN functions cannot span multiple statements.</p>
|
|
<pre><code>DEF FNname(params) = expression</code></pre>
|
|
<pre><code>Def FnSquare(x) = x * x
|
|
Print FnSquare(5) ' prints 25
|
|
|
|
Def FnCelsius(f As Double) = (f - 32) * 5 / 9
|
|
Print FnCelsius(212) ' prints 100</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 "Done"
|
|
End
|
|
|
|
Initialize:
|
|
count = 0
|
|
name$ = ""
|
|
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>Writes expressions to the output window (or to a file channel).</p>
|
|
<pre><code>PRINT [expression [{; | ,} expression] ...]
|
|
PRINT #channel, expression [; expression] ...
|
|
PRINT USING format$; expression [; expression] ...</code></pre>
|
|
<ul>
|
|
<li>; between items -- no separator (items appear next to each other, or separated by a space for numbers)</li>
|
|
<li>, between items -- advance to the next 14-column tab zone</li>
|
|
<li>A trailing ; or , suppresses the newline normally written at the end of the statement</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 (first column is 1)</p>
|
|
<pre><code>Print "Name:"; Tab(20); name$
|
|
Print "X="; x, "Y="; y ' comma = next 14-column zone
|
|
Print #1, "Written to file"</code></pre>
|
|
<h3>PRINT USING</h3>
|
|
<p>PRINT USING formats each following expression according to a format string and prints the result. If more expressions are supplied than the format string consumes, the format string is reused from the start for each.</p>
|
|
<pre> Format character Meaning
|
|
---------------- -------
|
|
# Digit (replaced with a digit or space to pad on the left)
|
|
. Decimal-point position
|
|
, Insert thousands separator
|
|
+ At start or end: always show a sign character
|
|
- At end: show a trailing minus sign only when negative
|
|
** At start: fill leading spaces with asterisks
|
|
$$ At start: floating dollar sign
|
|
^^^^ Anywhere: format the value in scientific notation
|
|
! First character of a string only
|
|
& Entire string (variable length)
|
|
\ ... \ Fixed-length string field (width = 2 + number of spaces between backslashes)</pre>
|
|
<pre><code>Print Using "###.##"; 3.14159 ' " 3.14"
|
|
Print Using "$$#,##0.00"; 1234567.89 ' "$1,234,567.89"
|
|
Print Using "**#,##0.00"; 42.5 ' "*****42.50"
|
|
Print Using "####.####^^^^"; 0.000123 ' scientific notation
|
|
Print Using "\ \"; "Hello" ' fixed-width 4-char: "Hell"
|
|
Print Using "& likes &"; name$; food$</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 "prompt"; variable
|
|
INPUT #channel, variable</code></pre>
|
|
<pre><code>Input "Enter your name: "; name$
|
|
Input #1, line$</code></pre>
|
|
<h2>DATA / READ / RESTORE</h2>
|
|
<p>Inline data pool for constants.</p>
|
|
<pre><code>DATA value1, value2, "string", ...
|
|
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, "Hello"
|
|
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 (it is 0 when no error is active).</p>
|
|
<pre><code>On Error GoTo ErrorHandler
|
|
Open "missing.txt" For Input As #1
|
|
Exit Sub
|
|
|
|
ErrorHandler:
|
|
Print "Error number:"; Err
|
|
Resume Next</code></pre>
|
|
<h3>Common Error Numbers</h3>
|
|
<pre> Number Meaning
|
|
------ -------
|
|
1 FOR loop error (NEXT without FOR, NEXT variable mismatch, FOR stack underflow)
|
|
4 Out of DATA
|
|
7 Out of memory
|
|
9 Subscript out of range / invalid variable or field index
|
|
11 Division by zero
|
|
13 Type mismatch / not an array / not a TYPE instance
|
|
26 FOR loop nesting too deep
|
|
51 Internal error (bad opcode)
|
|
52 Bad file number or file not open
|
|
53 File not found
|
|
54 Bad file mode
|
|
58 File already exists or rename failed
|
|
67 Too many files open
|
|
75 Path/file access error
|
|
76 Path not found</pre>
|
|
<h2>SHELL</h2>
|
|
<p>Executes an operating-system command.</p>
|
|
<pre><code>SHELL "command"</code></pre>
|
|
<p>When used as a function, SHELL returns the exit code of the command.</p>
|
|
<pre><code>Shell "DIR /B"
|
|
exitCode = Shell("COPY A.TXT B.TXT")</code></pre>
|
|
<h2>SLEEP</h2>
|
|
<p>Pauses execution for the given number of seconds. With no argument, sleeps for 1 second.</p>
|
|
<pre><code>SLEEP [seconds]</code></pre>
|
|
<h2>RANDOMIZE</h2>
|
|
<p>Seeds the random number generator. Without an argument (not shown here) and without a prior RANDOMIZE, the sequence is the same on every run. Use RANDOMIZE TIMER to get a different sequence each run.</p>
|
|
<pre><code>RANDOMIZE seed
|
|
RANDOMIZE TIMER ' Seed from system clock</code></pre>
|
|
<h2>END</h2>
|
|
<p>Terminates program execution immediately. Any form that is loaded is unloaded before the program exits.</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, "Scott", 42, 3.14
|
|
' Output: "Scott",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.filesystem">
|
|
<h1>File System Statements</h1>
|
|
<p>DVX BASIC provides statements for working with the file system -- creating, deleting, renaming, and copying files and directories, and reading or setting file attributes.</p>
|
|
<h2>KILL</h2>
|
|
<p>Deletes a file.</p>
|
|
<pre><code>KILL filename$</code></pre>
|
|
<pre><code>Kill "temp.bak"</code></pre>
|
|
<h2>NAME ... AS</h2>
|
|
<p>Renames (or moves) a file.</p>
|
|
<pre><code>NAME oldName$ AS newName$</code></pre>
|
|
<pre><code>Name "draft.txt" As "final.txt"</code></pre>
|
|
<h2>FILECOPY</h2>
|
|
<p>Copies a file. If the destination already exists it is overwritten.</p>
|
|
<pre><code>FILECOPY source$, destination$</code></pre>
|
|
<pre><code>FileCopy "data.db", "data.bak"</code></pre>
|
|
<h2>MKDIR / RMDIR</h2>
|
|
<p>Creates or removes a directory.</p>
|
|
<pre><code>MKDIR path$
|
|
RMDIR path$</code></pre>
|
|
<pre><code>MkDir App.Data & "\backups"
|
|
RmDir "C:\OLD"</code></pre>
|
|
<h2>CHDIR / CHDRIVE</h2>
|
|
<p>Changes the current working directory or drive.</p>
|
|
<pre><code>CHDIR path$
|
|
CHDRIVE drive$</code></pre>
|
|
<pre><code>ChDir "C:\DVX\PROJECTS"
|
|
ChDrive "D"</code></pre>
|
|
<h2>GETATTR / SETATTR</h2>
|
|
<p>GETATTR returns the attributes of a file (as a function). SETATTR sets them (as a statement). Attributes are a bitmask of the vb file-attribute constants.</p>
|
|
<pre><code>attrs = GETATTR(filename$)
|
|
SETATTR filename$, attrs</code></pre>
|
|
<pre> Constant Value Attribute
|
|
-------- ----- ---------
|
|
vbNormal 0 Normal file (no attributes set)
|
|
vbReadOnly 1 Read-only
|
|
vbHidden 2 Hidden
|
|
vbSystem 4 System file
|
|
vbDirectory 16 Entry is a directory
|
|
vbArchive 32 File has been modified since last backup</pre>
|
|
<pre><code>If (GetAttr("readme.txt") And vbReadOnly) <> 0 Then
|
|
Print "File is read-only."
|
|
End If
|
|
|
|
SetAttr "secret.dat", vbHidden + vbReadOnly</code></pre>
|
|
<h2>CURDIR$ / DIR$</h2>
|
|
<p>CURDIR$ returns the current directory. DIR$ returns the first file matching a pattern; subsequent calls with no arguments return additional matches (or "" when done).</p>
|
|
<pre><code>cwd$ = CURDIR$
|
|
first$ = DIR$("*.txt")
|
|
WHILE first$ <> ""
|
|
Print first$
|
|
first$ = DIR$ ' next match, no argument
|
|
WEND</code></pre>
|
|
<h2>FILELEN</h2>
|
|
<p>Returns the length of a file in bytes.</p>
|
|
<pre><code>bytes = FILELEN(filename$)</code></pre>
|
|
</div>
|
|
<div class="topic" id="lang.func.string">
|
|
<h1>String Functions</h1>
|
|
<pre> Function Returns Description
|
|
-------- ------- -----------
|
|
ASC(s$) Integer ASCII code of the first character of s$
|
|
CHR$(n) String Character with ASCII code n
|
|
FORMAT$(value, fmt$) String Formats a numeric value using a format string
|
|
HEX$(n) String Hexadecimal representation of n (uppercase, no leading &H)
|
|
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 (1-based)
|
|
LCASE$(s$) String Converts s$ to lowercase
|
|
LEFT$(s$, n) String Leftmost n characters of s$
|
|
LEN(s$) Integer Length of s$ in characters
|
|
LTRIM$(s$) String Removes leading spaces from s$
|
|
MID$(s$, start) String Substring from start (1-based) to end of string
|
|
MID$(s$, start, length) String Substring of length characters starting at start
|
|
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 (leading space for non-negative)
|
|
STRING$(n, char) String String of n copies of char (char can be an ASCII code or single-character string)
|
|
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; stops at first non-numeric character</pre>
|
|
<h2>FORMAT$</h2>
|
|
<p>FORMAT$ formats a numeric value using a BASIC-style format string. The format characters are the same as the ones used by PRINT USING.</p>
|
|
<pre><code>s$ = FORMAT$(value, fmt$)</code></pre>
|
|
<pre><code>Print Format$(3.14159, "###.##") ' " 3.14"
|
|
Print Format$(42, "00000") ' "00042"
|
|
Print Format$(1234.5, "#,##0.00") ' "1,234.50"
|
|
Print Format$(0.5, "PERCENT") ' "50%"</code></pre>
|
|
<p>The accepted format characters are # (digit or pad space), 0 (digit or pad zero), . (decimal point), , (thousands separator), + and - (sign placement), $$ (floating dollar sign), ** (asterisk fill), and the literal word PERCENT (multiplies by 100 and appends %). See PRINT USING for details on each.</p>
|
|
<h2>MID$ Assignment</h2>
|
|
<p>MID$ can also be used on the left side of an assignment to replace a portion of a string without changing its length:</p>
|
|
<pre><code>Mid$(s$, start [, length]) = replacement$</code></pre>
|
|
<pre><code>Dim s$
|
|
s$ = "Hello, World!"
|
|
Mid$(s$, 8, 5) = "DVX--"
|
|
Print s$ ' Hello, DVX--!</code></pre>
|
|
<p>If length is omitted, MID$ replaces up to LEN(replacement$) characters. The target string's total length never changes -- extra characters in replacement$ are truncated and shorter replacements leave trailing characters in place.</p>
|
|
</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 (result in radians)
|
|
COS(n) Double Cosine of n (n in radians)
|
|
EXP(n) Double e raised to the power n
|
|
FIX(n) Integer Truncates n toward zero (drops the 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 in the range 0 <= RND < 1
|
|
SGN(n) Integer Sign of n: -1 if negative, 0 if zero, 1 if positive
|
|
SIN(n) Double Sine of n (n in radians)
|
|
SQR(n) Double Square root of n
|
|
TAN(n) Double Tangent of n (n in radians)
|
|
TIMER Double Seconds since midnight</pre>
|
|
<blockquote><strong>Note:</strong> RND with no argument returns the next number in the sequence. Use RANDOMIZE or RANDOMIZE TIMER to seed the generator so you don't get the same sequence each run.</blockquote>
|
|
<h2>Color Functions</h2>
|
|
<p>The color functions work with 24-bit RGB colors packed into a Long.</p>
|
|
<pre> Function Returns Description
|
|
-------- ------- -----------
|
|
RGB(r, g, b) Long Combine red, green, and blue components (0-255) into a 24-bit color
|
|
GETRED(color) Integer Red component (0-255) of a color built with RGB
|
|
GETGREEN(color) Integer Green component (0-255) of a color built with RGB
|
|
GETBLUE(color) Integer Blue component (0-255) of a color built with RGB</pre>
|
|
<pre><code>Dim c As Long
|
|
c = RGB(255, 128, 0) ' bright orange
|
|
Print GetRed(c); GetGreen(c); GetBlue(c) ' 255 128 0
|
|
Me.BackColor = RGB(0, 0, 128) ' dark blue background</code></pre>
|
|
</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 (rounds half away from zero)
|
|
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 the file pointer is at end of file
|
|
FREEFILE Integer Next available file channel number (1..16)
|
|
INPUT$(n, #channel) String Reads exactly 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)
|
|
FILELEN(path$) Long Length of the named file in bytes (no OPEN needed)
|
|
GETATTR(path$) Integer File attribute bits (see vbReadOnly, vbHidden, etc.)
|
|
CURDIR$ String Current working directory
|
|
DIR$(pattern$) String First filename matching pattern, or ""
|
|
DIR$ String Next match from the last DIR$(pattern$), or "" when done
|
|
LBOUND(array [, dim]) Integer Lower bound of an array dimension (default dim = 1)
|
|
UBOUND(array [, dim]) Integer Upper bound of an array dimension (default dim = 1)</pre>
|
|
</div>
|
|
<div class="topic" id="lang.func.misc">
|
|
<h1>Miscellaneous Functions</h1>
|
|
<pre> Function Returns Description
|
|
-------- ------- -----------
|
|
DATE$ String Current date as "MM-DD-YYYY"
|
|
TIME$ String Current time as "HH:MM:SS" (24-hour)
|
|
TIMER Double Seconds since midnight
|
|
ENVIRON$(name$) String Value of the environment variable; empty string if not set
|
|
ERR Integer Current runtime error number (0 if no error)
|
|
SHELL(cmd$) Integer Exit code of the command (also usable as a statement, discarding the code)</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. A form is normally designed visually in the IDE and saved as a .frm file, but forms and their controls can also be built entirely in code.</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. It fires Form_Load when the form is first loaded. UNLOAD destroys the form, firing Form_QueryUnload (which can cancel the close) and then Form_Unload. The form name here is the literal name of the form as it appears in its .frm file.</p>
|
|
<h2>Showing and Hiding Forms</h2>
|
|
<pre><code>FormName.Show [mode]
|
|
FormName.Hide
|
|
Me.Show [mode]
|
|
Me.Hide</code></pre>
|
|
<p>Pass vbModal (1) to Show for a modal dialog that blocks until the user closes it. Omit the mode for a modeless (non-blocking) window.</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 = "Hello"
|
|
Label1.Caption = "Name: " & name$
|
|
x = Text1.Left</code></pre>
|
|
<h2>Method Calls</h2>
|
|
<pre><code>ControlName.Method [args]</code></pre>
|
|
<pre><code>List1.AddItem "New entry"
|
|
List1.Clear</code></pre>
|
|
<h2>Me Keyword</h2>
|
|
<p>Me refers to the current form -- that is, the form whose event handler is running. Use it to access the form's own properties, controls, and methods from within event handlers, especially when the form's name may change or when the same code runs from multiple forms.</p>
|
|
<pre><code>Me.Caption = "Updated Title"
|
|
Me.Text1.Text = ""
|
|
Me.Hide</code></pre>
|
|
<h2>Nothing</h2>
|
|
<p>Nothing is a null object reference. Assign it to an object-typed variable to indicate "no object".</p>
|
|
<pre><code>Set myCtrl = Nothing</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 = "Item " & Str$(idx)
|
|
Me.Label1(i).Visible = True</code></pre>
|
|
<h2>WITH</h2>
|
|
<p>The WITH block provides a shorthand for setting several properties on the same control or for making several method calls. Inside the block, begin each property or method with a dot and omit the control name.</p>
|
|
<pre><code>WITH ControlName
|
|
.Property1 = value1
|
|
.Property2 = value2
|
|
.Method arg1, arg2
|
|
END WITH</code></pre>
|
|
<pre><code>With Label1
|
|
.Caption = "Status: Ready"
|
|
.ForeColor = RGB(0, 128, 0)
|
|
.Visible = True
|
|
End With</code></pre>
|
|
<h2>Building Forms in Code</h2>
|
|
<p>In addition to loading forms from .frm files, you can build a form entirely from code with CreateForm, CreateControl, SetEvent, and RemoveControl. The returned reference should be stored with SET.</p>
|
|
<h3>CreateForm</h3>
|
|
<pre><code>SET formVar = CreateForm(name$, width%, height%)</code></pre>
|
|
<p>Creates a new form with the given name and initial size. Returns a form reference.</p>
|
|
<h3>CreateControl</h3>
|
|
<pre><code>SET ctrlVar = CreateControl(formRef, typeName$, ctrlName$ [, parentCtrlRef])</code></pre>
|
|
<p>Creates a control on the given form. typeName$ is the control type (e.g. "CommandButton", "Label", "TextBox"). ctrlName$ is the unique name for the new control. If a parentCtrlRef is supplied, the new control is nested inside it (useful for placing controls inside containers like HBox or Frame).</p>
|
|
<h3>SetEvent</h3>
|
|
<pre><code>SETEVENT ctrlRef, eventName$, handlerName$</code></pre>
|
|
<p>Wires an arbitrary SUB as the handler for a control's event. The default event-handler convention (ControlName_EventName) is used automatically for controls defined in a .frm file; SetEvent is for controls you create dynamically or for reusing a single handler across multiple controls.</p>
|
|
<h3>RemoveControl</h3>
|
|
<pre><code>REMOVECONTROL formRef, ctrlName$</code></pre>
|
|
<p>Removes a control from a form.</p>
|
|
<pre><code>Dim frm As Long
|
|
Dim lbl As Long
|
|
|
|
Set frm = CreateForm("MyDlg", 300, 200)
|
|
frm.Caption = "Built in code"
|
|
|
|
Set lbl = CreateControl(frm, "Label", "StatusLabel")
|
|
StatusLabel.Caption = "Hello, world!"
|
|
|
|
Dim btn As Long
|
|
Set btn = CreateControl(frm, "CommandButton", "BtnClose")
|
|
BtnClose.Caption = "Close"
|
|
SetEvent btn, "Click", "OnCloseClick"
|
|
|
|
frm.Show
|
|
|
|
Sub OnCloseClick
|
|
Unload Me
|
|
End Sub</code></pre>
|
|
<h2>DoEvents</h2>
|
|
<p>Yields control to DVX so the GUI can process pending events. Call this in long-running loops to keep the UI responsive (otherwise the window will appear frozen).</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 the result) or as a function (returns the button clicked).</p>
|
|
<pre><code>MSGBOX message$ [, flags [, title$]]
|
|
result = MSGBOX(message$ [, flags [, title$]])</code></pre>
|
|
<p>flags is the sum of a button-style constant and an icon constant. See Predefined Constants for the complete list.</p>
|
|
<pre><code>MsgBox "Operation complete"
|
|
answer = MsgBox("Continue?", vbYesNo + vbQuestion, "Confirm")
|
|
If answer = vbYes Then
|
|
' proceed
|
|
End If</code></pre>
|
|
<h2>InputBox$</h2>
|
|
<p>Displays an input dialog and returns the user's text entry. Returns an empty string if the user cancels.</p>
|
|
<pre><code>result$ = INPUTBOX$(prompt$ [, title$ [, default$]])</code></pre>
|
|
<pre><code>name$ = InputBox$("Enter your name:", "Name Entry", "")
|
|
If name$ <> "" Then
|
|
Print "Hello, "; name$
|
|
End If</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 "Button clicked!"
|
|
End Sub
|
|
|
|
Sub Form_Load()
|
|
Me.Caption = "My App"
|
|
End Sub
|
|
|
|
Sub Text1_Change()
|
|
Label1.Caption = "You typed: " & 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 or text changed
|
|
KeyPress Printable key was pressed (receives ASCII code)
|
|
KeyDown Any key was pressed (receives key code and shift state)
|
|
KeyUp Key was released
|
|
MouseDown Mouse button pressed (receives button, X, Y)
|
|
MouseUp Mouse button released
|
|
MouseMove Mouse moved over the control
|
|
Scroll Control was scrolled (mouse wheel or scrollbar)
|
|
GotFocus Control received input focus
|
|
LostFocus Control lost input focus
|
|
Form_Load Form is being loaded (fires once, after controls are created)
|
|
Form_QueryUnload Form is about to close; set Cancel = 1 to abort
|
|
Form_Unload Form is being unloaded
|
|
Form_Resize Form was resized
|
|
Form_Activate Form gained focus
|
|
Form_Deactivate Form lost focus
|
|
Timer1_Timer Timer control interval elapsed (Timer control's default event)</pre>
|
|
</div>
|
|
<div class="topic" id="lang.sql">
|
|
<h1>SQL Functions</h1>
|
|
<p>DVX BASIC includes SQLite database support through the sql.bas include library. Add sql.bas to your project to gain access to these 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 (> 0) or 0 on failure. The file is created if it does not exist.</p>
|
|
<pre><code>db = SQLOpen(path$)</code></pre>
|
|
<pre><code>db = SQLOpen(App.Data & "\mydata.db")</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.). Returns True on success.</p>
|
|
<pre><code>ok = SQLExec(db, sql$)</code></pre>
|
|
<pre><code>SQLExec db, "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)"
|
|
SQLExec db, "INSERT INTO users (name) VALUES ('Scott')"
|
|
ok = SQLExec(db, "DELETE FROM users WHERE id = 5")</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 cursor.</p>
|
|
<pre><code>rs = SQLQuery(db, sql$)</code></pre>
|
|
<pre><code>rs = SQLQuery(db, "SELECT id, name FROM users ORDER BY name")</code></pre>
|
|
<h3>SQLNext</h3>
|
|
<p>Advances the cursor to the next row. Returns True if a row is available, False when there are no more rows.</p>
|
|
<pre><code>hasRow = SQLNext(rs)</code></pre>
|
|
<h3>SQLEof</h3>
|
|
<p>Returns True if the cursor is past the last row.</p>
|
|
<pre><code>done = SQLEof(rs)</code></pre>
|
|
<h2>Reading Fields</h2>
|
|
<h3>SQLField$ / SQLFieldText$</h3>
|
|
<p>Returns a field value as a string. Use SQLField$ to look up by column name; use SQLFieldText$ to look up by 0-based column index.</p>
|
|
<pre><code>value$ = SQLField$(rs, columnName$)
|
|
value$ = SQLFieldText$(rs, columnIndex)</code></pre>
|
|
<pre><code>name$ = SQLField$(rs, "name")
|
|
first$ = SQLFieldText$(rs, 0)</code></pre>
|
|
<h3>SQLFieldName$</h3>
|
|
<p>Returns the column name for a given 0-based column index.</p>
|
|
<pre><code>colName$ = SQLFieldName$(rs, columnIndex)</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 cursor. Always call this when finished 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 Integer
|
|
Dim rs As Integer
|
|
|
|
db = SQLOpen(App.Data & "\contacts.db")
|
|
SQLExec db, "CREATE TABLE IF NOT EXISTS contacts (name TEXT, phone TEXT)"
|
|
SQLExec db, "INSERT INTO contacts VALUES ('Alice', '555-1234')"
|
|
|
|
rs = SQLQuery(db, "SELECT name, phone FROM contacts")
|
|
Do While SQLNext(rs)
|
|
Print SQLField$(rs, "name"); Tab(20); SQLField$(rs, "phone")
|
|
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 & "\settings.ini"
|
|
dbPath$ = App.Data & "\myapp.db"
|
|
Print "Running from: " & 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 (the same text format used by DVX system configuration).</p>
|
|
<h2>IniRead</h2>
|
|
<p>Reads a value from an INI file. Returns the default value if the file, section, or key is not found. All four arguments are required.</p>
|
|
<pre><code>value$ = IniRead(file$, section$, key$, default$)</code></pre>
|
|
<pre><code>name$ = IniRead(App.Config & "\app.ini", "User", "Name", "Unknown")
|
|
fontSize = Val(IniRead(App.Config & "\app.ini", "Display", "FontSize", "12"))</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 & "\app.ini", "User", "Name", "Scott"
|
|
IniWrite App.Config & "\app.ini", "Display", "FontSize", 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. No DIM or CONST declaration is required to use them.</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 (with + or OR) to display an icon in the message box.</p>
|
|
<pre> Constant Value Description
|
|
-------- ----- -----------
|
|
vbInformation &H10 Information icon (i)
|
|
vbExclamation &H20 Warning icon (!)
|
|
vbCritical &H30 Error/critical icon (X)
|
|
vbQuestion &H40 Question 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>File Attribute Flags</h2>
|
|
<p>Bit values used with GETATTR and SETATTR.</p>
|
|
<pre> Constant Value Description
|
|
-------- ----- -----------
|
|
vbNormal 0 Normal file (no attributes)
|
|
vbReadOnly 1 Read-only
|
|
vbHidden 2 Hidden
|
|
vbSystem 4 System file
|
|
vbDirectory 16 Entry is a directory
|
|
vbArchive 32 File has been modified since last backup</pre>
|
|
<h2>Boolean Constants</h2>
|
|
<pre> Constant Value Description
|
|
-------- ----- -----------
|
|
True -1 Boolean true
|
|
False 0 Boolean false</pre>
|
|
</div>
|
|
<div class="topic" id="lang.runtime">
|
|
<h1>Include Libraries</h1>
|
|
<p>DVX ships a set of BASIC include files (.bas) in the sdk/include/basic directory. Each file is a small library of DECLARE LIBRARY wrappers around native DVX runtime functions. Add an include file to your project (the IDE's Add File command, or editing the .dbp with another tool) and the declared functions become available to your code.</p>
|
|
<pre> File Provides
|
|
---- --------
|
|
commdlg.bas File Open/Save dialogs, input dialogs, choice dialogs, save-prompt dialogs
|
|
sql.bas SQLite database access (SQLOpen, SQLQuery, SQLNext, SQLField$, etc.)
|
|
comm.bas Serial-port I/O (raw and packet) and optional encrypted links
|
|
resource.bas Read and write DVX resource blocks (icons, text, binary data) in bundled files
|
|
help.bas Compile help source files and open the DVX help viewer</pre>
|
|
<h2>Using an Include Library</h2>
|
|
<pre><code>' With commdlg.bas added to the project
|
|
Dim path As String
|
|
path = basFileOpen("Open a file", "Text Files (*.txt)|All Files (*.*)")
|
|
|
|
If path <> "" Then
|
|
Print "Selected: " & path
|
|
End If</code></pre>
|
|
<blockquote><strong>Note:</strong> DVX BASIC does not have an $INCLUDE directive. Libraries are added to the project so that the compiler sees their DECLARE LIBRARY blocks.</blockquote>
|
|
<p><a href="#lib.basrt">See also: BASIC Runtime Library</a></p>
|
|
</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. "Command1"). 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, >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 24-bit RGB value packed in a Long (use the RGB function to construct).
|
|
ForeColor Long R/W Foreground (text) color as a 24-bit RGB value packed in a Long (use the RGB function to construct).
|
|
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. "Data1").
|
|
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 = "Data Binding Example"
|
|
AutoSize = False
|
|
Width = 400
|
|
Height = 280
|
|
Begin Data Data1
|
|
DatabaseName = "myapp.db"
|
|
RecordSource = "customers"
|
|
End
|
|
Begin Label lblName
|
|
Caption = "Name:"
|
|
End
|
|
Begin TextBox txtName
|
|
DataSource = "Data1"
|
|
DataField = "name"
|
|
End
|
|
Begin Label lblEmail
|
|
Caption = "Email:"
|
|
End
|
|
Begin TextBox txtEmail
|
|
DataSource = "Data1"
|
|
DataField = "email"
|
|
End
|
|
End
|
|
|
|
Sub Data1_Reposition ()
|
|
Print "Current record changed"
|
|
End Sub
|
|
|
|
Sub Data1_Validate (Cancel As Integer)
|
|
If txtName.Text = "" Then
|
|
MsgBox "Name cannot be empty!"
|
|
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 = "Menu Demo"
|
|
|
|
Begin Menu mnuFile
|
|
Caption = "&File"
|
|
Begin Menu mnuOpen
|
|
Caption = "&Open"
|
|
End
|
|
Begin Menu mnuSave
|
|
Caption = "&Save"
|
|
End
|
|
Begin Menu mnuSep1
|
|
Caption = "-"
|
|
End
|
|
Begin Menu mnuExit
|
|
Caption = "E&xit"
|
|
End
|
|
End
|
|
|
|
Begin Menu mnuEdit
|
|
Caption = "&Edit"
|
|
Begin Menu mnuCopy
|
|
Caption = "&Copy"
|
|
End
|
|
Begin Menu mnuPaste
|
|
Caption = "&Paste"
|
|
End
|
|
End
|
|
End</code></pre>
|
|
<h2>Menu Item Properties</h2>
|
|
<pre> Property Type Description
|
|
-------- ------- -------------------------------------------
|
|
Caption String The text displayed. Use & for accelerator key. Set to "-" 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. "File", "Edit").</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 "Open was clicked"
|
|
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 = "Button A"
|
|
Index = 0
|
|
End
|
|
Begin CommandButton Command1
|
|
Caption = "Button B"
|
|
Index = 1
|
|
End
|
|
Begin CommandButton Command1
|
|
Caption = "Button C"
|
|
Index = 2
|
|
End</code></pre>
|
|
<h2>Event Handler Convention</h2>
|
|
<p>When a control has an Index property (>= 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 "Button A clicked"
|
|
Case 1
|
|
MsgBox "Button B clicked"
|
|
Case 2
|
|
MsgBox "Button C clicked"
|
|
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 = "New Text"
|
|
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 = "&File"
|
|
Begin Menu mnuOpen
|
|
Caption = "&Open"
|
|
End
|
|
End
|
|
|
|
Begin TypeName ControlName
|
|
property = value
|
|
...
|
|
End
|
|
|
|
Begin Frame Frame1
|
|
Caption = "Group"
|
|
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 <= 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 "VBox" or "HBox".
|
|
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 "Form1" 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 "VBox" Content box layout: "VBox" (vertical) or "HBox" (horizontal).
|
|
AutoSize Boolean False 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 = "Hello World"
|
|
Print "Form loaded!"
|
|
End Sub
|
|
|
|
Sub Form_QueryUnload (Cancel As Integer)
|
|
If MsgBox("Really quit?", 4) <> 6 Then
|
|
Cancel = 1
|
|
End If
|
|
End Sub
|
|
|
|
Sub Form_Resize ()
|
|
Print "Window resized"
|
|
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</p>
|
|
<p>A VT100/ANSI terminal emulator with a text-mode cell buffer, 16-color CGA palette, and scrollback history. Processes standard ANSI escape sequences (cursor control, erase, scroll, SGR colors, DEC private modes) typically used by DOS BBS software. Default size is 80 columns by 25 rows. Supports text selection with the mouse, Ctrl+C to copy, and Ctrl+V to send clipboard text as input.</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 Maximum number of scrollback lines. Older lines are dropped (write-only; default 500).</pre>
|
|
<h2>Type-Specific Methods</h2>
|
|
<pre> Method Description
|
|
------ -----------
|
|
Clear Clear the terminal screen and reset the cursor to the home position.
|
|
Poll Poll the attached communication channel for incoming bytes and feed them into the ANSI parser.
|
|
Write text$ Write a string to the terminal with full ANSI escape processing.</pre>
|
|
<p>No default event. Uses common events only.</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, "Terminal1"</code></pre>
|
|
<p>See comm.bas for the full communications API.</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin Terminal Terminal1
|
|
MinWidth = 640
|
|
MinHeight = 400
|
|
End
|
|
|
|
Sub Form_Load ()
|
|
Terminal1.Write "Welcome!" & Chr$(13) & Chr$(10)
|
|
End Sub</code></pre>
|
|
<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 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>No type-specific methods or events.</p>
|
|
<p>Container: Yes</p>
|
|
<p>Default Event: Click</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin Frame Frame1
|
|
Caption = "Options"
|
|
Begin CheckBox Check1
|
|
Caption = "Option A"
|
|
End
|
|
Begin CheckBox Check2
|
|
Caption = "Option B"
|
|
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. No visible border. Use Weight on children to distribute extra space proportionally.</p>
|
|
<p>No type-specific properties, methods, or events.</p>
|
|
<p>Container: Yes</p>
|
|
<p>Default Event: Click</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin HBox ButtonRow
|
|
Spacing = 4
|
|
Begin CommandButton Command1
|
|
Caption = "OK"
|
|
End
|
|
Begin CommandButton Command2
|
|
Caption = "Cancel"
|
|
End
|
|
End</code></pre>
|
|
<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 proportionally.</p>
|
|
<p>No type-specific properties, methods, or events.</p>
|
|
<p>Container: Yes</p>
|
|
<p>Default Event: Click</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin VBox Column1
|
|
Spacing = 4
|
|
Begin Label Label1
|
|
Caption = "Name:"
|
|
End
|
|
Begin TextBox Text1
|
|
End
|
|
End</code></pre>
|
|
<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. The Caption may include a '&' before a character to mark an accelerator key (e.g. "&OK" underlines 'O', and Alt+O activates the button).</p>
|
|
<h2>Type-Specific Properties</h2>
|
|
<pre> Property Type Description
|
|
-------- ------ -------------------------------------------
|
|
Caption String The text displayed on the button. Use '&' for an accelerator key.</pre>
|
|
<p>No type-specific methods or events.</p>
|
|
<p>Default Event: Click</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin Form Form1
|
|
Caption = "Button Demo"
|
|
Begin CommandButton Command1
|
|
Caption = "&Click Me!"
|
|
End
|
|
End
|
|
|
|
Sub Command1_Click ()
|
|
MsgBox "Button was clicked!"
|
|
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. &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 &HFFFFFF
|
|
Picture1.SetPenSize 2
|
|
Picture1.DrawRect 10, 10, 180, 130, &H000000
|
|
Picture1.FillCircle 100, 75, 40, &HFF0000
|
|
Picture1.DrawText 60, 130, "Hello!"
|
|
Picture1.Save "output.bmp"</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. The checked state is exposed as a Boolean. Supports accelerator keys (put '&' before a character in the Caption). Press Space or Enter to toggle when focused.</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>No type-specific methods or events.</p>
|
|
<p>Default Event: Click</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin CheckBox Check1
|
|
Caption = "Enable feature"
|
|
End
|
|
|
|
Sub Check1_Click ()
|
|
If Check1.Value Then
|
|
Label1.Caption = "Feature ON"
|
|
Else
|
|
Label1.Caption = "Feature OFF"
|
|
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, default maxLen 256)</p>
|
|
<p>A combination of a single-line text input and a drop-down list. The user can either type a value or pick one from the list. Selecting a list item copies its text into the edit field. 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 = user typed something not in the list).</pre>
|
|
<h2>Type-Specific Methods</h2>
|
|
<pre> Method Description
|
|
------ -----------
|
|
AddItem text$ Append an item to the drop-down list.
|
|
Clear Remove all items.
|
|
List(index%) Return the text of the item at the given index.
|
|
ListCount() Return the number of items in the list.
|
|
RemoveItem index% Remove the item at the given index.</pre>
|
|
<p>Default Event: Click</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin ComboBox Combo1
|
|
End
|
|
|
|
Sub Form_Load ()
|
|
Combo1.AddItem "Small"
|
|
Combo1.AddItem "Medium"
|
|
Combo1.AddItem "Large"
|
|
End Sub
|
|
|
|
Sub Combo1_Change ()
|
|
Label1.Caption = "Selected: " & Combo1.Text
|
|
End Sub</code></pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
<p><a href="#ctrl.listbox">See ListBox for details</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.data">
|
|
<h1>Data</h1>
|
|
<p>VB Equivalent: Data -- DVX Widget: data | Name Prefix: Data</p>
|
|
<p>A data access control that connects to a SQLite database and provides record navigation. Other controls bind to a Data control via their DataSource and DataField properties. The Data control cache is populated by calling Refresh. Move operations auto-save the current row if dirty.</p>
|
|
<p><a href="#ctrl.databinding">See Data Binding for details</a></p>
|
|
<h2>Type-Specific Properties</h2>
|
|
<pre> Property Type Description
|
|
------------ ------- -------------------------------------------
|
|
DatabaseName String Path to the SQLite database file.
|
|
RecordSource String Table name or SQL SELECT query for the recordset.
|
|
KeyColumn String Primary key column name (used for UPDATE/DELETE operations).
|
|
Caption String Text displayed on the navigator bar.
|
|
BOF Boolean True if the current position is the first record or there are no records (read-only).
|
|
EOF Boolean True if the current position is past the last record or there are no records (read-only).
|
|
MasterSource String Name of a master Data control (for master-detail binding).
|
|
MasterField String Column in the master recordset to read for the filter value.
|
|
DetailField String 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) Append a blank record and move to it.
|
|
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. Default event.
|
|
Validate Cancel As Integer Fires before writing. Set Cancel = 1 to abort.</pre>
|
|
<p>Default Event: Reposition</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin Data Data1
|
|
DatabaseName = "books.db"
|
|
RecordSource = "titles"
|
|
KeyColumn = "id"
|
|
End
|
|
|
|
Begin TextBox Text1
|
|
DataSource = "Data1"
|
|
DataField = "title"
|
|
End
|
|
|
|
Sub Form_Load ()
|
|
Data1.Refresh
|
|
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>
|
|
<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 | Name Prefix: DBGrid</p>
|
|
<p>A data-bound grid that displays records from a Data control in a tabular format. Columns auto-populate from the query results. Bind the grid using the DataSource property. Click a column header to sort; drag a column border to resize. Selecting a row moves the bound Data control's cursor to that row.</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 (default: True).</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 row is clicked.
|
|
DblClick (none) Fires when a row is double-clicked. Default event.</pre>
|
|
<p>Default Event: DblClick</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin Data Data1
|
|
DatabaseName = "books.db"
|
|
RecordSource = "titles"
|
|
End
|
|
|
|
Begin DBGrid DBGrid1
|
|
DataSource = "Data1"
|
|
GridLines = True
|
|
End
|
|
|
|
Sub Form_Load ()
|
|
Data1.Refresh
|
|
End Sub
|
|
|
|
Sub DBGrid1_DblClick ()
|
|
MsgBox "Opening row " & Str$(Data1.BOF)
|
|
End Sub</code></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. Use the arrow keys to navigate and Enter to commit when the list is open.</p>
|
|
<h2>Type-Specific Properties</h2>
|
|
<pre> Property Type Description
|
|
--------- ------- -------------------------------------------
|
|
ListIndex Integer Index of the currently selected item (-1 = none).</pre>
|
|
<h2>Type-Specific Methods</h2>
|
|
<pre> Method Description
|
|
------ -----------
|
|
AddItem text$ Append an item to the drop-down list.
|
|
Clear Remove all items.
|
|
List(index%) Return the text of the item at the given index.
|
|
ListCount() Return the number of items in the list.
|
|
RemoveItem index% Remove the item at the given index.</pre>
|
|
<p>Default Event: Click</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin DropDown DropDown1
|
|
End
|
|
|
|
Sub Form_Load ()
|
|
DropDown1.AddItem "Small"
|
|
DropDown1.AddItem "Medium"
|
|
DropDown1.AddItem "Large"
|
|
DropDown1.ListIndex = 1
|
|
End Sub
|
|
|
|
Sub DropDown1_Click ()
|
|
Label1.Caption = "Picked: " & DropDown1.List(DropDown1.ListIndex)
|
|
End Sub</code></pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
<p><a href="#ctrl.listbox">See ListBox for details</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. Has the same press/release behavior as CommandButton, but shows a bitmap. Typically used inside a Toolbar.</p>
|
|
<h2>Type-Specific Properties</h2>
|
|
<pre> Property Type Description
|
|
----------- ------- -------------------------------------------
|
|
Picture String Path to an image file to load.
|
|
ImageWidth Integer Width of the loaded image in pixels (read-only).
|
|
ImageHeight Integer Height of the loaded image in pixels (read-only).</pre>
|
|
<p>No type-specific methods or events.</p>
|
|
<p>Default Event: Click</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin Toolbar Toolbar1
|
|
Begin ImageButton ImageButton1
|
|
Picture = "icons/save.bmp"
|
|
End
|
|
Begin ImageButton ImageButton2
|
|
Picture = "icons/open.bmp"
|
|
End
|
|
End
|
|
|
|
Sub ImageButton1_Click ()
|
|
MsgBox "Save clicked"
|
|
End Sub</code></pre>
|
|
<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 bitmap images from file. Set the Picture property at design-time (in the .frm file) or at runtime to load a file.</p>
|
|
<h2>Type-Specific Properties</h2>
|
|
<pre> Property Type Description
|
|
----------- ------- -------------------------------------------
|
|
Picture String Path to an image file to load.
|
|
Stretch Boolean When True, the image stretches to fill the widget; when False, shown at natural size.
|
|
ImageWidth Integer Width of the loaded image in pixels (read-only).
|
|
ImageHeight Integer Height of the loaded image in pixels (read-only).</pre>
|
|
<p>No type-specific methods or events.</p>
|
|
<p>Default Event: Click</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin Image Image1
|
|
Picture = "assets/logo.bmp"
|
|
Stretch = True
|
|
End
|
|
|
|
Sub Image1_Click ()
|
|
MsgBox "Size: " & Str$(Image1.ImageWidth) & "x" & Str$(Image1.ImageHeight)
|
|
End Sub</code></pre>
|
|
<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. Put '&' before a character in the Caption to define an accelerator that moves focus to the next focusable control.</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>No type-specific methods or events.</p>
|
|
<p>Default Event: Click</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Begin Label Label1
|
|
Caption = "Hello, World!"
|
|
Alignment = "Center"
|
|
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, drag-to-reorder, and keyboard navigation with type-ahead search.</p>
|
|
<h2>Type-Specific Properties</h2>
|
|
<pre> Property Type Description
|
|
--------- ------- -------------------------------------------
|
|
ListIndex Integer Index of the currently selected item (-1 = no selection).</pre>
|
|
<h2>Type-Specific Methods</h2>
|
|
<pre> Method Parameters Description
|
|
--------------- --------------------------------------- -------------------------------------------
|
|
AddItem Text As String Add an item to the end of the list.
|
|
Clear (none) Remove all items from the list.
|
|
ClearSelection (none) Deselect all items.
|
|
IsItemSelected Index As Integer Returns True if the item at Index is selected.
|
|
List Index As Integer Return the text of the item at the given index.
|
|
ListCount (none) Return the number of items in the list.
|
|
RemoveItem Index As Integer Remove the item at the given index.
|
|
SelectAll (none) Select all items (multi-select mode).
|
|
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. "Red|Green|Blue"). Replaces existing items.
|
|
SetMultiSelect Multi As Boolean Enable or disable multi-select mode.
|
|
SetReorderable Reorderable As Boolean Enable or disable drag-to-reorder.</pre>
|
|
<p>Default Event: Click</p>
|
|
<h2>Example</h2>
|
|
<pre><code>Sub Form_Load ()
|
|
List1.AddItem "Apple"
|
|
List1.AddItem "Banana"
|
|
List1.AddItem "Cherry"
|
|
End Sub
|
|
|
|
Sub List1_Click ()
|
|
Dim idx As Integer
|
|
idx = List1.ListIndex
|
|
If idx >= 0 Then
|
|
Label1.Caption = "Selected: " & 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 "Name,Width|Name,Width" (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 "Name,20|Size,10|Type,15"
|
|
ListView1.AddItem "readme.txt"
|
|
ListView1.SetCell 0, 1, "1024"
|
|
ListView1.SetCell 0, 2, "Text"
|
|
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 = "Value: " & 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 (vertical divider, panes side-by-side).</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 holds child widgets (such as labels), each drawn with a sunken-panel border for the classic segmented status-bar look. It is not registered as a container in the form runtime, so child controls cannot be nested inside it in .frm files.</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 = "Enter text here"
|
|
End
|
|
|
|
Sub Text1_Change ()
|
|
Label1.Caption = "You typed: " & 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, default max 65536 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: "dhs" (help source), "bas" (BASIC). Pass "" 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("TODO", False, True) Then
|
|
Print "Found at line"; TextArea1.CursorLine
|
|
End If
|
|
|
|
' Replace all occurrences
|
|
Dim count As Integer
|
|
count = TextArea1.ReplaceAll("old", "new", False)
|
|
Print "Replaced"; count; "occurrences"</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.</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 = "Ticks: " & 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 "Animals"
|
|
TreeView1.AddChildItem 0, "Cat"
|
|
TreeView1.AddChildItem 0, "Dog"
|
|
TreeView1.AddItem "Plants"
|
|
TreeView1.AddChildItem 3, "Oak"
|
|
TreeView1.SetExpanded 0, True
|
|
Print "Items:"; 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 | Name Prefix: 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>
|