XBasic Language Description
Conventions
TRUE
FALSE
TRUE vs $$TRUE
FALSE vs $$FALSE
Implicit TRUE and FALSE
Language Elements
Character Set
Parse Method
Case Sensitive
Names and Symbols
Type Suffixes
Scope Prefixes
Symbols
Name Conventions
Keywords
Type Names
User Defined aka Composite Type Names
Variable Names
GOTO Label Names
Subroutine Names
Function Names
Reserved Names
Source Lines
Line Names
Subroutine Names
Comments
Assignment
Statements
Intrinsics
Operators
Unary Operators
Binary Operators
Operator Precedence
Operator Kind
Operator Class
Class 1
Class 2
Class 3
Class 4
Class 5
Class 6
Class 7
Class 8
Class 9
Class 10
Class 11
Operator Summary
Unary Address Operators
&
&&
Unary Arithmetic Operators
+
-
Unary Bitwise Operators
~ aka NOT
Unary Logical Operators
!
!!
Binary Shift Operators
>>>
<<<
>>
<<
Binary Arithmetic Operators
**
/
*
-
+
\
MOD
Binary Bitwise Operators
& aka AND
| aka OR
^ aka XOR
Binary Logical Operators
&&
^^
||
Binary String Operators
+
Binary Relational Operators
> aka !<=
>= aka !<
<= aka !>
< aka !>=
<> aka !=
= aka ==
Operator Considerations
Subroutines
Functions
Block Structure
Execution Order
Multi-Level Control
Data
Data Type
Type Suffix
Simple Type
String
Composite Type
Built In Types
Coercion aka Type Conversion
Type Sizes
Storage Type
Kind
Literal
Numeric Literal
Character Literal
Integer Literal
Decimal Literal
Scientific Literal
Hexadecimal Literal
Octal Literal
Binary Literal
SINGLE Image
DOUBLE Image
String Literal
Constant
Local Constant
Shared Constant
System Constant
Variable
Simple Variable
Bit Field
Bit Field Intrinsics
Brace Notation for Bitfields
BITFIELD()
String Variable
Brace Notation Extract
Brace Notation Assign
Brace Notation Warning
String Support
Composite Data Type
Composite Type DEClaration
Composite Variable
Component
SCOMPLEX and DCOMPLEX
Array Variable
DIM
REDIM
DIM vs REDIM
Dimension
Empty Array
Passing Array Arguments
Array Element
Array Implementation
Tree Structure
Regular Array
Irregular Array
Nodes and Data
Building Irregular Arrays
ATTACH and SWAP
Excess Comma Notation
Natural Data Type
Considerations of Tree Structure Arrays
Scope
Visible Scope
AUTO
AUTOX
STATIC
SHARED
SHARED /groupname/
EXTERNAL
EXTERNAL /groupname/
Programs
Program
Prolog
Prolog Elements Example
Function Library aka Library
System Functions and Foreign Functions
IMPORT
EXPORT ... END EXPORT
Blowback Function - Blowback()
Functions
Functions
Entry Function
Function Names
Encapsulation
Arguments
Function Declaration
Argument Checking
ANY
. . .
Return Type
Function Definition
Default Type
Function Arguments
RETURN and EXIT FUNCTION
END FUNCTION
Function Arguments
Numeric Arguments
String Arguments
Array Arguments
Argument Kind and Type Checking
Pass by Value
Pass by Reference
Implementation
Consequences of Pass by Reference Implementation
Example Illustrates Pass by Reference
Pass by Address
Argument Checking
Return Value
Function Call
Computed Function Call
Fall Through
Recursion
Execution Control
Execution Order
Conventional GOTO
Computed GOTO
Conventional GOSUB
GOSUB Example
Computed GOSUB
Conventional Function Call
Computed Function Call
DECisions
IF statement
IF and IFZ
SELECT CASE
Syntax
Test Expression
SELECT CASE - zero or one of many
SELECT CASE ALL - n of many
SELECT CASE TRUE
SELECT CASE FALSE
Example 1
Example 2
EXIT SELECT
NEXT CASE
ELSEIF
Loops and Iteration
DO ... LOOP
DO Options
EXIT DO Example
FOR ... NEXT
FOR Example
FOR Options
STEP
File Processing
Overview
File Number
File Pointer
OPEN
CLOSE
INFILE$()
WRITE
READ and WRITE Composite Variables
Errors
Compile Time Errors
Runtime Errors and Exceptions
Runtime Errors
ERROR() and ERROR$()
Runtime Error Handling
Error Numbers
Programmer Defined Errors
Runtime Exceptions
Appendix A : Standard Character Set
Appendix B : Translating Programs
Appendix C : Keywords
Appendix D : Operators
Appendix E : Statements
Appendix F : Intrinsics