Minim Language Guide
Total Page:16
File Type:pdf, Size:1020Kb
MiniM Database Server Language Guide Version 1.31 Eugene Karataev mailto:[email protected] http://www.minimdb.com May 9, 2021 2 Contents 1 Syntax 11 1.1 Overall review ........................... 11 1.2 Commands ............................ 12 1.3 Functions ............................. 13 1.4 Operators ............................. 14 1.5 Expressions ............................ 14 1.6 Constants ............................. 15 1.7 System variables ......................... 16 1.8 Structured system variables ................... 17 1.9 Local variables .......................... 18 1.10 Global variables .......................... 19 1.11 Postconditional expressions ................... 20 1.12 Strings and numbers ....................... 21 1.13 Subscripts ............................. 23 1.14 Naked indicator .......................... 24 1.15 Indirection ............................. 25 1.16 Routines .............................. 27 1.17 Labels ............................... 29 1.18 Parameters passing ........................ 31 1.19 Comments ............................. 33 1.20 Locks ................................ 34 1.21 Input-output devices ....................... 35 1.22 Device options ........................... 38 1.23 Device mnemonics ........................ 38 2 Operators 41 2.1 Unary Plus (+) .......................... 41 2.2 Addition (+) ........................... 42 2.3 Unary Minus (-) .......................... 42 2.4 Subtraction (-) .......................... 43 2.5 Multiplication (*) ......................... 44 3 4 CONTENTS 2.6 Division (/) ............................ 44 2.7 Integer Divide (backslash) .................... 45 2.8 Exponentation (**) ........................ 46 2.9 Modulo (#) ............................ 46 2.10 Concatenation ( ) ......................... 47 2.11 Not (’) ............................... 48 2.12 Equals (=) ............................. 49 2.13 Greater (¿) ............................ 50 2.14 Greater or Equal (¿=) ...................... 50 2.15 Less (¡) ............................... 51 2.16 Less or Equal (¡=) ........................ 51 2.17 Contains ([) ............................ 52 2.18 Follows (]) ............................. 53 2.19 Follows or Equal (]=) ....................... 53 2.20 Sorts After (]]) .......................... 54 2.21 Sorts After or Equal (]]=) .................... 54 2.22 AND (&) ............................. 55 2.23 Lazy AND (&&) ......................... 55 2.24 OR (!) ............................... 56 2.25 Lazy OR (||) ............................ 57 2.26 XOR (!!) .............................. 57 2.27 Pattern Matching (?) ....................... 58 2.28 Hexadecimal (#) ......................... 61 3 Commands 63 3.1 CLOSE .............................. 63 3.2 DO ................................. 65 3.3 ELSE ............................... 67 3.4 FOR ................................ 67 3.5 GOTO ............................... 71 3.6 HALT ............................... 72 3.7 HANG ............................... 73 3.8 IF ................................. 75 3.9 JOB ................................ 77 3.10 KILL ................................ 79 3.11 KSUBSCRIPTS .......................... 81 3.12 KVALUE ............................. 83 3.13 LOCK ............................... 84 3.14 MERGE .............................. 88 3.15 NEW ................................ 90 3.16 OPEN ............................... 94 CONTENTS 5 3.17 QUIT ............................... 96 3.18 READ ............................... 97 3.19 SET ................................ 101 3.20 TCOMMIT ............................ 112 3.21 TROLLBACK ........................... 112 3.22 TSTART .............................. 113 3.23 USE ................................ 115 3.24 WRITE .............................. 116 3.25 XECUTE ............................. 120 4 Z - Commands 123 4.1 ZNEW ............................... 123 4.2 ZNSPACE ............................. 125 4.3 ZPRINT .............................. 126 4.4 ZSYNC .............................. 129 4.5 ZTRAP .............................. 130 4.6 ZWRITE ............................. 131 4.7 ZZDUMP ............................. 133 5 Standard Functions 135 5.1 $ASCII ............................... 135 5.2 $BIT ................................ 136 5.3 $BITCOUNT ........................... 136 5.4 $BITFIND ............................. 137 5.5 $BITLOGIC ............................ 138 5.6 $CHAR .............................. 140 5.7 $DATA ............................... 141 5.8 $EXTRACT ............................ 143 5.9 $FIND ............................... 144 5.10 $FNUMBER ........................... 145 5.11 $GET ............................... 147 5.12 $JUSTIFY ............................. 148 5.13 $INCREMENT .......................... 149 5.14 $LENGTH ............................. 150 5.15 $LIST ............................... 151 5.16 $LISTBUILD ........................... 153 5.17 $LISTDATA ............................ 155 5.18 $LISTFIND ............................ 156 5.19 $LISTFROMSTRING ...................... 158 5.20 $LISTGET ............................ 159 5.21 $LISTLENGTH .......................... 161 6 CONTENTS 5.22 $LISTSAME ........................... 162 5.23 $LISTTOSTRING ........................ 163 5.24 $LISTVALID ........................... 164 5.25 $NAME .............................. 165 5.26 $ORDER ............................. 166 5.27 $PIECE .............................. 169 5.28 $QLENGTH ............................ 170 5.29 $QSUBSCRIPT .......................... 171 5.30 $QUERY ............................. 173 5.31 $RANDOM ............................ 175 5.32 $REPLACE ............................ 176 5.33 $REVERSE ............................ 177 5.34 $SELECT ............................. 178 5.35 $STACK .............................. 179 5.36 $TEXT .............................. 180 5.37 $TRANSLATE .......................... 182 5.38 $VIEW .............................. 183 5.38.1 $VIEW(”db”) ....................... 183 5.38.2 $VIEW(”dev”) ...................... 188 5.38.3 $VIEW(”err”) ....................... 191 5.38.4 $VIEW(”file”) ....................... 192 5.38.5 $VIEW(”jrnl”) ...................... 196 5.38.6 $VIEW(”lock”) ...................... 203 5.38.7 $VIEW(”log”) ....................... 204 5.38.8 $VIEW(”perf”) ...................... 204 5.38.9 $VIEW(”proc”) ...................... 205 5.38.10 $VIEW(”rou”) ...................... 208 6 Z - Functions 211 6.1 $ZABS ............................... 211 6.2 $ZARCCOS ............................ 212 6.3 $ZARCSIN ............................ 212 6.4 $ZARCTAN ............................ 213 6.5 $ZBITAND ............................ 213 6.6 $ZBITCAT ............................ 214 6.7 $ZBITCOUNT .......................... 214 6.8 $ZBITEXTRACT ......................... 215 6.9 $ZBITFIND ............................ 216 6.10 $ZBITGET ............................ 217 6.11 $ZBITLEN ............................ 217 6.12 $ZBITNOT ............................ 218 CONTENTS 7 6.13 $ZBITOR ............................. 218 6.14 $ZBITROT ............................ 219 6.15 $ZBITSET ............................. 220 6.16 $ZBITSTR ............................ 221 6.17 $ZBITXOR ............................ 221 6.18 $ZBOOLEAN ........................... 222 6.19 $ZCOS ............................... 224 6.20 $ZCOT .............................. 225 6.21 $ZCRC ............................... 225 6.22 $ZCSC ............................... 227 6.23 $ZCONVERT ........................... 227 6.24 $ZDATE .............................. 229 6.25 $ZDATEH ............................. 231 6.26 $ZDLL ............................... 233 6.27 $ZEXP ............................... 235 6.28 $ZLASCII ............................. 235 6.29 $ZLCHAR ............................. 236 6.30 $ZLCASE ............................. 237 6.31 $ZLN ................................ 237 6.32 $ZLOG .............................. 238 6.33 $ZLOWER ............................ 239 6.34 $ZPCREMATCH ......................... 239 6.35 $ZPCREREPLACE ........................ 240 6.36 $ZPCRESEARCH ........................ 242 6.37 $ZPOWER ............................ 243 6.38 $ZPREVIOUS ........................... 244 6.39 $ZQASCII ............................. 245 6.40 $ZQCHAR ............................. 246 6.41 $ZQUOTE ............................. 247 6.42 $ZSEC ............................... 248 6.43 $ZSIN ............................... 249 6.44 $ZSQR ............................... 249 6.45 $ZTAN ............................... 250 6.46 $ZTIME .............................. 250 6.47 $ZTIMEH ............................. 251 6.48 $ZUCASE ............................. 252 6.49 $ZUPPER ............................. 253 6.50 $ZVERSION ........................... 253 6.51 $ZWASCII ............................. 254 6.52 $ZWCHAR ............................ 255 8 CONTENTS 7 System Variables 257 7.1 $DEVICE ............................. 257 7.2 $HOROLOG ........................... 258 7.3 $ECODE ............................. 259 7.4 $ESTACK ............................. 261 7.5 $ETRAP .............................. 261 7.6 $IO ................................. 262 7.7 $JOB ................................ 263 7.8 $KEY ............................... 264 7.9 $PRINCIPAL ........................... 265 7.10 $QUIT ............................... 265 7.11 $REFERENCE .......................... 266 7.12 $STACK .............................. 267 7.13 $STORAGE ...........................