Unibasic 9.3 Reference Guide
Total Page:16
File Type:pdf, Size:1020Kb
Unibasic - Dynamic Concepts Wiki 6/19/17, 1244 PM Unibasic From Dynamic Concepts Wiki Contents 1 UniBasic 2 About this Guide 2.1 Conventions 3 Installation & Configuration 3.1 Configuring Unix for UniBasic 3.1.1 Number of Processes 3.1.2 Number of Open Files 3.1.3 Number of Open i-nodes 3.1.4 Number of Locks 3.1.5 Message Queues 3.2 Unix Accounting & Protection System 3.3 Creating a Unix Account for UniBasic 3.4 UniBasic Security & Licensing 3.4.1 Software Licensing 3.4.2 Hardware Licensing 3.5 Loading the Installation File 3.5.1 Loading the UniBasic Installation File 3.5.2 Loading the UniBasic Development File 3.6 ubinstall - Installing UniBasic Packages 3.6.1 Errors During Installation 3.7 Configuring a UniBasic Environment 3.7.1 Directories and Paths 3.7.2 Filenames and Pathnames 3.7.3 Organizing Logical Units and Packnames 3.7.4 Environment Variables 3.7.5 Setting up .profile for Multiple Users 3.8 Command Line Interpreter 3.9 Launching UniBasic From Unix 3.10 Terminating a UniBasic Process 3.11 Licensing a New Installation 3.12 Changing the SSN Activation Key 3.13 Launching UniBasic Ports at Startup 3.14 Configuring Printer Drivers 3.15 Configuring Serial Printers 3.16 Configuring Terminal Drivers 3.17 Creating a Customized Installation Media 4 Introduction To UniBasic 4.1 Data 4.1.1 Numeric Data 4.1.1.1 Numeric Precision 4.1.1.2 Special Notes on %3 and %6 Numerics https://engineering.dynamic.com/mediawiki/index.php?title=Unibasic&printable=yes Page 1 of 397 Unibasic - Dynamic Concepts Wiki 6/19/17, 1244 PM 4.1.1.3 Integers Stored in Floating-Point Variables 4.1.2 String Data and Literals - "str.lit" 4.1.3 CRT Mnemonics and Expressions - crt.expr 4.2 Statements, Statement Numbers & Labels 4.2.1 Immediate Mode 4.2.2 Statement Numbering 4.2.3 Multiple-Statement Lines 4.2.4 Inserting, Changing & Deleting Statements 4.3 Variables 4.3.1 Variable Naming Conventions 4.3.2 Subscripted Variables 4.3.3 Arrays and Matrices 4.4 Numeric, Array and Matrix Variables 4.4.1 Automatic Dimensioning Numeric Variables 4.4.2 Re-Dimensioning Numeric Variables 4.5 String Variables 4.5.1 Subscripted Strings 4.5.2 String Arrays 4.5.3 Dimensioning String Variables 4.5.4 Re-Dimensioning String Variables 4.6 Expressions 4.6.1 Operator Precedence 4.6.2 Operator Precedence Table 4.6.3 Predefined BASIC Functions 4.7 Operators Used in Expressions 4.7.1 Unary Operators + - 4.7.2 Arithmetic Operators ^ * / % + - 4.7.3 Concatenation Operators + , 4.7.4 Relational Operators = <> > >= < <= 4.7.5 Boolean Operators AND OR 4.7.6 String Operator USING 4.7.6.1 Field Descriptors 4.7.6.2 Leading Characters 4.7.6.3 Floating Characters 4.7.6.4 Numeric Characters 4.7.6.5 Commas 4.7.6.6 Decimal Points 4.7.6.7 Post Signs 4.7.6.8 Numeric Split 4.7.7 String Operator TO 4.8 Numeric Expressions 4.9 String Expressions 4.10 Rules Governing String Processing 4.11 String Assignment 5 UniBasic Files 5.1 Introduction to Files 5.2 Filenames and Pathnames 5.3 File Attributes, Protection and Permissions 5.3.1 Using IRIS Protections 5.3.2 Using Unix Permissions Directly https://engineering.dynamic.com/mediawiki/index.php?title=Unibasic&printable=yes Page 2 of 397 Unibasic - Dynamic Concepts Wiki 6/19/17, 1244 PM 5.3.3 BITS Attributes 5.3.4 Supplemental Protection Attributes 5.4 Accessing Data Files Through a Channel 5.4.1 Channel Expression - chn.expr 5.5 Record Locking 5.6 Text Files 5.6.1 Creating Text Files 5.6.2 Accessing Text Files 5.7 Saved BASIC Program Files 5.8 Contiguous Data Files 5.8.1 Creating Contiguous Files 5.8.2 Accessing Contiguous Files 5.9 Tree-Structured Data Files 5.9.1 Creating Tree-Structured Files 5.9.2 Accessing Tree-Structured Files 5.10 Formatted (Item) Data Files 5.10.1 Creating Formatted ITEM Files 5.10.2 Accessing Formatted ITEM Files 5.11 Indexed Data Files 5.12 Indexed File Creation 5.12.1 Accessing an Indexed Data File 5.12.1.1 Mode 0 - Index Definition 5.12.1.2 Mode 1—Miscellaneous Index Information 5.12.1.3 Mode 2—Search for a Specific Key 5.12.1.4 Mode 3—Search for the Next Highest Key 5.12.1.5 Mode 4—Insert a New Key into an Index 5.12.1.6 Mode 5—Delete an Existing Key from an Index 5.12.1.7 Mode 6—Search for a Previous Lower Key 5.12.1.8 Mode 7—Reorganize Index 5.12.1.9 Mode 8—Specify B-Tree Insertion Algorithm 5.12.1.10 Mode 12-Determined encryption status 5.12.2 Indexed File Errors & Recovery 5.13 Accessing non-UniBasic Files and Devices 5.14 IRIS BCD Data and Key Files 5.14.1 Creating IRIS BCD Data Files 5.14.2 Accessing IRIS BCD Data Files 5.15 Universal Data Files 5.15.1 Creating Universal Data Files 5.15.2 Accessing Universal Data Files 5.16 Encrypted Data Files 5.16.1 Creating Encrypted Data Files 5.16.2 Accessing Encrypted Data Files 5.17 Special UniBasic Files 5.17.1 Error Message File: errmessage 5.17.2 $TERM Files: term.xxxx 6 Device Input and Output 6.1 Port Numbering 6.2 Phantom Ports 6.3 Accessing Drivers ($LPT) and Pipes 6.4 Printer Drivers https://engineering.dynamic.com/mediawiki/index.php?title=Unibasic&printable=yes Page 3 of 397 Unibasic - Dynamic Concepts Wiki 6/19/17, 1244 PM 6.5 Mail Drivers 6.6 Terminal Translation File $TERM Files 6.6.1 $TERM Flags and Switches 6.7 Defining $TERM Mnemonics 6.7.1 Mnemonics Translated for Output 6.7.2 CRT Mnemonics 6.7.2.1 Mnemonics for Keyboard and Auxport 6.7.2.2 Mnemonics to Clear & Reset the Terminal 6.7.2.3 Mnemonics Applied to the Cursor Position 6.7.2.4 Mnemonics to Control Attributes 6.7.2.5 Mnemonics to Control Color 6.7.2.6 Mnemonics to Transmit Data 6.7.2.7 Miscellaneous Mnemonics 6.7.2.8 Special Mnemonics for I/O Control 6.7.2.9 IRIS Mnemonics Not Supported 6.7.3 $TERM Extended Graphic Mnemonics 6.7.3.1 Table of Extended Graphics Octal Codes 6.8 $TERM Input Character Processing 6.9 Cursor Tracking Mode 6.10 Using Dynamic Windows 6.10.1 Using Protected Characters & PC Monitors 6.10.2 Mnemonics Simulated During Window Tracking 7 UniBasic Commands 7.1 Starting & Ending Statement Numbers 7.2 Processing in Command Mode 7.3 ! Command 7.4 / Command (BITS only) 7.5 AUTO 7.6 BASIC (IRIS only) 7.7 BAUD 7.8 BYE 7.9 CD 7.10 CHAIN "SAVE. ." (IRIS only) 7.11 CHANGE (BITS only) 7.12 CHECK (IRIS only) 7.13 CLU (IRIS only) 7.14 CONTINUE 7.15 DEL (BITS only) 7.16 DELETE (IRIS only) 7.17 DUMP 7.18 EDIT 7.19 ERASE (BITS only) 7.20 EXEC (IRIS only) 7.21 EXIT (IRIS only) 7.22 FILE 7.23 (Filename) 7.24 FIND 7.25 GET (BITS only) 7.26 GO (IRIS only) 7.27 HALT https://engineering.dynamic.com/mediawiki/index.php?title=Unibasic&printable=yes Page 4 of 397 Unibasic - Dynamic Concepts Wiki 6/19/17, 1244 PM 7.28 HELP 7.29 LEVEL 7.30 LIST 7.31 LOAD (IRIS only) 7.32 MERGE (BITS only) 7.33 MSG 7.34 NEW 7.35 OEM 7.36 PACK (BITS only) 7.37 PROTECT 7.38 PSAVE 7.39 RENUMB 7.40 RSAVE (BITS only) 7.41 RUN 7.42 SAVE 7.43 SHOW 7.44 SIZE 7.45 STATUS (IRIS only) 7.46 TIME 7.47 UNASSIGN 7.48 USERS 7.49 VARIABLE 7.50 VERIFY 7.51 VSAVE (BITS only) 8 UniBasic Statements 8.1 Program Debugging Aids 8.1.1 Single-Step Program Execution 8.1.2 Trace Mode 8.1.3 Program Breakpoints 8.2 Statement Documentation Format 8.3 BUILD # 8.4 CALL 8.5 CHAIN 8.6 CHAIN READ 8.7 CHAIN WRITE 8.8 CLEAR # 8.9 CLOSE # 8.10 COM 8.11 CONV 8.12 CREATE # 8.13 DATA 8.14 DEF FN 8.15 DIM 8.16 DUPLICATE 8.17 EDIT 8.18 END 8.19 ENTER 8.20 EOFCLR 8.21 EOFSET 8.22 EOPEN https://engineering.dynamic.com/mediawiki/index.php?title=Unibasic&printable=yes Page 5 of 397 Unibasic - Dynamic Concepts Wiki 6/19/17, 1244 PM 8.23 ERRCLR 8.24 ERRSET 8.25 ERRSTM 8.26 ESCCLR 8.27 ESCSET 8.28 ESCDIS 8.29 ESCSTM 8.30 EXECUTE 8.31 FOR 8.32 GOSUB 8.33 GOTO 8.34 IF 8.35 IF ERR 8.36 INDEX # 8.36.1 Summary of INDEX Modes 8.36.2 Detailed Table of INDEX Modes 8.36.2.1 Table of INDEX status return values 8.37 INPUT 8.38 INTCLR 8.39 INTSET 8.40 JUMP 8.41 KILL 8.42 LET 8.43 LIB 8.44 MAT = 8.45 MAT + 8.46 MAT * 8.47 MAT CON 8.48 MAT IDN 8.49 MAT INV 8.50 MAT TRN 8.51 MAT ZER 8.52 MAT INPUT 8.53 MAT PRINT 8.54 MAT RDLOCK # 8.55 MAT READ 8.56 MAT READ # 8.57 MAT WRITE # 8.58 MAT WRLOCK # 8.59 MODIFY 8.60 NEXT 8.61 ON 8.62 OPEN # 8.63 PAUSE 8.64 PORT 8.64.1 Mode 0—Attach Selected Port 8.64.2 Mode 1—Place an Attached Port in Command Mode 8.64.3 Mode 2—Transmit Command String to Attached Port 8.64.4 Mode 3—Return Attached Port’s Operational Status 8.65 PRINT https://engineering.dynamic.com/mediawiki/index.php?title=Unibasic&printable=yes Page 6 of 397 Unibasic - Dynamic Concepts Wiki 6/19/17, 1244 PM 8.66 RANDOM 8.67 RDLOCK # 8.68 RDREL # 8.69 READ 8.70 READ # 8.71 RECV 8.72 REM 8.73 RESTOR 8.74 RETURN 8.75 REWIND # 8.76 ROPEN # 8.77 SEARCH 8.78 SEARCH # 8.78.1 Summary of SEARCH # Modes 8.78.2 Detailed Table of SEARCH # Modes 8.78.2.1 Table of SEARCH # status return values 8.79 SEND 8.80 SETFP # 8.81 SIGNAL 8.81.1 Mode 1 - Transmit a message to another port 8.81.2 Mode 2 - Receive messages sent to your port 8.81.3 Mode 3 - Pause Program Operation 8.81.4 Mode 5 - Receive System Signal 8.81.5 Mode 6 - Clear all outstanding signals 8.82 SPAWN 8.83 STOP 8.84 SUSPEND 8.85 SWAP 8.86 SYSTEM 8.87 TRACE 8.88 UNIT 8.89 UNLOCK # 8.90 WINDOW 8.91 WRITE # 8.92 WRLOCK # 8.93 WRREL # 9 User CALLS 9.1 CALL $ATOE 9.2 CALL $AVPORT 9.3 CALL $CALLSTAT 9.4 CALL $CKSUM 9.5 CALL $CLU 9.6 CALL $DATE 9.7 CALL $ECHO 9.8 CALL $ENV 9.9 CALL $ETOA 9.10 CALL $FINDF 9.11 CALL $INPBUF 9.12 CALL $LOCK 9.13 CALL $LOGIC https://engineering.dynamic.com/mediawiki/index.php?title=Unibasic&printable=yes Page 7 of 397 Unibasic - Dynamic Concepts Wiki 6/19/17, 1244 PM 9.14 CALL $NCRC32 9.15 CALL $RDFHD 9.16 CALL $RENAME 9.17 CALL $STRING 9.18 CALL $SWAPF 9.19 CALL $TIME 9.20 CALL $TRXCO 9.21 CALL $VOLLINK 9.22 CALL 15 9.23 CALL 18/19 9.24