-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjson
More file actions
859 lines (859 loc) · 35.8 KB
/
Copy pathjson
File metadata and controls
859 lines (859 loc) · 35.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
{
"engine": "BASIC++",
"version": "6.5.2",
"edition": "Standard & Lite Unified",
"license": "Copyleft (c) 2026 BASIC++ Community",
"total_keywords": 116,
"keywords": [
{
"name": "RND",
"category": "Math Functions",
"syntax": "RND[(x)]",
"help_text": "Returns a double-precision pseudo-random number in range [0.0, 1.0). If x < 0, seeds generator.",
"error_codes": "Error 13: Type Mismatch (non-numeric argument)"
},
{
"name": "INT",
"category": "Math Functions",
"syntax": "INT(x)",
"help_text": "Returns the largest integer less than or equal to x (floor conversion).",
"error_codes": "Error 13: Type Mismatch (INT expects one numeric argument)"
},
{
"name": "ABS",
"category": "Math Functions",
"syntax": "ABS(x)",
"help_text": "Returns the absolute value of a numeric expression.",
"error_codes": "Error 13: Type Mismatch (ABS expects one numeric argument)"
},
{
"name": "SQR",
"category": "Math Functions",
"syntax": "SQR(x)",
"help_text": "Returns the non-negative square root of a numeric expression x >= 0.",
"error_codes": "Error 5: Illegal Function Call (SQR of negative number), Error 13: Type Mismatch (SQR expects one numeric argument)"
},
{
"name": "SIN",
"category": "Math Functions",
"syntax": "SIN(radians)",
"help_text": "Returns the trigonometric sine of an angle given in radians.",
"error_codes": "Error 13: Type Mismatch (SIN expects one numeric argument)"
},
{
"name": "COS",
"category": "Math Functions",
"syntax": "COS(radians)",
"help_text": "Returns the trigonometric cosine of an angle given in radians.",
"error_codes": "Error 13: Type Mismatch (COS expects one numeric argument)"
},
{
"name": "TAN",
"category": "Math Functions",
"syntax": "TAN(radians)",
"help_text": "Returns the trigonometric tangent of an angle given in radians.",
"error_codes": "Error 13: Type Mismatch (TAN expects one numeric argument)"
},
{
"name": "ATN",
"category": "Math Functions",
"syntax": "ATN(x)",
"help_text": "Returns the arctangent of a numeric expression in radians.",
"error_codes": "Error 13: Type Mismatch (ATN expects one numeric argument)"
},
{
"name": "LOG",
"category": "Math Functions",
"syntax": "LOG(x)",
"help_text": "Returns the natural logarithm (base e) of a numeric expression x > 0.",
"error_codes": "Error 5: Illegal Function Call (LOG of zero or negative number), Error 13: Type Mismatch (LOG expects one numeric argument)"
},
{
"name": "EXP",
"category": "Math Functions",
"syntax": "EXP(x)",
"help_text": "Returns e raised to the power of a numeric expression x.",
"error_codes": "Error 6: Overflow (EXP exponent too large), Error 13: Type Mismatch (EXP expects one numeric argument)"
},
{
"name": "ACOS",
"category": "Math Functions",
"syntax": "ACOS(x)",
"help_text": "Returns the arccosine of x in radians for -1.0 <= x <= 1.0.",
"error_codes": "Error 5: Illegal Function Call (ACOS argument out of range [-1, 1]), Error 13: Type Mismatch (ACOS expects one numeric argument)"
},
{
"name": "ASIN",
"category": "Math Functions",
"syntax": "ASIN(x)",
"help_text": "Returns the arcsine of x in radians for -1.0 <= x <= 1.0.",
"error_codes": "Error 5: Illegal Function Call (ASIN argument out of range [-1, 1]), Error 13: Type Mismatch (ASIN expects one numeric argument)"
},
{
"name": "ATAN2",
"category": "Math Functions",
"syntax": "ATAN2(y, x)",
"help_text": "Returns the 2-argument arctangent of y and x in radians.",
"error_codes": "Error 13: Type Mismatch (ATAN2 expects two numeric arguments)"
},
{
"name": "CEIL",
"category": "Math Functions",
"syntax": "CEIL(x)",
"help_text": "Returns the smallest integer greater than or equal to x.",
"error_codes": "Error 13: Type Mismatch (CEIL expects one numeric argument)"
},
{
"name": "CLAMP",
"category": "Math Functions",
"syntax": "CLAMP(val, min_val, max_val)",
"help_text": "Clamps a value to be within the range [min_val, max_val].",
"error_codes": "Error 13: Type Mismatch (CLAMP expects three numeric arguments)"
},
{
"name": "FIX",
"category": "Math Functions",
"syntax": "FIX(x)",
"help_text": "Returns the truncated integer part of x (truncates towards zero).",
"error_codes": "Error 13: Type Mismatch (FIX expects one numeric argument)"
},
{
"name": "FLOOR",
"category": "Math Functions",
"syntax": "FLOOR(x)",
"help_text": "Returns the largest integer less than or equal to x.",
"error_codes": "Error 13: Type Mismatch (FLOOR expects one numeric argument)"
},
{
"name": "LERP",
"category": "Math Functions",
"syntax": "LERP(a, b, t)",
"help_text": "Performs linear interpolation between a and b using weight t (a + (b - a) * t).",
"error_codes": "Error 13: Type Mismatch (LERP expects three numeric arguments)"
},
{
"name": "PI",
"category": "Math Functions",
"syntax": "PI()",
"help_text": "Returns the mathematical constant pi (~3.141592653589793).",
"error_codes": "Error 5: Illegal Function Call (PI expects 0 arguments)"
},
{
"name": "ROUND",
"category": "Math Functions",
"syntax": "ROUND(x [, decimals])",
"help_text": "Rounds a numeric expression x to the specified number of decimal places (default 0).",
"error_codes": "Error 13: Type Mismatch (ROUND expects 1 or 2 numeric arguments)"
},
{
"name": "SGN",
"category": "Math Functions",
"syntax": "SGN(x)",
"help_text": "Returns the sign of x: 1 if x > 0, 0 if x = 0, -1 if x < 0.",
"error_codes": "Error 13: Type Mismatch (SGN expects one numeric argument)"
},
{
"name": "BIN$",
"category": "String Functions",
"syntax": "BIN$(x)",
"help_text": "Returns the binary string representation of integer x.",
"error_codes": "Error 13: Type Mismatch (BIN$ expects one numeric argument)"
},
{
"name": "CHR$",
"category": "String Functions",
"syntax": "CHR$(code)",
"help_text": "Returns a 1-character string containing the character corresponding to ASCII code (0-255).",
"error_codes": "Error 5: Illegal Function Call (code out of range 0-255), Error 13: Type Mismatch (CHR$ expects one numeric argument)"
},
{
"name": "HEX$",
"category": "String Functions",
"syntax": "HEX$(x)",
"help_text": "Returns the hexadecimal string representation of integer x.",
"error_codes": "Error 13: Type Mismatch (HEX$ expects one numeric argument)"
},
{
"name": "INSTR",
"category": "String Functions",
"syntax": "INSTR([start,] str$, match$)",
"help_text": "Returns the 1-based position of the first occurrence of match$ in str$. Returns 0 if not found.",
"error_codes": "Error 5: Illegal Function Call (start <= 0), Error 13: Type Mismatch (expects string arguments)"
},
{
"name": "LCASE$",
"category": "String Functions",
"syntax": "LCASE$(str$)",
"help_text": "Returns a copy of str$ with all uppercase letters converted to lowercase.",
"error_codes": "Error 13: Type Mismatch (LCASE$ expects one string argument)"
},
{
"name": "LEFT$",
"category": "String Functions",
"syntax": "LEFT$(str$, n)",
"help_text": "Returns the leftmost n characters of str$.",
"error_codes": "Error 5: Illegal Function Call (n < 0), Error 13: Type Mismatch (LEFT$ expects string and numeric arguments)"
},
{
"name": "LEN",
"category": "String Functions",
"syntax": "LEN(str$)",
"help_text": "Returns the number of characters in str$.",
"error_codes": "Error 13: Type Mismatch (LEN expects one string argument)"
},
{
"name": "LTRIM$",
"category": "String Functions",
"syntax": "LTRIM$(str$)",
"help_text": "Returns a copy of str$ with leading whitespace removed.",
"error_codes": "Error 13: Type Mismatch (LTRIM$ expects one string argument)"
},
{
"name": "MID$",
"category": "String Functions",
"syntax": "MID$(str$, start [, length])",
"help_text": "Returns a substring of str$ starting at 1-based index start for length characters.",
"error_codes": "Error 5: Illegal Function Call (start <= 0 or length < 0), Error 13: Type Mismatch (MID$ argument type error)"
},
{
"name": "OCT$",
"category": "String Functions",
"syntax": "OCT$(x)",
"help_text": "Returns the octal string representation of integer x.",
"error_codes": "Error 13: Type Mismatch (OCT$ expects one numeric argument)"
},
{
"name": "PACK$",
"category": "String Functions",
"syntax": "PACK$(fmt$, val1 [, val2, ...])",
"help_text": "Packs binary data values into a binary string according to format template fmt$.",
"error_codes": "Error 5: Illegal Function Call (invalid format character), Error 13: Type Mismatch (expects string format)"
},
{
"name": "RIGHT$",
"category": "String Functions",
"syntax": "RIGHT$(str$, n)",
"help_text": "Returns the rightmost n characters of str$.",
"error_codes": "Error 5: Illegal Function Call (n < 0), Error 13: Type Mismatch (RIGHT$ expects string and numeric arguments)"
},
{
"name": "RTRIM$",
"category": "String Functions",
"syntax": "RTRIM$(str$)",
"help_text": "Returns a copy of str$ with trailing whitespace removed.",
"error_codes": "Error 13: Type Mismatch (RTRIM$ expects one string argument)"
},
{
"name": "SPACE$",
"category": "String Functions",
"syntax": "SPACE$(n)",
"help_text": "Returns a string consisting of n space characters.",
"error_codes": "Error 5: Illegal Function Call (n < 0), Error 13: Type Mismatch (SPACE$ expects one numeric argument)"
},
{
"name": "STR$",
"category": "String Functions",
"syntax": "STR$(x)",
"help_text": "Returns the string representation of numeric expression x.",
"error_codes": "Error 13: Type Mismatch (STR$ expects one numeric argument)"
},
{
"name": "STRING$",
"category": "String Functions",
"syntax": "STRING$(n, char_spec)",
"help_text": "Returns a string of n repeating characters specified by ASCII code or 1st char of string.",
"error_codes": "Error 5: Illegal Function Call (n < 0), Error 13: Type Mismatch (STRING$ argument type error)"
},
{
"name": "TRIM$",
"category": "String Functions",
"syntax": "TRIM$(str$)",
"help_text": "Returns a copy of str$ with both leading and trailing whitespace removed.",
"error_codes": "Error 13: Type Mismatch (TRIM$ expects one string argument)"
},
{
"name": "UCASE$",
"category": "String Functions",
"syntax": "UCASE$(str$)",
"help_text": "Returns a copy of str$ with all lowercase letters converted to uppercase.",
"error_codes": "Error 13: Type Mismatch (UCASE$ expects one string argument)"
},
{
"name": "UNPACK",
"category": "String Functions",
"syntax": "UNPACK(fmt$, bin_str$)",
"help_text": "Unpacks binary data from bin_str$ according to format template fmt$.",
"error_codes": "Error 5: Illegal Function Call (invalid format character), Error 13: Type Mismatch (expects string arguments)"
},
{
"name": "VAL",
"category": "String Functions",
"syntax": "VAL(str$)",
"help_text": "Returns the numeric value represented by string str$. Returns 0 if str$ is not a valid number.",
"error_codes": "Error 13: Type Mismatch (VAL expects one string argument)"
},
{
"name": "BITCOUNT",
"category": "Bitwise Functions",
"syntax": "BITCOUNT(x)",
"help_text": "Returns the number of set bits (population count) in integer x.",
"error_codes": "Error 13: Type Mismatch (BITCOUNT expects one numeric argument)"
},
{
"name": "READBIT",
"category": "Bitwise Functions",
"syntax": "READBIT(val, bit_pos)",
"help_text": "Returns the bit value (0 or 1) at bit_pos (0-63) of integer val.",
"error_codes": "Error 5: Illegal Function Call (bit_pos out of range 0-63), Error 13: Type Mismatch (expects numeric arguments)"
},
{
"name": "RESETBIT",
"category": "Bitwise Functions",
"syntax": "RESETBIT(val, bit_pos)",
"help_text": "Returns val with the bit at bit_pos (0-63) cleared to 0.",
"error_codes": "Error 5: Illegal Function Call (bit_pos out of range 0-63), Error 13: Type Mismatch (expects numeric arguments)"
},
{
"name": "SETBIT",
"category": "Bitwise Functions",
"syntax": "SETBIT(val, bit_pos)",
"help_text": "Returns val with the bit at bit_pos (0-63) set to 1.",
"error_codes": "Error 5: Illegal Function Call (bit_pos out of range 0-63), Error 13: Type Mismatch (expects numeric arguments)"
},
{
"name": "SHL",
"category": "Bitwise Functions",
"syntax": "SHL(val, shift_bits)",
"help_text": "Performs a bitwise left shift on integer val by shift_bits.",
"error_codes": "Error 5: Illegal Function Call (shift_bits < 0 or >= 64), Error 13: Type Mismatch (expects numeric arguments)"
},
{
"name": "SHR",
"category": "Bitwise Functions",
"syntax": "SHR(val, shift_bits)",
"help_text": "Performs a bitwise right shift on integer val by shift_bits.",
"error_codes": "Error 5: Illegal Function Call (shift_bits < 0 or >= 64), Error 13: Type Mismatch (expects numeric arguments)"
},
{
"name": "TOGGLEBIT",
"category": "Bitwise Functions",
"syntax": "TOGGLEBIT(val, bit_pos)",
"help_text": "Returns val with the bit at bit_pos (0-63) inverted (toggled).",
"error_codes": "Error 5: Illegal Function Call (bit_pos out of range 0-63), Error 13: Type Mismatch (expects numeric arguments)"
},
{
"name": "CLOCK",
"category": "System Functions",
"syntax": "CLOCK()",
"help_text": "Returns the current system Unix timestamp in seconds.",
"error_codes": "Error 5: Illegal Function Call (CLOCK expects 0 arguments)"
},
{
"name": "CLOCK$",
"category": "System Functions",
"syntax": "CLOCK$()",
"help_text": "Returns the current ISO 8601 formatted date/time string (YYYY-MM-DD HH:MM:SS).",
"error_codes": "Error 5: Illegal Function Call (CLOCK$ expects 0 arguments)"
},
{
"name": "DATE$",
"category": "System Functions",
"syntax": "DATE$()",
"help_text": "Returns the current system date as a string (MM-DD-YYYY).",
"error_codes": "Error 5: Illegal Function Call (DATE$ expects 0 arguments)"
},
{
"name": "ENVIRON$",
"category": "System Functions",
"syntax": "ENVIRON$(var_name$)",
"help_text": "Returns the value of host environment variable var_name$. Returns empty string if not set.",
"error_codes": "Error 13: Type Mismatch (ENVIRON$ expects one string argument)"
},
{
"name": "FRE",
"category": "System Functions",
"syntax": "FRE(dummy)",
"help_text": "Returns the number of available free memory bytes in the VM heap.",
"error_codes": "Error 13: Type Mismatch (FRE expects 1 argument)"
},
{
"name": "INKEY$",
"category": "System Functions",
"syntax": "INKEY$()",
"help_text": "Reads a character non-blockingly from console buffer. Returns empty string if no key pressed.",
"error_codes": "Error 5: Illegal Function Call (INKEY$ expects 0 arguments)"
},
{
"name": "INP",
"category": "System Functions",
"syntax": "INP(port)",
"help_text": "Reads a byte (0-255) from hardware I/O port address.",
"error_codes": "Error 5: Illegal Function Call (port out of bounds), Error 13: Type Mismatch (expects numeric port)"
},
{
"name": "PEEK",
"category": "System Functions",
"syntax": "PEEK(addr)",
"help_text": "Reads a byte (0-255) from virtual memory address addr.",
"error_codes": "Error 5: Illegal Function Call (addr out of memory bounds), Error 13: Type Mismatch (expects numeric address)"
},
{
"name": "TICKS",
"category": "System Functions",
"syntax": "TICKS()",
"help_text": "Returns the number of milliseconds elapsed since system start / platform boot.",
"error_codes": "Error 5: Illegal Function Call (TICKS expects 0 arguments)"
},
{
"name": "TIME$",
"category": "System Functions",
"syntax": "TIME$()",
"help_text": "Returns the current system time as a string (HH:MM:SS).",
"error_codes": "Error 5: Illegal Function Call (TIME$ expects 0 arguments)"
},
{
"name": "TIMER",
"category": "System Functions",
"syntax": "TIMER()",
"help_text": "Returns the number of seconds elapsed since midnight.",
"error_codes": "Error 5: Illegal Function Call (TIMER expects 0 arguments)"
},
{
"name": "GOTO",
"category": "Control Flow",
"syntax": "GOTO line_num",
"help_text": "Unconditionally transfers execution to the specified program line number.",
"error_codes": "Error 8: Undefined line number (target line does not exist), Error 2: Syntax error (missing line number)"
},
{
"name": "GOSUB",
"category": "Control Flow",
"syntax": "GOSUB line_num",
"help_text": "Pushes current line onto stack and branches execution to specified subroutine line number.",
"error_codes": "Error 8: Undefined line number (subroutine target missing), Error 2: Syntax error (missing line number)"
},
{
"name": "RETURN",
"category": "Control Flow",
"syntax": "RETURN [line_num]",
"help_text": "Returns control from a GOSUB subroutine to the statement following GOSUB, or specified line.",
"error_codes": "Error 3: RETURN without GOSUB (call stack empty)"
},
{
"name": "IF",
"category": "Control Flow",
"syntax": "IF expr THEN stmt/line [ELSE stmt/line]",
"help_text": "Evaluates boolean expression expr and executes THEN clause if true, ELSE clause if false.",
"error_codes": "Error 2: Syntax error (missing THEN or malformed expression)"
},
{
"name": "END",
"category": "Control Flow",
"syntax": "END [IF | SUB | FUNCTION | SELECT | STRUCT]",
"help_text": "Terminates program execution or closes structured block definitions.",
"error_codes": "Error 2: Syntax error (mismatched block terminator)"
},
{
"name": "REM",
"category": "Control Flow",
"syntax": "REM [comment text] or ' [comment text]",
"help_text": "Defines a remark/comment line ignored by the BASIC engine during execution.",
"error_codes": "None (comments never generate errors)"
},
{
"name": "STOP",
"category": "Control Flow",
"syntax": "STOP",
"help_text": "Pauses program execution and prints 'Break in line X' message.",
"error_codes": "None (STOP halts program execution cleanly)"
},
{
"name": "PRINT",
"category": "Console I/O",
"syntax": "PRINT [#n,] [exprlist] [;|,]",
"help_text": "Outputs formatted text or numeric expressions to the console or open file channel.",
"error_codes": "Error 2: Syntax Error, Error 13: Type Mismatch, Error 52: Bad File Number"
},
{
"name": "INPUT",
"category": "Console I/O",
"syntax": "INPUT [;] [\"prompt\"{;|,}] var1[, var2...]",
"help_text": "Prompts the user or reads values from console input into target variables.",
"error_codes": "Error 2: Syntax Error, Error 13: Type Mismatch, Error 52: Bad File Number"
},
{
"name": "SELECT",
"category": "Control Flow",
"syntax": "SELECT CASE test_expression ... CASE expression_list ... END SELECT",
"help_text": "Executes one of several blocks of statements depending on the value of an expression.",
"error_codes": "Error 2: Syntax Error, Error 13: Type Mismatch, Error 37: SELECT Without CASE"
},
{
"name": "FOR",
"category": "Looping / Control Flow",
"syntax": "FOR var = start TO end [STEP step]",
"help_text": "Initiates a counter-controlled loop block executing statements until var reaches end.",
"error_codes": "Error 2: Syntax Error, Error 13: Type Mismatch, Error 26: FOR Without NEXT"
},
{
"name": "NEXT",
"category": "Looping / Control Flow",
"syntax": "NEXT [var1[, var2...]]",
"help_text": "Increments the FOR loop counter variable and loops back if target bound has not been exceeded.",
"error_codes": "Error 1: NEXT Without FOR, Error 2: Syntax Error"
},
{
"name": "WHILE",
"category": "Looping / Control Flow",
"syntax": "WHILE condition",
"help_text": "Executes a series of statements in a loop as long as condition evaluates to non-zero (true).",
"error_codes": "Error 2: Syntax Error, Error 30: WHILE Without WEND"
},
{
"name": "WEND",
"category": "Looping / Control Flow",
"syntax": "WEND",
"help_text": "Terminates a WHILE...WEND loop block and transfers control back to the matching WHILE statement.",
"error_codes": "Error 29: WEND Without WHILE, Error 2: Syntax Error"
},
{
"name": "DO",
"category": "Looping / Control Flow",
"syntax": "DO [{WHILE|UNTIL} condition]",
"help_text": "Initiates a structured DO...LOOP block, optionally evaluating a WHILE or UNTIL pre-condition.",
"error_codes": "Error 2: Syntax Error, Error 31: DO Without LOOP"
},
{
"name": "LOOP",
"category": "Looping / Control Flow",
"syntax": "LOOP [{WHILE|UNTIL} condition]",
"help_text": "Terminates a DO...LOOP block, optionally evaluating a post-condition test.",
"error_codes": "Error 32: LOOP Without DO, Error 2: Syntax Error"
},
{
"name": "EXIT",
"category": "Looping / Control Flow",
"syntax": "EXIT {FOR|DO|WHILE|SUB|FUNCTION}",
"help_text": "Prematurely exits an active loop, SUB, or FUNCTION block.",
"error_codes": "Error 2: Syntax Error, Error 33: Invalid EXIT Scope"
},
{
"name": "OPEN",
"category": "Filesystem I/O",
"syntax": "OPEN filespec [FOR mode] AS [#]file_num [LEN=reclen]",
"help_text": "Opens a file channel for INPUT, OUTPUT, APPEND, BINARY, or RANDOM I/O operations.",
"error_codes": "Error 2: Syntax Error, Error 52: Bad File Number, Error 53: File Not Found, Error 55: File Already Open"
},
{
"name": "CLOSE",
"category": "Filesystem I/O",
"syntax": "CLOSE [[#]file_num1[, [#]file_num2...]]",
"help_text": "Closes open file channels, flushing pending I/O buffers to disk.",
"error_codes": "Error 2: Syntax Error, Error 52: Bad File Number"
},
{
"name": "GET",
"category": "Filesystem I/O",
"syntax": "GET [#]file_num [, record_number]",
"help_text": "Reads a record from a random-access file into the FIELD buffer.",
"error_codes": "Error 2: Syntax Error, Error 52: Bad File Number, Error 63: Bad Record Number"
},
{
"name": "PUT",
"category": "Filesystem I/O",
"syntax": "PUT [#]file_num [, record_number]",
"help_text": "Writes a record from the FIELD buffer into a random-access file.",
"error_codes": "Error 2: Syntax Error, Error 52: Bad File Number, Error 63: Bad Record Number"
},
{
"name": "FIELD",
"category": "Filesystem I/O",
"syntax": "FIELD [#]file_num, width AS string_var [, width AS string_var...]",
"help_text": "Allocates space in a random file buffer for record variables.",
"error_codes": "Error 2: Syntax Error, Error 50: Field Overflow, Error 52: Bad File Number"
},
{
"name": "FILES",
"category": "Filesystem I/O",
"syntax": "FILES [filespec]",
"help_text": "Displays directory listing matching specified file pattern.",
"error_codes": "Error 2: Syntax Error, Error 53: File Not Found, Error 70: Permission Denied"
},
{
"name": "KILL",
"category": "Filesystem I/O",
"syntax": "KILL filespec",
"help_text": "Deletes specified file from disk storage.",
"error_codes": "Error 2: Syntax Error, Error 53: File Not Found, Error 70: Permission Denied"
},
{
"name": "MKDIR",
"category": "Filesystem I/O",
"syntax": "MKDIR pathspec",
"help_text": "Creates a new directory on disk.",
"error_codes": "Error 2: Syntax Error, Error 75: Path/File Access Error, Error 76: Path Not Found"
},
{
"name": "NAME",
"category": "Filesystem I/O",
"syntax": "NAME oldspec AS newspec",
"help_text": "Renames an existing disk file or directory.",
"error_codes": "Error 2: Syntax Error, Error 53: File Not Found, Error 58: File Already Exists"
},
{
"name": "SEEK",
"category": "Filesystem I/O",
"syntax": "SEEK [#]file_num, position",
"help_text": "Sets the byte offset position for the next read or write operation on an open file.",
"error_codes": "Error 2: Syntax Error, Error 52: Bad File Number, Error 63: Bad Record Number"
},
{
"name": "SCREEN",
"category": "Graphics & Display",
"syntax": "SCREEN mode [, [colorswitch] [, [active_page] [, visual_page]]]",
"help_text": "Sets text or visual graphics display mode, screen resolution, and active palette pages.",
"error_codes": "Error 2: Syntax Error, Error 5: Illegal Function Call"
},
{
"name": "CLS",
"category": "Graphics & Display",
"syntax": "CLS [n]",
"help_text": "Clears display: CLS -1 (text viewport), CLS -2 (graphics viewport), CLS -3 (full buffer, default), or CLS n (0-15 background color clear).",
"error_codes": "Error 2: Syntax Error, Error 5: Illegal Function Call"
},
{
"name": "HOME",
"category": "Graphics & Display",
"syntax": "HOME [n]",
"help_text": "Moves text cursor to top-left corner (1, 1) without clearing text screen, optionally changing text color to n (0-15).",
"error_codes": "Error 2: Syntax Error, Error 5: Illegal Function Call"
},
{
"name": "COLOR",
"category": "Graphics & Display",
"syntax": "COLOR [foreground] [, [background] [, border]]",
"help_text": "Sets active foreground, background, and border display colors.",
"error_codes": "Error 2: Syntax Error, Error 5: Illegal Function Call"
},
{
"name": "LINE",
"category": "Graphics & Display",
"syntax": "LINE [[x1, y1]]-(x2, y2) [, [color] [, [B|BF] [, style]]]",
"help_text": "Draws a straight line or box on the active graphics screen canvas.",
"error_codes": "Error 2: Syntax Error, Error 5: Illegal Function Call"
},
{
"name": "CIRCLE",
"category": "Graphics & Display",
"syntax": "CIRCLE (x, y), radius [, [color] [, [start] [, [end] [, aspect]]]]",
"help_text": "Draws a circle, ellipse, or arc on the active graphics screen canvas.",
"error_codes": "Error 2: Syntax Error, Error 5: Illegal Function Call"
},
{
"name": "SOUND",
"category": "Sound & Audio",
"syntax": "SOUND frequency, duration",
"help_text": "Generates a tone of specified frequency in Hertz for specified duration in clock ticks.",
"error_codes": "Error 2: Syntax Error, Error 5: Illegal Function Call"
},
{
"name": "PLAY",
"category": "Sound & Audio",
"syntax": "PLAY command_string",
"help_text": "Plays musical notes using MML (Music Macro Language) command string.",
"error_codes": "Error 2: Syntax Error, Error 5: Illegal Function Call"
},
{
"name": "BEEP",
"category": "Sound & Audio",
"syntax": "BEEP",
"help_text": "Emits a standard 800 Hz speaker beep tone for 0.25 seconds.",
"error_codes": "Error 2: Syntax Error"
},
{
"name": "VOICE",
"category": "Sound & Audio",
"syntax": "VOICE channel, waveform, attack, decay, sustain, release",
"help_text": "Configures synthesizer voice envelope parameters (ADSR) for multi-channel sound output.",
"error_codes": "Error 2: Syntax Error, Error 5: Illegal Function Call"
},
{
"name": "ON KEY",
"category": "Event Trapping",
"syntax": "ON KEY(n) GOSUB line_label | KEY(n) {ON|OFF|STOP} | KEY ON | KEY OFF | KEY n, string",
"help_text": "Establishes an asynchronous interrupt handler for function key presses, or toggles/customizes row 25 function key labels.",
"error_codes": "Error 2: Syntax Error, Error 5: Illegal Function Call"
},
{
"name": "ON TIMER",
"category": "Event Trapping",
"syntax": "ON TIMER(seconds) GOSUB line_label | TIMER {ON|OFF|STOP}",
"help_text": "Establishes a periodic timer interrupt subroutine trigger.",
"error_codes": "Error 2: Syntax Error, Error 5: Illegal Function Call"
},
{
"name": "ON ERROR",
"category": "Event Trapping",
"syntax": "ON ERROR GOTO {line_label | 0}",
"help_text": "Enables error-trapping routine and specifies the first statement of the handler.",
"error_codes": "Error 2: Syntax Error, Error 5: Illegal Function Call"
},
{
"name": "RESUME",
"category": "Event Trapping",
"syntax": "RESUME [0 | NEXT | line_label]",
"help_text": "Resumes program execution after an error-handling routine finishes.",
"error_codes": "Error 20: RESUME Without Error, Error 2: Syntax Error"
},
{
"name": "TRY",
"category": "Event Trapping",
"syntax": "TRY ... CATCH err_var ... FINALLY ... END TRY",
"help_text": "Structured exception-handling block supporting TRY, CATCH, FINALLY, and END TRY.",
"error_codes": "Error 2: Syntax Error, Error 35: TRY Without CATCH/FINALLY"
},
{
"name": "MAT INPUT",
"category": "Matrix Operations",
"syntax": "MAT INPUT [#file_num,] array_name [(num_rows [, num_cols])]",
"help_text": "Reads numeric or string matrix elements from console input or an open file stream.",
"error_codes": "Error 2: Syntax Error, Error 9: Subscript Out of Range, Error 13: Type Mismatch"
},
{
"name": "MAT PRINT",
"category": "Matrix Operations",
"syntax": "MAT PRINT [#file_num,] array_name [;|,]",
"help_text": "Outputs formatted 1D or 2D matrix array elements to console or file stream.",
"error_codes": "Error 2: Syntax Error, Error 9: Subscript Out of Range, Error 13: Type Mismatch"
},
{
"name": "MAT READ",
"category": "Matrix Operations",
"syntax": "MAT READ array_name [(num_rows [, num_cols])]",
"help_text": "Populates matrix elements sequentially from DATA statements.",
"error_codes": "Error 2: Syntax Error, Error 4: Out of DATA, Error 9: Subscript Out of Range"
},
{
"name": "SCOPE",
"category": "Introspection",
"syntax": "SCOPE [BEGIN | END | DISABLE kw | ENABLE kw | HOOK ... | MODULE name | PRIVATE sym]",
"help_text": "Manages lexical scope blocks, keyword enablement, execution hooks, and symbol protection.",
"error_codes": "Error 2: Syntax Error, Error 13: Permission Denied"
},
{
"name": "HELP",
"category": "Introspection",
"syntax": "HELP [keyword | command | block_target]",
"help_text": "Displays interactive help documentation for statements, functions, syntax, and system components.",
"error_codes": "Error 2: Syntax Error"
},
{
"name": "REFORMAT",
"category": "Program Mgmt & Editing",
"syntax": "REFORMAT [spaces_per_indent] [target] [CHECK|STRICT|SPLIT|UPPER|LOWER|PRESERVE|SPACES]",
"help_text": "Reformats BASIC source code with configurable indentation and static structural analysis.",
"error_codes": "Error 2: Syntax Error"
},
{
"name": "CHECK",
"category": "Debug & Testing",
"syntax": "CHECK [SUMMARY|DETAILED|JSON]",
"help_text": "Executes static analysis on active program in memory and outputs summary, detailed, or JSON metrics.",
"error_codes": "Error 2: Syntax Error"
},
{
"name": "VERIFY",
"category": "Debug & Testing",
"syntax": "VERIFY [\"filename.bas\"] [SUMMARY|DETAILED|JSON]",
"help_text": "Executes static analysis on external disk file or current program in isolated temporary memory.",
"error_codes": "Error 2: Syntax Error, Error 53: File Not Found"
},
{
"name": "TEST",
"category": "Debug & Testing",
"syntax": "TEST \"Suite Name\" | ENDTEST",
"help_text": "Begins or ends a declarative unit test suite block and outputs assertion metrics.",
"error_codes": "Error 2: Syntax Error"
},
{
"name": "DEBUG",
"category": "Debug & Testing",
"syntax": "DEBUG [ON|OFF|DUMP|STACK|MEMORY|VARS] | TRACE | TRON | TROFF | BREAK | CONT | BACKTRACE | INFO | DUMP",
"help_text": "Master interactive debugger control, execution tracing, breakpoint handling, and system introspection suite.",
"error_codes": "Error 2: Syntax Error, Error 99: Assertion Failed"
},
{
"name": "VERSION",
"category": "System & Environ",
"syntax": "VERSION \"1.2.0\" | VER | VER$([target$])",
"help_text": "Tags or queries active program version metadata and host engine version.",
"error_codes": "Error 2: Syntax Error"
},
{
"name": "VARPTR",
"category": "Variables & Memory",
"syntax": "VARPTR(var) | VARPTR$(var)",
"help_text": "Returns the 64-bit integer memory address or descriptor string for a variable.",
"error_codes": "Error 2: Syntax Error"
},
{
"name": "HOSTNAME",
"category": "Introspection",
"syntax": "HOSTNAME",
"help_text": "Outputs the system hostname to console.",
"error_codes": "Error 70: Permission Denied"
},
{
"name": "USERNAME",
"category": "Introspection",
"syntax": "USERNAME",
"help_text": "Outputs the current user identity name to console.",
"error_codes": "Error 70: Permission Denied"
},
{
"name": "SELFTEST",
"category": "System",
"syntax": "SELFTEST",
"help_text": "Executes internal diagnostic suite verifying lexer, memory, string, variable, and array subsystems.",
"error_codes": "Error 1001-5003: Subsystem Diagnostic Failure"
}
],
"c_api_layers": [
{
"layer": 1,
"name": "Embedding & Lifecycle",
"headers": ["bpp_api.h", "boot.h", "vm.h", "config.h"],
"description": "Core interpreter initialization, script execution, evaluation, and shutdown."
},
{
"layer": 2,
"name": "Language Core",
"headers": ["lexer.h", "eval.h", "stmt.h", "types.h", "variables.h", "arrays.h", "strings.h"],
"description": "Tokenizer, AST evaluation, variables, string pool, and array management."
},
{
"layer": 3,
"name": "Runtime Extensions",
"headers": ["file.h", "funcreg.h", "map.h", "struct_ctx.h", "task.h", "metadata.h"],
"description": "File I/O channels, DEF FN registry, maps, UDT structs, and multitasking."
},
{
"layer": 4,
"name": "Virtual Devices & I/O",
"headers": ["vdev.h", "vcon.h", "vfs.h", "vnet.h", "bus.h", "usb.h", "fujinet.h"],
"description": "Virtual consoles, VFS filesystem abstraction, networking, and hardware bus."
},
{
"layer": 5,
"name": "Graphics & Sound",
"headers": ["bgi.h", "bios.h"],
"description": "Borland Graphics Interface (BGI) rasterizer and authentic IBM PC BIOS emulation."
},
{
"layer": 6,
"name": "Security & Modules",
"headers": ["security.h", "module.h"],
"description": "Capability security sandbox and dynamic C module loading pipeline."
}
]
}