Scriptbasic Users Guide: Introduction
Total Page:16
File Type:pdf, Size:1020Kb
ScriptBasic Users Guide: Introduction ScriptBasic Users Guide: Introduction Table of Contents Introduction.........................................................................................................................................................1 Using ScriptBasic....................................................................................................................................2 Using the File Manager............................................................................................................................2 Using the SB Program Editor..................................................................................................................3 Using the SB Virtual Terminal................................................................................................................4 General Language Format.................................................................................................................................1 Hello World.........................................................................................................................................................1 Strings..................................................................................................................................................................1 Numbers...............................................................................................................................................................1 Variables..............................................................................................................................................................1 Constants.............................................................................................................................................................1 Forcing Variable Declaration............................................................................................................................1 Arrays...................................................................................................................................................................1 Creating arrays...................................................................................................................................................1 Array index limits...............................................................................................................................................1 Deleting an array.................................................................................................................................................1 Associative Arrays..............................................................................................................................................1 Notes for using associative arrays.....................................................................................................................1 Using Array Mixed Mode...................................................................................................................................1 Expressions..........................................................................................................................................................1 Operators.............................................................................................................................................................1 Power operator (^)..............................................................................................................................................1 Multiplication operator (*).................................................................................................................................1 Division operator (/)............................................................................................................................................1 Integer division operator (\)...............................................................................................................................1 Modulus operator (%)........................................................................................................................................1 Addition and subtraction operators (+, -).........................................................................................................1 i ScriptBasic Users Guide: Introduction Table of Contents Bit-wise and logical NOT (NOT).......................................................................................................................1 Equality operator (=)..........................................................................................................................................1 Not equal operator (<>)......................................................................................................................................1 Compare operators (<, <=, >, >=)......................................................................................................................1 Logical operators (and, or, xor).........................................................................................................................1 Concatenation operator (&)...............................................................................................................................1 ByVal operator....................................................................................................................................................1 LIKE operator.....................................................................................................................................................1 Assignments (LET).............................................................................................................................................1 Operator Assignments........................................................................................................................................1 Comments............................................................................................................................................................1 Including Files.........................................................................................................................................1 Interacting with the user....................................................................................................................................1 Print......................................................................................................................................................................1 Input.....................................................................................................................................................................1 Handling command line arguments.........................................................................................................1 [<<<] [>>>]..............................................................................................................................................1 Name spaces.........................................................................................................................................................1 File Handling.......................................................................................................................................................1 Opening and creating files..................................................................................................................................1 Text and binary files...........................................................................................................................................1 Getting a free file number..................................................................................................................................1 Positioning in a file..............................................................................................................................................1 Reading and writing files....................................................................................................................................1 Setting the current working directory..............................................................................................................1 Deleting a file.......................................................................................................................................................1 Networking..........................................................................................................................................................1 ii ScriptBasic Users Guide: Introduction Table of Contents Opening a Socket.................................................................................................................................................1 String handling commands................................................................................................................................1 Split and splita.....................................................................................................................................................1 Unpack.................................................................................................................................................................1 Conditional Execution........................................................................................................................................1