File: reference.html

package info (click to toggle)
pcbasic 2.0.7-9
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 35,416 kB
  • sloc: python: 28,411; sh: 103; makefile: 10
file content (11682 lines) | stat: -rw-r--r-- 575,864 bytes parent folder | download | duplicates (2)
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
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
<!--
    PC-BASIC documentation
    Copyright (c) 2014-2022 Rob Hagemans
    This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
    http://creativecommons.org/licenses/by-sa/4.0/legalcode
-->

<article>
<h2 id="reference">Language reference</h2>

<p>
    This documentation describes the PC-BASIC language, which aims to faithfully emulate
    GW-BASIC 3.23, IBM Advanced BASIC, IBM Cartridge BASIC and Tandy 1000 GW-BASIC.
</p>
<p>
    Differences with the original languages do arise, and where this is the case they are documented.
</p>
<p>
    Please note that Microsoft's official documentation for the original languages is rather hit-and-miss;
    it leaves several features undocumented and incorrectly describes others. To avoid making the same errors,
    the present documentation was written from scratch with reference to the actual behaviour.
    The errors in this document are therefore all my own. Please contact me if you encounter them.
</p>
<section>
    <h3 id="metasyntax">Metasyntax</h3>
    <p>
        In descriptions of BASIC syntax, the following conventions apply.
        Exact rendering of the markup may vary depending on the means used
        to display this documentation.
    <p>
    <dl>
        <dt><code><b>bold</b></code></dt>
        <dd>Type exactly as shown.</dd>

        <dt><code><var>italic</var></code></dt>
        <dd>Replace with appropriate metavariable.</dd>

        <dt><code>[a]</code></dt>
        <dd>Entities within square brackets are optional.</dd>

        <dt><code>{ a | b }</code></dt>
        <dd>Disjunct alternatives of which one must be chosen.</dd>

        <dt><code>[ a | b ]</code></dt>
        <dd>Optional disjunct alternatives.</dd>

        <dt><code>a ...</code></dt>
        <dd>Preceding entity can be repeated.</dd>
    </dl>
    <p>
   </p>
</section>
<hr />

<section>
    <h3 id="definitions">Definitions</h3>
    <p>
        A <dfn>program line</dfn> consists of a line number followed by a compound statement.
        Program lines are terminated by a
        <code><i>CR</i></code> or
        or by the end of the file (optionally through an <code><i>EOF</i></code> character).
        Anything on a program line after a <code><i>NUL</i></code> character is ignored.
    </p>
    <p>
        A <dfn>line number</dfn> is a whole number in the range <code>[0&#8212;65535]</code>.
        Note that the line numbers <code>65530&#8212;65535</code> cannot be entered
        from the console or a text program file, but can be part of a tokenised program file.
    </p>
    <p>
        A <dfn>compound statement</dfn> consists of <a href="#statements">statements</a> separated by colons:
        <code class="flow"><var>statement</var> [<b>:</b> <var>statement</var>] ...</code>
    </p>
    <p>
        An <dfn>expression</dfn> takes one of the following forms:
        <code class="flow"><var>unary_operator</var> {<var>literal</var> | <var>variable</var> |
             <var>array_element</var> | <var>function</var>}</code>
        <code class="flow"><var>expression</var> <var>binary_operator</var> <var>expression</var></code>
        <code class="flow"><b>(</b><var>expression</var><b>)</b></code>
        whose elements are described the sections <a href="#literals">Literals</a>,
        <a href="#variables">Variables</a>, <a href="#operators">Operators</a> and
        <a href="#functions">Functions</a>.
    </p>
    <p>
        An <dfn>array element</dfn> takes the form
        <code class="flow"><var>array</var> {<b>[</b>|<b>(</b>} <var>numeric_expression</var> [<b>,</b> <var>numeric_expression</var> ] ... {<b>)</b>|<b>]</b>}</code>
    </p>
</section>
<hr />

<section>
    <h3 id="literals">Literals</h3>

    <h5>String literals</h5>
    <p>
        String literals are of the following form:
        <code class="flow"><b>"</b>[<var>characters</var>]{<b><i>NUL</i></b>|<b><i>CR</i></b>|<b><i>EOF</i></b>|<b>"</b>}</code>
        where <code><var>characters</var></code> is a string of characters. Any
        character from the current code page can be used, with the following
        exceptions, all of which terminate the string literal (aside from other effects they may have):
    </p>
    <ul>
        <li><code><i>NUL</i></code> (<code>CHR$(&amp;h00)</code>)</li>
        <li><code><i>CR</i></code> (<code>CHR$(&amp;h0D)</code>)</li>
        <li><code><i>EOF</i></code> (<code>CHR$(&amp;h1A)</code>)</li>
        <li><code>"</code> (<code>CHR$(&amp;h22)</code>)</li>
    </ul>
    <p>
        Strings are also legally terminated by the end of the file in the absence of
        an <code><i>EOF</i></code> character.
    </p>
    <p>
        Apart from these, string literals should not contain any of the characters
        in the ASCII range <code>&amp;h0D</code>&mdash;<code>&amp;h1F</code>, which lead to unpredictable results.
        There is no escaping mechanism. To include one of the above
        characters in a string, use <a href="#string-operators">string concatenation</a> and
        the <code><a href="#CHR$">CHR$</a></code> function.
    </p>

    <h5>Numeric literals</h5>
    <p>
        Numeric literals have one of the following forms:
        <code class="flow">[<b>+</b>|<b>-</b>] [<b>0</b>|<b>1</b>|<b>2</b>|<b>3</b>|<b>4</b>|<b>5</b>|<b>6</b>|<b>7</b>|<b>8</b>|<b>9</b>]...
            [<b>.</b>][<b>0</b>|<b>1</b>|<b>2</b>|<b>3</b>|<b>4</b>|<b>5</b>|<b>6</b>|<b>7</b>|<b>8</b>|<b>9</b>]...
            [{<b>E</b>|<b>e</b>|<b>D</b>|<b>d</b>}[<b>+</b>|<b>-</b>][<b>0</b>|<b>1</b>|<b>2</b>|<b>3</b>|<b>4</b>|<b>5</b>|<b>6</b>|<b>7</b>|<b>8</b>|<b>9</b>]...]
            |<b>#</b>|<b>!</b>|<b>%</b>]</code>
        <code class="flow"><b>&amp;</b>{<b>H</b>|<b>h</b>}[<b>0</b>|<b>1</b>|<b>2</b>|<b>3</b>|<b>4</b>|<b>5</b>|<b>6</b>|<b>7</b>|<b>8</b>|<b>9</b>|<b>A</b>|<b>B</b>|<b>C</b>|<b>D</b>|<b>E</b>|<b>F</b>|<b>a</b>|<b>b</b>|<b>c</b>|<b>d</b>|<b>e</b>|<b>f</b>]...</code>
        <code class="flow"><b>&amp;</b>[<b>O</b>|<b>o</b>] [<b>0</b>|<b>1</b>|<b>2</b>|<b>3</b>|<b>4</b>|<b>5</b>|<b>6</b>|<b>7</b>]...</code>
    </p>
    <p>
        Hexadecimal literals must not contain spaces, but decimal and octal literals may. The <code>o</code> character in octal literals is optional: they can be
        specified equally as <code>&amp;o777</code> or <code>&amp;777</code>.
    </p>
    <p>
        Hexadecimal and octal literals denote integers and do not include a sign. They must range between
        [<code>&amp;h0</code>&mdash;<code>&amp;hFFFF</code>],
        of which the range [<code>&amp;h8000</code>&mdash;<code>&amp;hFFFF</code>]
        is interpreted as a two's complement negative integer; for example, <code>&amp;hFFFF = -1</code>.
        Signs can appear left of the <code>&amp;</code>
        but these form an expression and are not part of the literal itself.
    </p>
    <p>
        Floating-point literals must be specified in decimal notation. The decimal separator is the point.
        A base-10 exponent may be specified after <code>E</code> in single-precision floats, or after <code>D</code> in double-precision floats.
        Trailing <code>%</code> is ignored and does <em>not</em> indicate an integer literal.
        Trailing <code>!</code> or <code>#</code> mark the literal as single- or double-precision, respectively.
    <p>
        Examples of valid numeric literals are
        <code>-1</code> <code>42</code> <code>42!</code> <code>42#</code>
        <code>1.3523523</code> <code>.235435</code> <code>-.3</code> <code>3.</code>
        <code>.</code> <code>.e</code> <code>.D</code> <code>1.1e+7</code>
        <code>1.1d+7</code> <code>1e2</code> <code>1e-2</code> <code>&amp;7</code>
        <code>&amp;hffff</code> <code>&amp;O20</code> <code>&amp;h</code> <code>&amp;</code> <code>65537%</code> <code>1.1%</code>
    </p>
    <p>
        Note that expressions such as <code>&amp;o-77</code> are legal; these are however <em>not</em>
        negative octals but rather the expression <code>&amp;o</code> (empty octal; zero) less <code>77</code> (decimal 77).
    </p>
</section>
<hr />

<section>
    <h3 id="variables">Variables</h3>

    <p>

    </p>
    <p>
        Variable names must start with a letter; all characters of the variable name
        (except the <a href="#typechars">sigil</a>) must be letters <code>A&#8212;Z</code>, figures <code>0&#8212;9</code>, or a dot <code>.</code>
        Only the first 40 characters in the name are significant. A variable name must
        not be identical to a <a href="#reserved-words">reserved word</a> or a reserved word plus sigil.
        Therefore, for example, you cannot name a variable <code>TO!</code> but you can
        name it <code>AS!</code>. Variable names may <em>contain</em> any reserved word.
        Variable names may also start with a reserved word, with the exception of <code><a href="#USR">USR</a></code> and
        <code><a href="#FN">FN</a></code>. Thus, <code>FNORD%</code> and <code>USRNME$</code>
        are not legal variable names while <code>FRECKLE%</code> and <code>LUSR$</code> are.
    </p>
    <p>
        For each name, four different
        variables may exist corresponding to the four types. That is, you can have <code>A$</code>,
        <code>A%</code>, <code>A!</code> and <code>A#</code> as different variables.
        Which one of those is also known as <code>A</code> depends on the settings in
        <code><a href="#DEFINT">DEFINT</a></code>/<code>DEFDBL</code>/<code>DEFSNG</code>/<code>DEFSTR</code>.
        By default, <code>A</code> equals the single-precision <code>A!</code>.
    </p>
    <p>
        Furthermore, the
        <a href="#arrays">arrays</a> <code>A$()</code>, <code>A%()</code>,
        <code>A!()</code>, <code>A#()</code> are separate from the scalar
        variables of the same name.
    </p>
    <h4 id="typechars">Types and sigils</h4>
    <p>
        PC-BASIC recognises four variable types, distinguished by their <dfn>sigil</dfn>
        or <dfn>type character</dfn>, the last character of the variable's full name:
    </p>
    <div class="scrollable">
        <table>
            <tr>
                <th>sigil</th>
                <th>type</th>
                <th>size</th>
                <th>range</th>
                <th>precision</th>
            </tr><tr>
                <td><code>$</code></td>
                <td>string</td>
                <td>3 bytes plus allocated string space</td>
                <td>0&mdash;255 characters</td>
                <td></td>
            </tr><tr>
                <td><code>%</code></td>
                <td>integer</td>
                <td>2 bytes</td>
                <td>-32768&#8212;32767</td>
                <td>exact</td>
            </tr><tr>
                <td><code>!</code></td>
                <td>single-precision float</td>
                <td>4 bytes</td>
                <td>&plusmn;2.938726&middot;10<sup>-39</sup>&mdash;&plusmn;1.701412&middot;10<sup>38</sup></td>
                <td>~6 significant figures</td>
            </tr><tr>
                <td><code>#</code></td>
                <td>double-precision float</td>
                <td>8 bytes</td>
                <td>&plusmn;2.938735877055719&middot;10<sup>-39</sup>&mdash;&plusmn;1.701411834604692&middot;10<sup>38</sup></td>
                <td>~16 significant figures</td>
            </tr>
        </table>
    </div>
    <p>
        Note that double-precision floats can hold more decimals than single-precision floats, but not larger or smaller numbers.
    </p>
    <p>
        While all integers are signed, some statements will interpret negative
        integers as their two's complement.
    </p>

    <h4 id="arrays">Arrays</h4>
    <p>
        Arrays are indexed with round or square
        brackets; even mixing brackets is allowed. The following are all legal array elements: <code>A[0]</code>, <code>A(0)</code>,
        <code>A(0]</code>, <code>A[0)</code>. Multidimensional arrays are specified by separating the indices with commas: <code>A(0, 0)</code>, <code>A[0, 0, 0]</code>, etc.
    </p>
    <p>
        By default, arrays are indexed from <code>0</code>. This can be changed to
        <code>1</code> using <code><a href="#OPTION-BASE">OPTION BASE</a> 1</code>.
    </p>
    <p>
        Arrays can be allocated by specifying the largest allowed index using
        <code><a href="#DIM">DIM</a></code>. If all indices of the array
        are <code>10</code> or less, they need not be explicitly allocated. The first
        access of the array (read or write) will automatically allocate it with
        a maximum index of <code>10</code> and the same number of indices as in the first
        access. To re-allocate an array, the old array must first be deleted
        with <code><a href="#CLEAR">CLEAR</a></code> or
        <code><a href="#ERASE">ERASE</a></code>.
    </p>
    <p>
        Multi-dimensional arrays are stored in column-major order, such that <code>A%(2,0)</code> immediately
        follows <code>A%(1,0)</code>.
    </p>

    <h4 id="conversions">Conversions</h4>
    <p>
        PC-BASIC will implicitly convert between the three numerical data types. When a value of
        one type is assigned to a variable, array element or parameter of another
        type, it is converted according to the following rules:
    </p>
    <ul>
        <li>
            Single- and double-precision floats are converted to integer by rounding
            to the nearest whole number. Halves are rounded away from zero. If the resulting whole
            number is outside the allowed range for integers, <samp>Overflow</samp> is raised.
        </li>
        <li>
            Double-precision floats are converted to single-precision floats by
            Gaussian rounding of the mantissa, where the new least significant bit of the
            mantissa is rounded up if the clipped-off binary fraction is greater than one-half; halves
            are rounded to even.
        </li>
        <li>
            Integers are converted to their exact representation as single-
            or double-precision floats.
        </li>
        <li>
            Single-precision floats are converted to their exact representation as
            double-precision floats.
        </li>
        <li>
            There is no implicit conversion between strings and any of the numeric types.
            Attempting to assign a string value to a numeric variable, array element or parameter
            (or vice versa) will raise <samp>Type mismatch</samp>.
    </ul>

</section>
<hr />

<section>
    <h3 id="operators">Operators</h3>

    <h4 id="order-of-preference">Order of precedence</h4>
    <p>
        The order of precedence of operators is as follows, from tightly bound
        (high precedence) to loosely bound (low precedence):
    </p>
    <ol>
        <li value="12"><code>^</code></li>
        <li value="11"><ul class="horizontal">
            <li><code>*</code></li>
            <li><code>/</code></li>
        </li>
        <li value="10"><code>\</code></li>
        <li value="9"><code>MOD</code></li>
        <li value="8">
            <ul class="horizontal">
                <li><code>+</code></li>
                <li><code>-</code> (unary and binary)</li>
            </ul>
        </li>
        <li value="7">
            <ul class="horizontal">
                <li><code>=</code></li>
                <li><code>&lt;&gt;</code></li>
                <li><code>&gt;&lt;</code></li>
                <li><code>&lt;</code></li>
                <li><code>&gt;</code></li>
                <li><code>&lt;=</code></li>
                <li><code>=&lt;</code></li>
                <li><code>&gt;=</code></li>
                <li><code>=&gt;</code></li>
            </ul>
        </li>
        <li value="6"><code>NOT</code> (unary)</li>
        <li value="5"><code>AND</code></li>
        <li value="4"><code>OR</code></li>
        <li value="3"><code>XOR</code></li>
        <li value="2"><code>EQV</code></li>
        <li value="1"><code>IMP</code></li>
    </ol>
    <p>
        Expressions within parentheses <code>()</code> are evaluated first.
        All binary operators are left-associative: operators of equal precedence are evaluated left to right.
    </p>
    <h5>Examples</h5>
    <ul>
        <li>
            Exponentiation is more tightly bound than negation:
            <code>-1^2 = -(1^2) = -1</code> but <code>(-1)^2 = 1</code>.
        </li>
        <li>
            Exponentiation is left-associative:
            <code>2^3^4 = (2^3)^4 = 4096</code>.
        </li>
    </ul>
    <h5>Errors</h5>
    <ul>
        <li>
            If any operator other than <code>+</code>, <code>-</code> or <code>NOT</code> is used without a
            left operand, <samp>Syntax error</samp> is raised.
        </li>
        <li>
            At the end of a statement, if any operator is used without a right operand, <samp>Missing operand</samp> is
            raised. If this occurs elsewhere inside a statement, such as within brackets, <samp>Syntax error</samp> is raised.
        </li>
    </ul>

    <h4 id="math-operators">Mathematical operators</h4>
    <p>
        Mathematical operators operate on numeric expressions only.
        Note however that <code>+</code> can take the role of the
        <a href="#string-operators">string concatenation operator</a> if both
        operands are strings.
    </p>
    <div class="scrollable">
    <table>
        <tr>
            <th>Code</th>
            <th>Operation</th>
            <th>Result</th>
        </tr>
        <tr>
            <td id="^"><code><var>x</var> ^ <var>y</var></code></td>
            <td>Exponentiation</td>
            <td>
                <code><var>x</var></code> raised to the power of
                <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="*"><code><var>x</var> * <var>y</var></code></td>
            <td>Multiplication</td>
            <td>
                Product of <code><var>x</var></code> and
                <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="/"><code><var>x</var> / <var>y</var></code></td>
            <td>Division</td>
            <td>
                Quotient of <code><var>x</var></code> and
                <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="\"><code><var>x</var> \ <var>y</var></code></td>
            <td>Truncated division</td>
            <td>
                Integer quotient of <code><var>x</var></code> and
                <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="MOD"><code><var>x</var> MOD <var>y</var></code></td>
            <td>Modulo</td>
            <td>
                Integer remainder of <code><var>x</var></code> by
                <code><var>y</var></code> (with the sign of <code><var>x</var></code>)
            </td>
        </tr>
        <tr>
            <td id="+"><code><var>x</var> + <var>y</var></code></td>
            <td>Addition</td>
            <td>
                Sum of <code><var>x</var></code> and <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="-"><code><var>x</var> - <var>y</var></code></td>
            <td>Subtraction</td>
            <td>
                Difference of <code><var>x</var></code> and <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="unary+"><code>+ <var>y</var></code></td>
            <td>Unary Plus</td>
            <td>
                Value of <code><var>y</var></code>
            </td>
        </tr>
        <tr>
            <td id="unary-"><code>- <var>y</var></code></td>
            <td>Negation</td>
            <td>
                Negative value of <code><var>y</var></code>
            </td>
        </tr>
    </table>
    </div>
    <h5>Notes</h5>
    <ul>
        <li>
            Where necessary, the result of the operation will be upgraded to a data type
            able to hold the result. For example, dividing integers 3 by 2 will yield a
            single-precision 1.5.
        </li>
        <li>
            However, the exponentiation operator <code>^</code>
            will give at most a single-precision result unless the <a href="#--double"><code>double</code></a>
            option is used.
        </li>
        <li>
            The expression <code>0^0</code> will return <code>1</code> and not raise an error,
            even though, mathematically, raising zero to the zeroeth power is undefined.
        </li>
    </ul>
    <h5>Errors</h5>
    <ul>
        <li>
            If either
            operand is a string, <samp>Type mismatch</samp> will be raised. The exception is <code>+</code>
            which will only raise <samp>Type mismatch</samp> if either <em>but not both</em> operands are strings.
        </li>
        <li>
            If <code><var>y=0</var></code>, <code><var>x</var> / <var>y</var></code>, <code><var>x</var> MOD <var>y</var></code> and
             <code><var>x</var> \ <var>y</var></code> will raise <samp>Division by zero</samp>.
        </li>
        <li>
            If <code><var>x=0</var></code> and <code><var>y</var>&lt;0</code>, <code><var>x</var>^<var>y</var></code>
            will raise <samp>Division by zero</samp>.
        </li>
        <li>
            If the result of any operation is too large to fit in a floating-point data type, <samp>Overflow</samp> is raised.
        </li>
        <li>
            If operands or result of <code>\</code> or <code>MOD</code> are not in
            <code>[-32768&ndash;32767]</code>, <samp>Overflow</samp> is raised.
        </li>
        <li>
            If <code><var>x&lt;0</var></code> and <code><var>y</var></code> is a fractional number,
            <code><var>x</var> ^ <var>y</var></code> will raise <samp>Illegal function call</samp>.
        </li>
    </ul>

    <h4 id="relational-operators">Relational operators</h4>
    <p>
        Relational operators can operate on numeric as well as string operands;
        however, if one operand is string and the other numeric, <samp>Type mismatch</samp>
        is raised.
    </p>
    <p>
        Relational operators return either <code>0</code> (for <i>false</i>) or
        <code>-1</code> for <i>true</i>.
    </p>
    <div class="scrollable">
        <table>
            <tr>
                <th>Code</th>
                <th>Operation</th>
                <th>Result</th>
            </tr>
            <tr>
                <td id="="><code>=</code></td>
                <td>Equal</td>
                <td>
                    True if <code><var>a</var></code> equals <code><var>b</var></code>,
                    false otherwise.
                </td>
            </tr>
            <tr>
                <td id="&lt;&gt;"><code>&lt;&gt;</code> <code>&gt;&lt;</code></td>
                <td>Not equal</td>
            <td>
                False if <code><var>a</var></code> equals <code><var>b</var></code>,
                true otherwise.
            </td>
            </tr>
            <tr>
                <td id="&lt;"><code>&lt;</code></td>
                <td>Less than</td>
                <td>
                    True if <code><var>a</var></code> is less than <code><var>b</var></code>,
                    false otherwise.
                </td>
            </tr>
            <tr>
                <td id="&gt;"><code>&gt;</code></td>
                <td>Greater than</td>
                <td>
                    True if <code><var>a</var></code> is greater than <code><var>b</var></code>,
                    false otherwise.
                </td>
            </tr>
            <tr>
                <td id="&lt;="><code>&lt;=</code> <code>=&lt;</code></td>
                <td>Less than or equal</td>
                <td>
                    False if <code><var>a</var></code> is greater than <code><var>b</var></code>,
                    true otherwise.
                </td>
            </tr>
            <tr>
                <td id="&gt;="><code>&gt;=</code> <code>=&gt;</code></td>
                <td>Greater than or equal</td>
                <td>
                    False if <code><var>a</var></code> is less than <code><var>b</var></code>,
                    true otherwise.
                </td>
            </tr>
        </table>
    </div>
    <p>
        When operating on numeric operands, both operands are compared as floating-point
        numbers according to the usual ordering of numbers. The equals operator tests
        for equality to within machine precision for the highest-precision of the two
        operator types.
    </p>
    <p>
        When comparing strings, the ordering is as follows.
    </p>
    <ul>
        <li>
            Two strings are equal only if they are of the same length and every character
            code of the first string agrees with the corresponding character code of the
            second. This includes any whitespace or unprintable characters.
        </li>
        <li>
            Each character position of the strings is compared starting with the leftmost character.
            When a pair of different characters is encountered, the string
            with the character of lesser <a href="#cp437">code point</a> is less than the string
            with the character of greater code point.
        </li>
        <li>
            If the strings are of different length, but equal up to the length of the
            shorter string, then the shorter string is less than the longer string.
        </li>
    </ul>

    <h4 id="boolean-operators">Bitwise operators</h4>
    <p>
        PC-BASIC has no Boolean type and does not implement Boolean operators.
        It does, however, implement bitwise operators.
    </p>
    <p>
        Bitwise operators operate on numeric expressions only.
        Floating-point operands are rounded to integers before being used.
    </p>
    <div class="scrollable">
        <table>
            <tr>
                <th>Code</th>
                <th>Operation</th>
                <th>Result</th>
            </tr>
            <tr>
                <td id="NOT"><code>NOT <var>y</var></code></td>
                <td>Complement</td>
                <td><code>-<var>y</var>-1</code></td>
            </tr>
            <tr>
                <td id="AND"><code><var>x</var> AND y</code></td>
                <td>Bitwise conjunction</td>
                <td>
                    The bitwise AND of <code><var>x</var></code> and <code><var>y</var></code>
                </td>
            </tr>
            <tr>
                <td id="OR"><code><var>x</var> OR <var>y</var></code></td>
                <td>Bitwise disjunction</td>
                <td>
                    The bitwise OR of <code><var>x</var></code> and <code><var>y</var></code>
                </td>
            </tr>
            <tr>
                <td id="XOR"><code><var>x</var> XOR <var>y</var></code></td>
                <td>Bitwise exclusive or</td>
                <td>
                    The bitwise XOR of <code><var>x</var></code> and <code><var>y</var></code>
                </td>
            </tr>
            <tr>
                <td id="EQV"><code><var>x</var> EQV <var>y</var></code></td>
                <td>Bitwise equivalence</td>
                <td>
                    <code>NOT(<var>x</var> XOR <var>y</var>)</code>
                </td>
            </tr>
            <tr>
                <td id="IMP"><code><var>x</var> IMP <var>y</var></code></td>
                <td>Bitwise implication</td>
                <td>
                    <code>NOT(<var>x</var>) OR <var>y</var></code>
                </td>
            </tr>
        </table>
    </div>
    <p>
        These operators can be used
        as Boolean operators only if <code>-1</code> is used to represent <i>true</i> while <code>0</code>
        represents <i>false</i>. Note that PC-BASIC represents
        negative integers using the two's complement, so <code>NOT 0 = -1</code>.
        The Boolean interpretation of bitwise operators
        is given in the table below.
    </p>
    <div class="scrollable">
        <table>
            <tr>
                <th>Code</th>
                <th>Operation</th>
                <th>Result</th>
            </tr>
            <tr>
                <td><code>NOT <var>y</var></code></td>
                <td>Logical negation</td>
                <td>True if <code><var>y</var></code> is false and vice versa</td>
            </tr>
            <tr>
                <td><code><var>x</var> AND y</code></td>
                <td>Conjunction</td>
                <td>
                    Only true if both  <code><var>x</var></code> and
                    <code><var>y</var></code> are true
                </td>
            </tr>
            <tr>
                <td><code><var>x</var> OR <var>y</var></code></td>
                <td>Disjunction</td>
                <td>
                    Only false if both <code><var>x</var></code> and
                    <code><var>y</var></code> are false
                </td>
            </tr>
            <tr>
                <td><code><var>x</var> XOR <var>y</var></code></td>
                <td>Exclusive or</td>
                <td>
                    True if the truth values of <code><var>x</var></code> and
                    <code><var>y</var></code> differ
                </td>
            </tr>
            <tr>
                <td><code><var>x</var> EQV <var>y</var></code></td>
                <td>Equivalence</td>
                <td>
                    True if the truth values of <code><var>x</var></code> and
                    <code><var>y</var></code> are the same
                </td>
            </tr>
            <tr>
                <td><code><var>x</var> IMP <var>y</var></code></td>
                <td>Implication</td>
                <td>
                    True if <code><var>x</var></code> is false or
                    <code><var>y</var></code> is true
                </td>
            </tr>
        </table>
    </div>
    <p>
        Be aware that when used on integers other than <code>0</code> and <code>-1</code>,
        bitwise operators can <em>not</em>
        be interpreted as Boolean operators. For example,
        <code>2 AND 1</code> returns <code>0</code>.
    </p>
    <h5>Errors</h5>
    <ul>
        <li>
            If either
            operand is a string, <samp>Type mismatch</samp> will be raised.
        </li>
        <li>
            If the operands or result are not in
            <code>[-32768&ndash;32767]</code>, <samp>Overflow</samp> is raised.
        </li>
    </ul>

    <h4 id="string-operators">String operators</h4>
    <p>
        The string concatenation operator is <code>+</code>. It has a binary as well as a unary form.
        The unary minus may also be used on strings, but has no effect.
    </p>
    <div class="scrollable">
        <table>
            <tr>
                <th>Code</th>
                <th>Operation</th>
                <th>Result</th>
            </tr>
            <tr>
                <td id="concat"><code><var>x</var> + <var>y</var></code></td>
                <td>Concatenation</td>
                <td>The string formed by <code><var>x</var></code> followed by <code><var>y</var></code></td>
            </tr>
            <tr>
                <td id="unary-concat"><code>+ <var>y</var></code></td>
                <td>Unary Plus</td>
                <td>
                    Value of <code><var>y</var></code>
                </td>
            </tr>
            <tr>
                <td id="string-unary-minus"><code>- <var>y</var></code></td>
                <td>Unary Minus</td>
                <td>
                    Value of <code><var>y</var></code>
                </td>
            </tr>
        </table>
    </div>
    <h5>Errors</h5>
    <ul>
        <li>
            If either (but not both) operands to a concatenation
            are numeric, <samp>Type mismatch</samp> will be raised.
        </li>
        <li>
            If <code>LEN(<var>x</var>) + LEN(<var>y</var>) > 255</code>, <code><var>x</var> + <var>y</var></code>
            will raise <samp>String too long</samp>.
        </li>
</section>
<hr />


<section>
    <h3 id="functions">Functions</h3>
    <p>
        <dfn>Functions</dfn> can only be used as part of an expression within a statement; they may take input values
        between parentheses and produce a return value. For example,
        in <code>PRINT ABS(-1)</code> the <code>ABS</code> function is used in an expression within a
        <code>PRINT</code> statement; in <code>Y = SQR(X) + 2</code> the <code>SQR</code> function
        is used in an expression within a <code>LET</code> statement.
    </p>
    <p>
        Some reference works also use terms such as <dfn>system variable</dfn> for functions that do not take
        an input, presumably since in the GW-BASIC syntax such functions have no parentheses, in contrast to
        the languages in the C family (and indeed some modern BASICs).
        However, this is simply the GW-BASIC syntax for functions without inputs.
        For example, one can do <code>DEF FNA=1: PRINT FNA</code>
        in which no parentheses are allowed.
    </p>

    <section>
        <h4 id="ABS"><code>ABS</code></h4>
        <code class="flow">
            <var>y</var><b> = ABS(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns the absolute value of <code><var>x</var></code> if <code><var>x</var></code> is a number and the
            value of <code><var>x</var></code> if <code><var>x</var></code> is a string.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is an expression.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ASC"><code>ASC</code></h4>
        <code class="flow">
            <var>val</var><b> = ASC(</b><var>char</var><b>)</b>
        </code>
        <p>
            Returns the <a href="#cp437">code point</a> (ASCII value) for the first character of <code><var>char</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>char</var></code> is an expression with
                a string value.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>char</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li><li>
                <code><var>char</var></code> equals <code>""</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ATN"><code>ATN</code></h4>
        <code class="flow">
            <var>y</var><b> = ATN(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns the inverse tangent of <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a numeric expression that gives
                the angle in radians.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Unless PC-BASIC is run with the <code><a href="#--double">double</a></code> option, this function
                returns a single-precision value.
            </li>
            <li>
                <code>ATN(x)</code> differs in the least significant digit from GW-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CDBL"><code>CDBL</code></h4>
        <code class="flow">
            <var>y</var><b> = CDBL(</b><var>x</var><b>)</b>
        </code>
        <p>
            Converts the numeric expression <code><var>x</var></code> to a double-precision value.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CHR$"><code>CHR$</code></h4>
        <code class="flow">
            <var>char</var> <b>= CHR$(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns the character with <a href="#cp437">code point</a> <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a numeric expression in the range <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CINT"><code>CINT</code></h4>
        <code class="flow">
            <var>y</var> <b>= CINT(</b><var>x</var><b>)</b>
        </code>
        <p>
            Converts the numeric expression <code><var>x</var></code> to a signed integer.
            Halves are rounded away from zero, so that e.g.
            <code>CINT(2.5) = 3</code> and <code>CINT(-2.5) = -3</code>.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="COS"><code>COS</code></h4>
        <code class="flow">
            <var>cosine</var> <b>= COS(</b><var>angle</var><b>)</b>
        </code>
        <p>
            Returns the cosine of <code><var>angle</var></code>.
            Unless PC-BASIC is run with the <code><a href="#--double">double</a></code> option,
            this function returns a single-precision
            value.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>angle</var></code> is a numeric expression that
                gives the angle in radians.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The return value usually differs from the value returned by GW-BASIC in the least significant figure.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>angle</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CSNG"><code>CSNG</code></h4>
        <code class="flow">
            <var>y</var> <b>= CSNG(</b><var>x</var><b>)</b>
        </code>
        <p>
            Converts the numeric expression <code><var>x</var></code> to a single-precision value
            by Gaussian rounding.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CSRLIN"><code>CSRLIN</code></h4>
        <code class="flow">
            <var>y</var> <b>= CSRLIN</b>
        </code>
        <p>
            Returns the screen row of the cursor on the active page.
            The return value is in the range <code>[1&#8212;25]</code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                This function takes no arguments.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CVI"><code>CVI</code></h4>
        <code class="flow">
            <var>y</var> <b>= CVI(</b><var>s</var><b>)</b>
        </code>
        <p>
            Converts a two-byte string to a signed integer.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>s</var></code> is a string expression that represents an integer using
                little-endian two's complement encoding. Only the first two bytes are used.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>s</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CVS"><code>CVS</code></h4>
        <code class="flow">
            <var>y</var> <b>= CVS(</b><var>s</var><b>)</b>
        </code>
        <p>
            Converts a four-byte string to a single-precision floating-point number.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>s</var></code> is a string expression that represents a single-precision
                number in Microsoft Binary Format. Only the first four bytes are used.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>s</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CVD"><code>CVD</code></h4>
        <code class="flow">
            <var>y</var> <b>= CVD(</b><var>s</var><b>)</b>
        </code>
        <p>
            Converts an eight-byte string to a double-precision floating-point number.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>s</var></code> is a string expression  that represents a double-precision
                number in Microsoft Binary Format. Only the first eight bytes are used.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>s</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="DATE$-function"><code>DATE$</code> (function)</h4>
        <code class="flow">
            <var>s</var> <b>= DATE$</b>
        </code>
        <p>
            Returns the system date as a string in the format <code>"mm-dd-yyyy"</code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                This function takes no arguments.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ENVIRON$"><code>ENVIRON$</code></h4>
        <code class="flow">
            <var>value</var> <b>= ENVIRON</b>[ ]<b>$</b>(<var>x</var>)
        </code>
        <p>
            Returns an environment variable.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>x</var></code> is an expression.
        </p>
        <ul>
            <li>
                If <code><var>x</var></code> has a string value, returns the value for the environment variable <code><var>x</var></code> or the empty
                string if no variable with the name <code><var>x</var></code> is set in the environment table. The environment variable must be an
                ASCII string and will be converted to uppercase on case-sensitive systems.
            </li>
            <li>
                If <code><var>x</var></code> has a numeric value, it must be in <code>[1&#8212;255]</code>. Returns the <code><var>x</var></code>th entry in
                the environment table.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> is the empty string: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>x</var></code> contains non-ASCII characters: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>x</var></code> is a number not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>x</var></code> is a number not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="EOF"><code>EOF</code></h4>
        <code class="flow">
            <var>is_at_end</var> <b>= EOF(</b><var>file_num</var><b>)</b>
        </code>
        <p>
            Returns -1 if file with number <code><var>file_num</var></code> has reached end-of-file; 0 otherwise.
            The file must be open in <code>INPUT</code> or <code>RANDOM</code> mode. <code>EOF(0)</code> returns 0.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>file_num</var></code> is open to <code>KYBD:</code>, performs a blocking read and returns -1 if
                <kbd>CTRL</kbd>+<kbd>Z</kbd> is entered, 0 otherwise. The character entered is then echoed to
                the console.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is a number not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is a number not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not 0 or the number of an open file:
                <samp>Bad file number</samp>.
            </li>
            <li>
                The file with number <code><var>file_num</var></code> is in OUTPUT or APPEND mode:
                <samp>Bad file mode</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ERDEV"><code>ERDEV</code></h4>
        <code class="flow">
            <var>zero</var> <b>= ERDEV</b>
        </code>
        <p>
            Returns 0.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, returns the value of a device error.
            </li>
            <li>
                This function is not implemented in PC-BASIC.
            </li>
            <li>
                This function takes no arguments.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ERDEV$"><code>ERDEV$</code></h4>
        <code class="flow">
            <var>empty</var> <b>= ERDEV</b>[ ]<b>$</b>
        </code>
        <p>
            Returns the empty string.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, returns the device name of a device error.
            </li>
            <li>
                This function is not implemented in PC-BASIC.
            </li>
            <li>
                This function takes no arguments.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ERL"><code>ERL</code></h4>
        <code class="flow">
            <var>error_line</var> <b>= ERL</b>
        </code>
        <p>
            Returns the line number where the last error was raised.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                If the error was
                raised by a direct statement, returns 65535.
            </li>
            <li>
                If no error has been raised,
                returns 0.
            </li>
            <li>
                This function takes no arguments.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ERR"><code>ERR</code></h4>
        <code class="flow">
            <var>error_code</var> <b>= ERR</b>
        </code>
        <p>
            Returns the number of the last error.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                If no error has been raised, returns 0.
            </li>
            <li>
               If the last error was a <samp>Syntax error</samp> raised by a direct statement, returns 0.
            </li>
            <li>
                This function takes no arguments.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="EXP"><code>EXP</code></h4>
        <code class="flow">
            <var>y</var> <b>= EXP(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns the exponential of <code><var>x</var></code>, i.e. <code>e</code> to the power <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a number-
                valued expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Unless PC-BASIC is run with the <code><a href="#--double">double</a></code> option, this function returns a single-precision
                value.
            </li>
            <li>
                The return value sometimes differs in the least significant digit from GW-BASIC. For
                large values of <code><var>x</var></code>, the difference may be 3 digits.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is larger than the natural logarithm of the maximum single-precision
                value: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="EXTERR"><code>EXTERR</code></h4>
        <code class="flow">
            <var>zero</var> <b>= EXTERR(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns 0.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a numeric expression in <code>[0&#8212;3]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, this function returns extended error information from MS-DOS.
            </li>
            <li>
                This function is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[0&#8212;3]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="FIX"><code>FIX</code></h4>
        <code class="flow">
            <var>whole</var> <b>= FIX(</b><var>number</var><b>)</b>
        </code>
        <p>
            Returns <code><var>number</var></code> truncated towards zero.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>FIX</code> truncates towards zero: it removes the fractional part. By contrast, <code><a href="#INT">INT</a></code>
                truncates towards negative infinity.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a string expression: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="FN"><code>FN</code></h4>
        <code class="flow">
            <var>result</var> <b>= FN</b>[ ]<var>name</var> [<b>(</b><var>arg_0</var> [<b>,</b> <var>arg_1</var>] ...<b>)</b>]
        </code>
        <p>
            Evaluates the user-defined function previously defined with <code><a href="#DEF-FN">DEF FN</a> <var>name</var></code>.
            Spaces between <code>FN</code> and <code><var>name</var></code> are optional.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>name</var></code> is the name of a previously defined function.
            </li>
            <li>
                <code><var>arg_0</var>, <var>arg_1</var>, ...</code> are expressions, given as parameters to the function.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No function named <code><var>name</var></code> is defined:
                <samp>Undefined user function</samp>.
            </li>
            <li>
                The number of parameters differs from the function definition:
                <samp>Syntax error</samp>.
            </li>
            <li>
                The type of one or more parameters differs from the function definition:
                <samp>Type mismatch</samp>.
            </li>
            <li>
                The return type is incompatible with the function name's sigil:
                <samp>Type mismatch</samp>.
            </li>
            <li>
                The function being called is recursive or mutually recursive:
                <samp>Out of memory</samp>.
        </ul>
    </section>
<hr />

    <section>
        <h4 id="FRE"><code>FRE</code></h4>
        <code class="flow">
            <var>free_mem</var> <b>= FRE(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns the available BASIC memory.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>x</var></code> is an expression.
        </p>
        <ul>
            <li>
                If <code><var>x</var></code> has a numeric value, it is ignored.
            </li>
            <li>
                If <code><var>x</var></code> has a string value, garbage collection is performed
                before returning available memory.
        </li></ul>
    </section>
<hr />


    <section>
        <h4 id="HEX$"><code>HEX$</code></h4>
        <code class="flow">
            <var>hex_repr</var> <b>= HEX$(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns a string with the hexadecimal representation of <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a
                numeric expression in <code>[-32768&#8212;65535]</code>. Values for
                negative <code><var>x</var></code> are shown as two's-complement.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="INKEY$"><code>INKEY$</code></h4>
        <code class="flow">
            <var>key</var> <b>= INKEY$</b>
        </code>
        <p>
            Returns one key-press from the keyboard buffer. If the keyboard buffer is
            empty, returns the empty string. Otherwise, the return value is a one- or two-
            character string holding the <a href="#eascii">e-ASCII code</a> of the pressed key.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                This function takes no arguments.
            </li>
            <li>
                When a function key <kbd>F1</kbd>&ndash;<kbd>F10</kbd> is pressed,
                <code>INKEY$</code> will return the letters of the associated macro
                &mdash; unless this macro has been set to empty with the
                <code><a href="#KEY-def">KEY</a></code> statement, in which case
                it returns the e-ASCII code for the function key.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="INP"><code>INP</code></h4>
        <code class="flow">
            <var>code</var> <b>= INP(</b><var>port</var><b>)</b>
        </code>
        <p>
            Returns the value of an emulated machine port.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>port</var></code> is a numeric expression in <code>[0&#8212;65535]</code>.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code>port</code></th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code>&amp;h60</code></td>
                    <td>
                        Returns the keyboard scancode for the current key pressed or the last key released.
                        The scancodes returned by <code>INP(&amp;h60)</code> are those
                        listed in the <a href="#scancodes">keyboard scancodes table</a>.
                        If a key is currently down, the return value is its scancode.
                        If no key is down, the return value is the scancode of
                        the last key released, incremented by 128.
                    </td>
                </tr>
                <tr>
                    <td><code>&amp;h201</code></td>
                    <td>
                        Returns the value of the game port (joystick port). This value is
                        constructed as follows:
                        <table>
                            <tr>
                                <th>Bit</th>
                                <th>Meaning</th>
                            </tr>
                            <tr>
                                <td>0</td>
                                <td>joystick 2 x-axis</td>
                            </tr>
                            <tr>
                                <td>1</td>
                                <td>joystick 1 y-axis</td>
                            </tr>
                            <tr>
                                <td>2</td>
                                <td>joystick 1 x-axis</td>
                            </tr>
                            <tr>
                                <td>3</td>
                                <td>joystick 2 y-axis</td>
                            </tr>
                            <tr>
                                <td>4</td>
                                <td>joystick 2 button 1</td>
                            </tr>
                            <tr>
                                <td>5</td>
                                <td>joystick 1 button 2</td>
                            </tr>
                            <tr>
                                <td>6</td>
                                <td>joystick 1 button 1</td>
                            </tr>
                            <tr>
                                <td>7</td>
                                <td>joystick 2 button 2</td>
                            </tr>
                        </table>
                        The button bits are 0 when the button is fired, 1 otherwise. The axis values
                        are normally 0 but are set to 1 by <code><a href="#OUT">OUT</a> &amp;h201, <var>x</var></code> and then fall back to 0
                        after a delay. The longer the delay, the higher the axis value.
                    </td>
                </tr>
                <tr>
                    <td>other values</td>
                    <td>Returns zero.</td>
                </tr>
            </table>
        </div>
        <h5>Notes</h5>
        <ul>
            <li>
                Only a limited number of machine ports are emulated in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>port</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>port</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="INPUT$"><code>INPUT$</code></h4>
        <code class="flow">
            <var>chars</var> <b>= INPUT</b>[ ]<b>$</b> <b>(</b><var>num_chars</var> [<b>,</b> [<b>#</b>] <var>file_num</var>]<b>)</b>
        </code>
        <p>
            Returns a string of <code><var>num_chars</var></code> characters from the keyboard or,
            if <code><var>file_num</var></code> is provided, from a text file.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>num_chars</var></code> is a numeric expression in <code>[1&#8212;255]</code>.
            </li>
            <li>
                <code><var>file_num</var></code> is a numeric expression that returns the number of a text file opened in
                <code>INPUT</code> mode. The <code>#</code> is optional and has no effect.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                This is a blocking read. It will wait for characters if there are none
                in the buffer.
            </li>
            <li>
                All control characters except <kbd>Ctrl</kbd>+<kbd>Break</kbd>, <kbd>Ctrl</kbd>+<kbd>Scroll Lock</kbd> and <kbd>Pause</kbd>
                are passed to the string by <code>INPUT$</code>. <kbd>Ctrl</kbd>+<kbd>Break</kbd> and <kbd>Ctrl</kbd>+<kbd>Scroll Lock</kbd> break
                execution whereas <kbd>Pause</kbd> halts until another key is pressed (and not read).
            </li>
            <li>
                When reading from the keyboard directly or through <code>KYBD:</code>, arrow keys, <kbd>Del</kbd>,
                <kbd>Home</kbd>, <kbd>End</kbd>, <kbd>Pg Up</kbd>, <kbd>Pg Dn</kbd> are passed as <code>NUL</code> characters. Function keys
                are ignored if they are event-trapped, otherwise function-key macro replacement is
                active as normal.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>num_chars</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>num_chars</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is less than zero: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is greater than <code>32767</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not open for <code>INPUT</code>: <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>num_chars</var></code> or <code><var>file_num</var></code> are strings: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is open to a <code>COM</code> port and this is the
                first <code><a href="#INPUT-file">INPUT</a></code>, <code><a href="#LINE-INPUT-file">LINE INPUT</a></code> or <code><a href="#INPUT$">INPUT$</a></code> call on that port
                since the buffer has filled up completely (i.e. <code><a href="#LOF">LOF</a>(<var>file_num</var>)</code> has become zero):
                <samp>Communication buffer overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="INSTR"><code>INSTR</code></h4>
        <code class="flow">
            <var>position</var> <b>= INSTR(</b>[<var>start</var><b>,</b>] <var>parent</var><b>,</b> <var>child</var><b>)</b>
        </code>
        <p>
            Returns the location of the first occurrence of the substring <code><var>child</var></code> in
            <code><var>parent</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>parent</var></code> and <code><var>child</var></code> are string expressions.
            </li>
            <li>
                <code><var>start</var></code> is a numeric expression in <code>[1&#8212;255]</code>, specifying
                the starting position from where to look; if not specified, the search starts
                at character 1.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>child</var></code> is not a substring of <code><var>parent</var></code> occurring at or before <code><var>start</var></code>,
                <code>INSTR</code> returns 0.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>start</var></code> has a string value or <code><var>parent</var></code> or <code><var>child</var></code> have numeric values: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>start</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>start</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="INT"><code>INT</code></h4>
        <code class="flow">
            <var>whole</var> <b>= INT(</b><var>number</var><b>)</b>
        </code>
        <p>
            Returns <code><var>number</var></code> truncated towards negative infinity.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>number</var></code> is an expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                <code><a href="#FIX">FIX</a></code> truncates towards zero: it removes the
                fractional part. By contrast, <code>INT</code> truncates towards negative infinity.
            </li>
            <li>
                If <code><var>number</var></code> is a string expression, <code>INT</code> returns its value unchanged.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="IOCTL$"><code>IOCTL$</code></h4>
        <code class="flow">
            <var>result</var> <b>= IOCTL</b>[ ]<b>$ (</b>[<b>#</b>] <var>file_num</var><b>)</b>
        </code>
        <p>
            Raises <samp>Illegal function call</samp>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, <code>IOCTL$</code> reads the reply to
                <code><a href="#IOCTL">IOCTL</a></code> from a device.
            </li>
            <li>
                This function is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                Otherwise: <samp>Illegal function call</samp>
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LEFT$"><code>LEFT$</code></h4>
        <code class="flow">
            <var>child</var> <b>= LEFT$(</b><var>parent</var><b>,</b> <var>num_chars</var><b>)</b>
        </code>
        <p>
            Returns the leftmost <code><var>num_chars</var></code> characters of <code><var>parent</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>parent</var></code> is a string expression.
            </li>
            <li>
                <code><var>num_chars</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>num_chars</var></code> is zero or <code><var>parent</var></code> is empty, <code>LEFT$</code> returns
                an empty string.
            </li>
            <li>
                If <code><var>num_chars</var></code> is greater than the length of <code><var>parent</var></code>,
                returns <code><var>parent</var></code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>parent</var></code> has a numeric value or <code><var>num_chars</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>num_chars</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>num_chars</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LEN"><code>LEN</code></h4>
        <code class="flow">
            <var>length</var> <b>= LEN(</b><var>string</var><b>)</b>
        </code>
        <p>
            Returns the number of characters in <code><var>string</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>string</var></code> is a string
                expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>string</var></code> has a number value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LOC"><code>LOC</code></h4>
        <code class="flow">
            <var>location</var> <b>= LOC(</b><var>file_num</var><b>)</b>
        </code>
        <p>
            Returns the current location in the file opened under number <code><var>file_num</var></code>.
        </p>
        <ul>
            <li>
                If the file is opened for <code>INPUT</code>, <code>OUTPUT</code> or <code>APPEND</code>, <code>LOC</code> returns the number
                of 128-byte blocks read or written since opening the file.
            </li>
            <li>
                If the file is opened for <code>RANDOM</code>, <code>LOC</code> returns the record number last read or
                written.
            </li>
            <li>
                If the file is opened to a <code>COM</code> device, <code>LOC</code> returns the number of characters
                in the input buffer, with a maximum of 255.
            </li>
            <li>
                If the file is opened to <code>KYBD:</code>, <code>LOC</code> returns 0.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> is a numeric expression in the range <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
               <code><var>file_num</var></code> must not be preceded by a <code>#</code>.
            </li>
            <li>
                In <code>OUTPUT</code> or <code>APPEND</code> mode, before any writes  <code>LOC</code> returns 0. After the 128th
                character is written,  <code>LOC</code> returns 1.
            </li>
            <li>
                In <code>INPUT</code> mode, before any reads  <code>LOC</code> returns 1. After the <strong>129th</strong> character
                is read, <code>LOC</code> returns 2.
            </li>
            <li>
                If <code><a href="#--text-encoding">text-encoding</a></code> is set, characters may be encoded by sequences of more than one byte.
                <code>LOC</code> will return the number of bytes rather than the number of encoded characters.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is open to a <code>LPT</code> device: <samp>Bad file mode</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LOF"><code>LOF</code></h4>
        <code class="flow">
            <var>length</var> <b>= LOF(</b><var>file_num</var><b>)</b>
        </code>
        <p>
            Returns the number of bytes in the file open under <code><var>file_num</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> is a numeric expression in the range <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>file_num</var></code> is open to a <code>COM:</code> device, <code>LOF</code> returns the number of bytes
                free in the input buffer.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is open to a <code>LPT</code> device: <samp>Bad file mode</samp>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><a href="#--text-encoding">text-encoding</a></code> is set, characters may be encoded by sequences of more than one byte.
                <code>LOF</code> will return the number of bytes rather than the number of encoded characters.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LOG"><code>LOG</code></h4>
        <code class="flow">
            <var>y</var> <b>= LOG(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns the natural logarithm of <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a numeric expression greater than zero.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Unless PC-BASIC is run with the <code><a href="#--double">double</a></code>
                option, this function returns a single-precision value.
            </li>
            <li>
               <code>LOG(<var>x</var>)</code> can differ from GW-BASIC by 1 in the least significant digit.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is zero or negative: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LPOS"><code>LPOS</code></h4>
        <code class="flow">
            <var>position</var> <b>= LPOS(</b><var>printer_number</var><b>)</b>
        </code>
        <p>
            Returns the column position for a printer.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>printer_number</var></code> is a numeric expression in <code>[0&#8212;3]</code>.
                If it is 0
                or 1, the position for <code>LPT1:</code> is returned. If it is 2, <code>LPT2:</code>; 3, <code>LPT3:</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                When entering direct mode, <code>LPT1:</code> (but not other printers)
                is flushed and its position is reset to 1.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>printer_number</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>printer_number</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>printer_number</var></code> is not in <code>[0&#8212;3]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="MID$"><code>MID$</code> (function)</h4>
        <code class="flow">
            <var>substring</var> <b>= MID$(</b><var>string</var><b>,</b> <var>position</var> [<b>,</b> <var>length</var>]<b>)</b>
        </code>
        <p>
            Returns a substring of <code><var>string</var></code> starting at <code><var>position</var></code>, counting from 1. The
            substring has length <code><var>length</var></code> if specified.
            If <code><var>length</var></code> is not specified, the substring extends to the end of the string.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>string</var></code> is a string expression.
            </li>
            <li>
                <code><var>position</var></code> is a numeric expression between 1 and the string length, inclusive.
            </li>
            <li>
                <code><var>length</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>string</var></code> has a number value or <code><var>position</var></code> or <code><var>length</var></code> have string values: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>position</var></code> or <code><var>length</var></code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>position</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>length</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="MKD$"><code>MKD$</code></h4>
        <code class="flow">
            <var>bytes</var> <b>= MKD$(</b><var>double</var><b>)</b>
        </code>
        <p>
            Returns the internal 8-byte Microsoft Binary Format representation of a double-
            precision number.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>double</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="MKI$"><code>MKI$</code></h4>
        <code class="flow">
            <var>bytes</var> <b>= MKI$(</b><var>int</var><b>)</b>
        </code>
        <p>
            Returns the internal 2-byte little-endian representation of an integer.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>int</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>int</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="MKS$"><code>MKS$</code></h4>
        <code class="flow">
            <var>bytes</var> <b>= MKS$(</b><var>single</var><b>)</b>
        </code>
        <p>
            Returns the internal 8-byte Microsoft Binary Format representation of a single-
            precision number.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>single</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="OCT$"><code>OCT$</code></h4>
        <code class="flow">
            <var>octal</var> <b>= OCT$(</b><var>x</var><b>)</b>
        </code>
        <p>
            Returns a string with the octal representation of <code><var>x</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code> is a
                numeric expression in <code>[-32768&#8212;65535]</code>. Values for
                negative <code><var>x</var></code> are shown as two's-complement.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PEEK"><code>PEEK</code></h4>
        <code class="flow">
            <var>value</var> <b>= PEEK(</b><var>address</var><b>)</b>
        </code>
        <p>
            Returns the value of the memory at  <code><var>segment</var> * 16 + <var>address</var></code> where <code><var>segment</var></code>
            is the current segment set with <code><a href="#DEF-SEG">DEF SEG</a></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>address</var></code> is a numeric expression in <code>[-32768&#8212;65535]</code>. Negative values are interpreted as their
                two's complement.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
               The memory is only partly emulated in PC-BASIC. See <a href="#memory">Memory model</a> for supported addresses.
               Outside emulated areas, <code>PEEK</code> returns 0.
            </li>
            <li>
               Values for particular memory address can be preset on the command line
                using the <code><a href="#--peek">peek</a></code> option. This can be used for compatibility with old
                programs. These values will override video or data segment values, if they
                are in those locations.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>address</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>address</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PEN"><code>PEN</code> (function)</h4>
        <code class="flow"><var>x</var> <b>= PEN(</b><var>mode</var><b>)</b></code>
        <p>
            Reads the light pen. What this function returns depends on <code><var>mode</var></code>:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>mode</var></code></th>
                    <th>Return value</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>Boolean; whether the light pen has been down since last poll.</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>x coordinate of last pen down position</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>y coordinate of last pen down position</td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>Boolean; whether the pen is currently down</td>
                </tr>
                <tr>
                    <td>4</td>
                    <td>x coordinate of current pen position</td>
                </tr>
                <tr>
                    <td>5</td>
                    <td>y coordinate of current pen position</td>
                </tr>
                <tr>
                    <td>6</td>
                    <td>character row coordinate of last pen down position</td>
                </tr>
                <tr>
                    <td>7</td>
                    <td>character column coordinate of last pen down position</td>
                </tr>
                <tr>
                    <td>8</td>
                    <td>character row coordinate of current pen position</td>
                </tr>
                <tr>
                    <td>9</td>
                    <td>character column coordinate of current pen position</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>mode</var></code> is a numeric expression in <code>[0&#8212;9]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In PC-BASIC, for <i>pen down</i> read <i>mouse button pressed</i>. For <i>pen
                position</i> read <i>mouse pointer position</i>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>mode</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>mode</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>mode</var></code> is not in <code>[0&#8212;9]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PLAY-function"><code>PLAY</code> (function)</h4>
        <code class="flow">
            <var>length</var> <b>= PLAY(</b><var>voice</var><b>)</b>
        </code>
        <p>
            Returns the number of notes in the background music queue. The return value is in <code>[0&#8212;32]</code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>voice</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
                If <code><a href="#--syntax">syntax</a>={pcjr|tandy}</code>, indicates for which tone voice channel
                the number of notes is to be returned. If <code><var>voice</var></code> is not in <code>[0&#8212;2]</code>, the
                queue for voice 0 is returned.
                For other choices of <code>syntax</code>, the <code><var>voice</var></code> value has no effect.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                There are at most 32 notes in the music queue. However, unless the articulation is
                set to legato, there are short gaps between each note; these are counted as
                separate notes in the queue. Effectively, the queue length is thus 16 for the default
                and staccato articulations and 32 for legato.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>voice</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>voice</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>voice</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PMAP"><code>PMAP</code></h4>
        <code class="flow">
            <var>transformed_coord</var> <b>= PMAP(</b><var>original_coord</var><b>,</b> <var>fn</var><b>)</b>
        </code>
        <p>
            Maps between viewport and logical (<code><a href="#WINDOW">WINDOW</a></code>) coordinates.
            If no <code><a href="#VIEW">VIEW</a></code> has been set, the viewport coordinates
            are physical coordinates.
        </p>
        <p>
            Depending on the value of <code><var>fn</var></code>, <code>PMAP</code>
            transforms from logical to viewport coordinates or vice versa:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>fn</var></code></th>
                    <th>Return value</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>return viewport x given logical x</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>return viewport y given logical y</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>return logical x given viewport x</td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>return logical y given viewport y</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>fn</var></code> is a numeric expression in <code>[0&#8212;3]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Initially, in text mode, <code>PMAP</code> returns 0.
            </li>
            <li>
                In GW-BASIC, <code>PMAP</code> behaves anomalously on <code><a href="#SCREEN-statement">SCREEN</a></code> changes, where it sometimes
                returns results as if the last <code>WINDOW</code> setting had persisted. This behaviour is not
                implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the parameters has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                A physical coordinate is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>fn</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>fn</var></code> is not in <code>[0&#8212;3]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="POINT-coord"><code>POINT</code> (current coordinate)</h4>
        <code class="flow">
            <var>coord</var> <b>= POINT(</b><var>fn</var><b>)</b>
        </code>
        <p>
            Returns a currently active coordinate of the graphics screen. This is usually
            the last position at which a pixel has been plotted, the second corner given
            in a <code>LINE</code> command, or the centre of the viewport if nothing has been plotted.
            <code><var>fn</var></code> is a numeric expression in <code>[0&#8212;3]</code>.
        </p>
        <p>
            The coordinate returned depends on the value of <code><var>fn</var></code>:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>fn</var></code></th>
                    <th>Return value</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>viewport x</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>viewport y</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>logical x</td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>logical y</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>fn</var></code> is a numeric expression in <code>[0&#8212;3]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In text mode, returns the active coordinate of any previous graphics mode;
                if no graphics mode has been active, returns 0.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>fn</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>fn</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>fn</var></code> is not in <code>[0&#8212;3]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="POINT-attr"><code>POINT</code> (pixel attribute)</h4>
        <code class="flow">
            <var>attrib</var> <b>= POINT(</b><var>x</var><b>,</b> <var>y</var><b>)</b>
        </code>
        <p>
            Returns the attribute of the pixel at logical coordinate <code><var>x</var></code>,<code><var>y</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code>, <code><var>y</var></code> are numeric expressions in <code>[-32768&#8212;32767]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>x</var></code>,<code><var>y</var></code> is outside the screen, returns -1.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Function is called in text mode: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>x</var></code> or <code><var>y</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> or <code><var>y</var></code> or the physical coordinates they translate into are not in
                <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="POS"><code>POS</code></h4>
        <code class="flow">
            <var>pos</var> <b>= POS(</b><var>dummy</var><b>)</b>
        </code>
        <p>
            Returns the current cursor column position, in the range <code>[1&#8212;80]</code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>dummy</var></code> is a valid expression of any type; its value has no effect.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="RIGHT$"><code>RIGHT$</code></h4>
        <code class="flow">
            <var>child</var> <b>= RIGHT$(</b><var>parent</var><b>,</b> <var>num_chars</var><b>)</b>
        </code>
        <p>
            Returns the rightmost <code><var>num_chars</var></code> characters of <code><var>parent</var></code>.
            If <code><var>num_chars</var></code> is zero or <code><var>parent</var></code> is empty, <code>RIGHT$</code> returns
            an empty string. If <code><var>num_chars</var></code> is greater than the length of <code><var>parent</var></code>,
            returns <code><var>parent</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>parent</var></code> is a string expression.
            </li>
            <li>
                <code><var>num_chars</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>num_chars</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>num_chars</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>num_chars</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="RND"><code>RND</code></h4>
        <code class="flow">
            <var>random</var> <b>= RND</b>[<b>(</b><var>x</var><b>)</b>]
        </code>
        <p>
            Returns a pseudorandom number in the interval <code>[0&#8212;1)</code>.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>x</var></code> is a numeric expression.
        </p>
        <ul>
            <li>
                If <code><var>x</var></code> is zero, <code>RND</code> repeats the last
                pseudo-random number.
            </li>
            <li>
                If <code><var>x</var></code> is greater than zero, a new pseudorandom number is
                returned.
            </li>
            <li>
                If <code><var>x</var></code> is negative, <code><var>x</var></code> is converted to a single-precision floating-point value
                and the random number seed is set to the absolute value of its mantissa.
                The function then generates a new pseudorandom numer with this seed.
                Since the only the mantissa of <code><var>x</var></code> is used, any two values whose ratio is a
                power of 2 will produce the same seed.
                Note that this procedure for generating a new seed differs from that used by <code><a href="#RANDOMIZE">RANDOMIZE</a></code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                PC-BASIC's <code>RND</code> function generates pseudo-random numbers through a linear congruential generator with modulo 2<sup>24</sup>,
                multiplier 214013 and increment 2531011. This exactly reproduces the random numbers of GW-BASIC's <code>RND</code>.
            </li>
            <li>It should be
                noted, however, that this is a very poor random number generator: its parameters imply a recurrence period of
                2<sup>24</sup>, meaning that after less than 17 million calls <code>RND</code> will wrap around
                and start running through the exact same series of numbers all over again. <code>RND</code> should not be used for
                cryptography, scientific simulations or anything else remotely serious.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="SCREEN-function"><code>SCREEN</code> (function)</h4>
        <code class="flow">
            <var>value</var> <b>= SCREEN(</b><var>row</var><b>,</b> <var>column</var> [<b>,</b> <var>fn</var>]<b>)</b>
        </code>
        <p>
            Returns the <a href="#cp437">code point</a> or colour attribute for the character at position
            <code><var>row</var></code>, <code><var>col</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>row</var></code> is a numeric expression in the range <code>[1&#8212;25]</code>.
            </li>
            <li>
                <code><var>col</var></code> is a numeric expression between 1 and the screen width (40 or 80).
            </li>
            <li>
                <code><var>fn</var></code> is a numeric expression in <code>[0&#8212;255]</code>. If it is zero or not specified,
                the code point of the character is returned. If it is non-zero, in text mode the
                attribute is returned; in other screens, 0 is returned.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any parameter has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>fn</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>fn</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>row</var></code> is not inside the current <code>VIEW PRINT</code> area:
                <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><a href="#KEY-list">KEY ON</a></code> and <code><var>row</var>=25</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>col</var></code> is not in <code>[1, <var>width</var>]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, the <code>SCREEN</code> function has anomalous error behaviour:
                constructions which for other functions would raise <samp>Syntax error</samp> or
                <samp>Missing operand</samp> instead raise <samp>Illegal function call</samp>. This
                behaviour is not replicated in PC-BASIC.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="SGN"><code>SGN</code></h4>
        <code class="flow">
            <var>sign</var> <b>= SGN(</b><var>number</var><b>)</b>
        </code>
        <p>
            Returns the sign of <code><var>number</var></code>: <code>1</code> for positive, <code>0</code> for zero and <code>-1</code> for negative.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>number</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="SIN"><code>SIN</code></h4>
        <code class="flow">
            <var>sine</var> <b>= SIN(</b><var>angle</var><b>)</b>
        </code>
        <p>
            Returns the sine of <code><var>angle</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
            <code><var>angle</var></code> is a numeric expression giving
            the angle in radians.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Unless PC-BASIC is run with the <code><a href="#--double">double</a></code>
                option, this function returns a single-precision value.
            </li>
            <li>
                The sine returned usually differs from the value returned by GW-BASIC in the least significant figure.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>angle</var></code> has a string value:
                <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="SPACE$"><code>SPACE$</code></h4>
        <code class="flow">
            <var>spaces</var> <b>= SPACE$(</b><var>number</var><b>)</b>
        </code>
        <p>
            Returns a string of <code><var>number</var></code> spaces.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>number</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>number</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="SQR"><code>SQR</code></h4>
        <code class="flow">
            <var>root</var> <b>= SQR(</b><var>number</var><b>)</b>
        </code>
        <p>
            Returns the square root of <code><var>number</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Unless PC-BASIC is run with the <code><a href="#--double">double</a></code>
                option, this function returns a single-precision value.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>number</var></code> has a string value: <samp>Type mismatch</samp>
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="STICK"><code>STICK</code></h4>
        <code class="flow">
            <var>pos</var> <b>= STICK(</b><var>axis</var><b>)</b>
        </code>
        <p>
            Returns a coordinate of a joystick axis. All coordinates returned are in the
            range <code>[1&#8212;254]</code> with <code>128</code> indicating the neutral position.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>axis</var></code></th>
                    <th>Return value</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>1st joystick x coordinate</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>1st joystick y coordinate</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>2nd joystick x coordinate</td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>2nd joystick y coordinate</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>axis</var></code> is a numeric expression in <code>[0&#8212;3]</code> and indicates which axis to read.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>axis</var></code> has a string value: <samp>Type mismatch</samp>
            </li>
            <li>
                <code><var>axis</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>axis</var></code> is not in <code>[0&#8212;3]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="STR$"><code>STR$</code></h4>
        <code class="flow">
            <var>repr</var> <b>= STR$(</b><var>number</var><b>)</b>
        </code>
        <p>
            Returns the string representation of <code><var>number</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>number</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>number</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="STRIG-function"><code>STRIG</code> (function)</h4>
        <code class="flow">
            <var>result</var> <b>= STRIG(</b><var>mode</var><b>)</b>
        </code>
        <p>
            Returns the status of the joystick trigger buttons.
            <code>STRIG</code> returns the following
            results, all Boolean values:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>mode</var></code></th>
                    <th>Return value</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>1st joystick, 1st trigger has been pressed since last poll.</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>1st joystick, 1st trigger is currently pressed.</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>2nd joystick, 1st trigger has been pressed since last poll.</td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>2nd joystick, 1st trigger is currently pressed.</td>
                </tr>
                <tr>
                    <td>4</td>
                    <td>1st joystick, 2nd trigger has been pressed since last poll.</td>
                </tr>
                <tr>
                    <td>5</td>
                    <td>1st joystick, 2nd trigger is currently pressed.</td>
                </tr>
                <tr>
                    <td>6</td>
                    <td>2nd joystick, 2nd trigger has been pressed since last poll.</td>
                </tr>
                <tr>
                    <td>7</td>
                    <td>2nd joystick, 2nd trigger is currently pressed.</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>mode</var></code> is a numeric expression in <code>[0&#8212;7]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The <code>STRIG</code> function returns correct results regardless of the
                <code><a href="#STRIG-switch">STRIG ON</a></code>
                status or whether <code><a href="#STRIG-function">STRIG(0)</a></code>
                has been called first.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>mode</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>mode</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>mode</var></code> is not in <code>[0&#8212;7]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="STRING$"><code>STRING$</code></h4>
        <code class="flow">
            <var>string</var> <b>= STRING$(</b><var>length</var><b>,</b> <var>char</var><b>)</b>
        </code>
        <p>
            Returns a string of <code><var>length</var></code> times character <code><var>char</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                If <code><var>char</var></code> is a numeric expression, it must be in <code>[0&#8212;255]</code> and is
                interpreted as the <a href="#cp437">code point</a> of the character.
            </li>
            <li>
                If <code><var>char</var></code> is a string expression, its first character is used.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>length</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>char</var></code> is the empty string: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>char</var></code> or <code><var>length</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>char</var></code> or <code><var>length</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="TAN"><code>TAN</code></h4>
        <code class="flow">
            <var>tangent</var> <b>= TAN(</b><var>angle</var><b>)</b>
        </code>
        <p>
            Returns the tangent of <code><var>angle</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>angle</var></code> is a numeric expression giving
                the angle in radians.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Unless PC-BASIC is run with the <code><a href="#--double">double</a></code>
                option, this function returns a single-precision value.
            </li>
            <li>
                The tangent returned usually differs from the value returned by GW-BASIC in the least significant figure.
            </li>
            <li>
                For <code><var>angle</var></code> close to multiples of <code>&#960;/2</code>, the tangent is divergent or close
                to zero. The values returned will have very low precision in these cases.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>angle</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="TIME$-function"><code>TIME$</code> (function)</h4>
        <code class="flow">
            <var>time</var> <b>= TIME$</b>
        </code>
        <p>
            Returns the current BASIC time in the form <code>"HH:mm:ss"</code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                This function takes no arguments.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="TIMER"><code>TIMER</code> (function)</h4>
        <code class="flow">
            <var>seconds</var> <b>= TIMER</b>
        </code>
        <p>
            Returns the number of seconds since midnight on the internal BASIC
            clock.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>TIMER</code> updates in ticks of 1/20 second.
            </li>
            <li>
                The least-significant two bytes of <code>TIMER</code> are often used as a seed for the
                pseudorandom number generator through <code><a href="#RANDOMIZE">RANDOMIZE</a> TIMER</code>. Since these bytes
                only take values from a limited set, that's not in fact a particularly good
                random seed. However, the pseudorandom number generator included with GW-BASIC and PC-BASIC
                is so weak that it should not be used for anything serious anyway.
            </li>
            <li>
                This function takes no arguments.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="USR"><code>USR</code></h4>
        <code class="flow">
            <var>value</var> <b>= USR</b>[<var>n</var>]<b>(</b><var>expr</var><b>)</b>
        </code>
        <p>
            Raises <samp>Illegal function call</samp>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>n</var></code> is a digit <code>[<b>0</b>&#8212;<b>9</b>]</code>.
            </li>
            <li>
                <code><var>expr</var></code> is an expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, calls a machine-code function and returns its return value.
            </li>
            <li>
                This function is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>n</var></code> is not a digit <code>[<b>0</b>&#8212;<b>9</b>]</code>: <samp>Syntax error</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="VAL"><code>VAL</code></h4>
        <code class="flow">
            <var>value</var> <b>= VAL(</b><var>string</var><b>)</b>
        </code>
        <p>
            Returns the numeric value of the string expression <code><var>string</var></code>.
            Parsing stops as soon as the first character is encountered that cannot be
            part of a number. If no characters are parsed, <code>VAL</code> returns zero.
            See the section on <a href="#literals">numeric literals</a> for the
            recognised number formats.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                Spaces before or even inside a number are ignored:
                <code>VAL(" 1 0")</code> returns <code>10</code>.
            </li>
            <li>
                If <code><var>string</var></code> contains one of the ASCII separator
                characters <code>CHR$(28)</code> (file separator),
                <code>CHR$(29)</code> (group separator) or
                <code>CHR$(31)</code> (unit separator),
                <code>VAL</code> returns zero.
                This is not the case with <code>CHR$(30)</code> (record separator).
                This behaviour conforms to GW-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>string</var></code> has a number value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="VARPTR"><code>VARPTR</code></h4>
        <code class="flow">
            <var>pointer</var> <b>= VARPTR(</b>{<var>name</var>|<b>#</b><var>file_num</var>}<b>)</b>
        </code>
        <p>
            Returns the memory address of variable <code><var>name</var></code>
            or of the File Control Block of
            file number <code><var>file_num</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>name</var></code> is a
                previously defined variable or fully indexed array element.
            </li>
            <li>
                <code><var>file_num</var></code> is a legal file number.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>VARPTR</code> can be used with <code><a href="#PEEK">PEEK</a></code>
                to read a variable's internal representation.
            </li>
            <li>
                If <code><var>name</var></code> is an undefined array element, it will be implicitly allocated in the same way as if it had been used in an expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>name</var></code> is a scalar that has not been previously defined: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[1, <var>max_files</var>]</code>,
                where <code><var>max_files</var></code> is the maximum number of files
                as set by the <code><a href="#--max-files">max-files</a></code> option:
                <samp>Bad file number</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="VARPTR$"><code>VARPTR$</code></h4>
        <code class="flow">
            <var>pointer</var> <b>= VARPTR$(</b><var>name</var><b>)</b>
        </code>
        <p>
            Returns the memory address of variable <code><var>name</var></code> in the form of a 3-byte string.
            <code><var>name</var></code> is a fully indexed array element (which may or may not have been defined) or a previously-defined scalar variable.
            The first byte is the length of the record the pointer points to:
        </p>
        <dl class="compact">
            <dt>2</dt>
            <dd>for integers</dd>

            <dt>3</dt>
            <dd>for strings (length + pointer to string space)</dd>

            <dt>4</dt>
            <dd>for single-precision floats</dd>

            <dt>8</dt>
            <dd>for double-precision floats</dd>
        </dl>
        <p>
            The last two bytes are the pointer address (as returned by
            <code><a href="#VARPTR">VARPTR</a></code>) in little-endian order.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>name</var></code> is an undefined array element, it will be implicitly allocated in the same way as if it had been used in an expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>name</var></code> is a scalar that has not been previously defined: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

</section>
<hr />

<section>
    <h3 id="statements">Statements</h3>
    <p>
        A program line is composed of a line number and one or more <dfn>statements</dfn>. If multiple statements
        are put on one line, they must be separated by colons <code>:</code>. Statements may be empty.
        Each statement has its own idiosyncratic syntax.
    </p>
    <p>
        Many reference works on GW-BASIC distinguish <dfn>commands</dfn> and statements; this distinction stems
        from the original Dartmouth design of the BASIC language, in which commands were not part of the
        language and could not be used in programs, but were rather used to control the
        interpreter itself. However, in GW-BASIC this distinction is less useful and therefore this reference
        includes what is traditionally thought of as commands in the category of statements.
    </p>

    <section>
        <h4 id="AUTO"><code>AUTO</code></h4>
        <code class="flow">
            <b>AUTO</b> [<var>line_number</var>|<b>.</b>] [<b>,</b> [<var>increment</var>]]
        </code>
        <p>
            Start automatic line numbering. Line numbers
            are automatically generated when <kbd>Enter</kbd> is pressed.
            If a program line exists at a generated line number, a <code>*</code> is shown after the
            line number. To avoid overwriting this line, leave it empty and press <kbd>Enter</kbd>.
            To stop automatic line numbering, press <kbd>Ctrl</kbd>+<kbd>Break</kbd> or <kbd>Ctrl</kbd>+<kbd>C</kbd>. The line being edited at
            that point is not saved.
            Also stops program execution and returns control to the user. Any further statements on the line will be ignored, also in direct mode.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                Line numbering starts at <code><var>line_number</var></code>, if specified. If <code>.</code> is specified, line
                numbering starts at the last program line that was stored. Otherwise, line
                numbering starts at <code>10</code>.
            </li>
            <li>
                Each next line number is incremented by <code><var>increment</var></code>, if specified. If a comma
                is used without specifying an increment, the last increment specified in an
                <code>AUTO</code> command is used. If not, <code><var>increment</var></code> defaults to <code>10</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> is not an unsigned-integer value in <code>[0&#8212;65529]</code>:
               <samp>Syntax error</samp>.
            </li>
            <li>
                When automatic line numbering is enabled and <kbd>Enter</kbd> is pressed on an empty line with number larger than
               <code>65519</code>: <samp>Undefined line number</samp>.
            </li>
            <li>
                <code><var>increment</var></code> is <code>0</code>:
                <samp>Illegal function call</samp>.
        </ul>
    </section>
<hr />

    <section>
        <h4 id="BEEP"><code>BEEP</code></h4>
        <code class="flow">
            <b>BEEP</b>
        </code>
        <p>
            Beep the speaker at 800Hz for 0.25s.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                If a <samp>Syntax error</samp> is raised, the beep is still produced.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="BEEP-switch"><code>BEEP</code> (switch)</h4>
        <code class="flow">
            <b>BEEP</b> {<b>ON</b>|<b>OFF</b>}
        </code>
        <p>
            Switches the internal speaker on or off.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                Only legal with the <code><a href="syntax">syntax</a>={pcjr|tandy}</code> option.
            </li>
            <li>
                On PC-BASIC, both the internal and the external speaker are emulated through
                the same sound system.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="BLOAD"><code>BLOAD</code></h4>
        <code class="flow">
            <b>BLOAD</b> <var>file_spec</var> [<b>,</b> <var>offset</var>]
        </code>
        <p>
            Loads a memory image file into memory.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                The string expression <code><var>file_spec</var></code> is a
                valid <a href="#filespec">file specification</a> indicating
                the file to read the memory image from.
            </li>
            <li>
                <code><var>offset</var></code> is a numeric expression in the range <code>[-32768&#8212;65535]</code>.
                It indicates an offset in the current <code><a href="#DEF-SEG">DEF SEG</a></code> segment where the file is to be
                stored. If not specified, the offset stored in the <code><a href="#BSAVE">BSAVE</a></code> file will be used. If
                negative, its two's complement will be used.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                The loaded file is not in <code>BSAVE</code> format: <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
            <li>
                <code><var>file_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>offset</var></code> is not in the range <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="BSAVE"><code>BSAVE</code></h4>
        <code class="flow">
            <b>BSAVE</b> <var>file_spec</var><b>,</b> <var>offset</var><b>,</b> <var>length</var>
        </code>
        <p>
            Saves a region of memory to an image file.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                The string expression <code><var>file_spec</var></code> is a
                valid <a href="#filespec">file specification</a> indicating
                the file to write to.
            </li>
            <li>
                <code><var>offset</var></code> is a numeric expression in the range <code>[-32768&#8212;65535]</code> indicating
                the offset into the current <code><a href="#DEF-SEG">DEF SEG</a></code> segment from where to start reading.
            </li>
            <li>
                <code><var>length</var></code> is a numeric expression in the range <code>[-32768&#8212;65535]</code> indicating
                the number of bytes to read.
            </li>
            <li>
                If <code><var>offset</var></code> or <code><var>length</var></code> are negative, their two's
                complement will be used.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
            <li>
                <code><var>offset</var></code> is not in the range <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>length</var></code> is not in the range <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
    <h4 id="CALL"><code>CALL</code> and <code>CALLS</code></h4>
    <code class="flow">
        {<b>CALL</b>|<b>CALLS</b>} <var>address_var</var> [<b>(</b> <var>p0</var> [<b>,</b> <var>p1</var>] ... <b>)</b>]
    </code>
    <p>
        Does nothing.
    </p>
    <h5>Notes</h5>
    <ul>
        <li>
            In GW-BASIC, <code>CALL</code> or <code>CALLS</code> executes a machine language subroutine.
        </li>
        <li>
            This statement is not implemented in PC-BASIC.
        </li>
    </ul>
    <h5>Parameters</h5>
    <ul>
        <li>
            <code><var>address_var</var></code> is a numeric variable name.
        </li>
        <li>
            <code><var>p0</var>, <var>p1</var>, ...</code> are variable names or array elements.
        </li>
    </ul>
    <h5>Errors</h5>
    <ul>
        <li>
            <code><var>address_var</var></code> is a string variable: <samp>Type mismatch</samp>.
        </li>
        <li>
            <code><var>address_var</var></code> is a literal or expression: <samp>Syntax error</samp>.
        </li>
    </ul>
    </section>
<hr />

    <section>
    <h4 id="CHAIN"><code>CHAIN</code></h4>
        <code class="flow">
            <b>CHAIN</b> [<b>MERGE</b>] <var>file_spec</var> [<b>,</b> [<var>line_number_expr</var>] [<b>, ALL</b>] [<b>, DELETE</b> <var>range</var> [<b>,</b> <var>ign</var>]]]
        </code>
        <p>
            Loads a program from file into memory and runs it, optionally transferring variables.
        </p>
        <ul>
            <li>
                If <code>ALL</code> is specified, all variables are transferred. If not, the variables
                specified in a <code><a href="#COMMON">COMMON</a></code> statement are transferred.
            </li>
            <li>
                If <code>MERGE</code> is specified, the loaded program is merged into the existing program. To be
                able to use this, the program file indicated by <code><var>file_spec</var></code> must be in plain text format.
            </li>
            <li>
                If <code>DELETE</code> is specified, the <code><var>range</var></code> of line numbers is deleted from the
                existing code before the merge. This is pointless without <code>MERGE</code>.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                The string expression <code><var>file_spec</var></code> is a
                valid <a href="#filespec">file specification</a> indicating
                the file to read the program from.
            </li>
            <li>
                <code><var>line_number_expr</var></code> is a numeric expression. It
                will be interpreted as a line number in the new program and execution will
                start from this line number. If <code><var>line_number_expr</var></code> is negative, it will be
                interpreted as its two's-complement.
            </li>
            <li>
                <code><var>range</var></code> is a line number range of which the closing line number is
                specified and exists before the merge.
            </li>
            <li>
                <code><var>ign</var></code> is optional and ignored.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>CHAIN</code> preserves the <code><a href="#OPTION-BASE">OPTION BASE</a></code> setting.
            </li>
            <li>
                Only if <code>ALL</code> is specified, <code><a href="DEF-FN">DEF FN</a></code> definitions are preserved.
            </li>
            <li>
                Only if <code>MERGE</code> is specified, <code><a href="#DEFINT">DEFINT</a></code>, <code>DEFSTR</code>, <code>DEFSNG</code>, <code>DEFDBL</code> definitions
                are preserved.
            </li>
            <li>
                If specified, <code>ALL</code> must precede <code>DELETE</code>; if unspecified, no comma must
                be put in its place and only two commas should precede <code>DELETE</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
            <li>
                The file specified in <code><var>file_spec</var></code>
                cannot be found: <samp>File not found</samp>.
            </li>
            <li>
                <code>MERGE</code> is specified and the loaded program was not saved in plain-text mode:
                <samp>Bad file mode</samp>.
            </li>
            <li>
                A line number in <code><var>range</var></code> is greater than 65529: <samp>Syntax error</samp>.
            </li>
            <li>
                If a <samp>Syntax error</samp> is raised by <code>CHAIN</code>, no lines are deleted and the new
                program is not loaded.
            </li>
            <li>
                The closing line number in <code><var>range</var></code> does not exist: <samp>Illegal function call</samp>
            </li>
            <li>
                If <code><var>line_number_expr</var></code> does not evaluate to an existing line number in the
                new program, <samp>Illegal function call</samp> is raised but the load or merge is
                being performed.
            </li>
            <li>
                A loaded text file contains lines without line numbers:
                <samp>Direct statement in file</samp>.
            </li>
            <li>
                A loaded text file contains lines longer than 255 characters:
                <samp>Line buffer overflow</samp>.
                Attempting to load a text file that has <code><i>LF</i></code> rather than <code><i>CR LF</i></code> line endings may cause this error.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CHDIR"><code>CHDIR</code></h4>
        <code class="flow">
            <b>CHDIR</b> <var>dir_spec</var>
        </code>
        <p>
            Change the current directory on a disk device to <code><var>dir_spec</var></code>.
            Each disk device has its own current directory.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                The string expression <code><var>dir_spec</var></code> is a
                valid <a href="#filespec">file specification</a> indicating an existing
                directory on a disk device.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No matching path is found: <samp>Path not found</samp>.
            </li>
            <li>
                <code><var>dir_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>dir_spec</var></code> is empty: <samp>Bad file name</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CIRCLE"><code>CIRCLE</code></h4>
        <code class="flow">
            <b>CIRCLE</b> [<b>STEP</b>] <b>(</b><var>x</var><b>,</b> <var>y</var>)<b>,</b> <var>radius</var>
            [<b>,</b> [<var>colour</var>] [<b>,</b> [<var>start</var>] [<b>,</b> [<var>end</var>] [<b>,</b> <var>aspect</var>]]]
        </code>
        <p>
            Draw an ellipse or ellipse sector.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                The midpoint of the ellipse is at <code>(<var>x</var></code>,<code><var>y</var>)</code>.
                If <code>STEP</code> is specified, the midpoint is <code>(<var>x</var></code>,<code><var>y</var>)</code> away from the current position.
            </li>
            <li>
                <code><var>radius</var></code> is the radius, in pixels, along the long axis.
            </li>
            <li>
                <code><var>colour</var></code> is the colour attribute.
            </li>
            <li>
                If <code><var>start</var></code> and <code><var>end</var></code> are specified, a sector of the ellipse is drawn from
                <code><var>start</var></code> radians to <code><var>end</var></code> radians, with zero radians the intersection with the
                right-hand x axis. If a negative value is specified, the arc sector is
                connected by a line to the midpoint.
            </li>
            <li>
                <code><var>aspect</var></code> specifies the ratio between the y radius and the x radius. If it is
                not specified, the standard value for the <code><a href="#SCREEN-statement">SCREEN</a></code> mode is used (see there), so
                as to make the ellipse appear like a circle on the original hardware.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                For <code><var>aspect</var> &lt;&gt; 1</code>, the midpoint algorithm used does not pixel-perfectly
                reproduce GW-BASIC's ellipses.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                The statement is executed in text mode: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>start</var></code> or <code><var>end</var></code> is not in <code>[0&#8212;2&#960;]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                The statement ends with a comma: <samp>Missing operand</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CLEAR"><code>CLEAR</code></h4>
        <code class="flow">
            <b>CLEAR</b> [<var>expr</var>] [<b>,</b> [<var>mem_limit</var>] [<b>,</b> [<var>stack_size</var>] [<b>,</b> <var>video_memory</var>]]]
        </code>
        <p>
            Clears all variables, arrays,<code><a href="#DEF-FN">DEF FN</a></code> user functions and <code><a href="#DEFINT">DEF<var>type</var></a></code> type definitions.
            Closes all files.
            Turns off all sound. Resets <code><a href="#PLAY">PLAY</a></code> state and sets music to foreground.
            Clears all <code><a href="#ON-ERROR">ON ERROR</a></code> traps. Resets <code><a href="#ERR">ERR</a></code> and <code><a href="#ERL">ERL</a></code> to zero. Disables all events.
            Turns <code><a href="#PEN-statement">PEN</a></code> and <code><a href="#STRIG-switch">STRIG</a></code> off. Resets the random number generator.
            Clears the loop stack. Resets the <code><a href="#DRAW">DRAW</a></code> state and the current graphics position.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>mem_limit</var></code> specifies the upper limit of usable memory. Default is previous
                memory size. Default memory size is 65534.
            </li>
        <li>
        <code><var>stack_size</var></code> specifies the amount of memory available to the BASIC stack.
        Default is previous stack size. Default stack size is 512.
        </li>
            <li>
                <code><var>video_memory</var></code> specifies the amount of memory available
                to the video adapter. This parameter is only legal with one of the options
                <code><a href="#--syntax">syntax</a>={pcjr, tandy}</code>. Instead of using
                <code>CLEAR</code>, the option <code><a href="#--video-memory">video-memory</a></code>
                can also be used to set video memory size.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The purpose of <code><var>expr</var></code> is unknown.
            </li>
            <li>
                If called inside a <code><a href="#FOR">FOR</a></code>&#8212;<code><a href="#NEXT">NEXT</a></code> or
                <code><a href="#WHILE">WHILE</a></code>&#8212;<code><a href="#WEND">WEND</a></code> loop, an error will be raised at
                the <code>NEXT</code> or <code>WEND</code> statement, since the loop stacks have been cleared.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the arguments has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>mem_limit</var></code>, <code><var>stack_size</var></code> are not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>mem_limit</var></code> or <code><var>stack_size</var></code> equal <code>0</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>mem_limit</var></code> equals <code>-1</code> or <code>65535</code>: <samp>Out of memory</samp>.
            </li>
            <li>
                <code><var>mem_limit</var></code> or <code><var>expr</var></code> are too low: <samp>Out of memory</samp>.
            </li>
            <li>
                <code><var>expr</var></code> is not  in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>expr</var></code> is negative: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CLOSE"><code>CLOSE</code></h4>
        <code class="flow">
            <b>CLOSE</b> [[<b>#</b>] <var>file_0</var> [<b>,</b> [<b>#</b>] <var>file_1</var>] ...]
        </code>
        <p>
            Closes files. If no file numbers are specified, all open files are closed.
            The hash (<code>#</code>) is optional and has no effect.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_1</var>, <var>file_2</var>, ...</code> are numeric expressions yielding
                file numbers.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                No error is raised if the specified file numbers were not open.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_1</var>, <var>file_2</var>, ...</code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_1</var>, <var>file_2</var>, ...</code> are not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_1</var>, <var>file_2</var>, ...</code> have a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                The statement ends in a comma, <samp>Missing operand</samp>.
            </li>
            <li>
                If an error occurs, only the files before the erratic value are closed.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CLS"><code>CLS</code></h4>
        <code class="flow">
            <b>CLS</b> [<var>x</var>][<b>,</b>]
        </code>
        <p>
            Clears the screen or part of it.
            If <code><var>x</var></code> is not specified, in SCREEN 0 the text view region is cleared;
            in other screens, the graphics view region is cleared.
            The comma is optional and has no effect.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>x</var></code> is a numeric valued expression.
        </p>
        <ul>
            <li>
                If <code><var>x</var> = 0</code>, the whole screen is cleared.
            </li>
            <li>
                If <code><var>x</var> = 1</code>, the graphics view region is cleared.
            </li>
            <li>
                If <code><var>x</var> = 2</code>, the text view region is cleared.
            </li>
        </ul>
        <p>
            The optional argument <code><var>x</var></code> is not available with
            <code><a href="#--syntax">syntax</a>={pcjr|tandy}</code>.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> is has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp> .
            </li>
            <li>
                <code><var>x</var></code> is not in <code>[0, 1, 2]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                No comma is specified but more text follows: <samp>Illegal function call</samp>.
            </li>
            <li>
                A comma is specified followed by more: <samp>Syntax error</samp>.
            </li>
            <li>
                <code><a href="#--syntax">syntax</a>=pcjr</code> is set
                and an argument is specified: <samp>Syntax error</samp>.
            </li>
            <li>
                <code><a href="#--syntax">syntax</a>=tandy</code> is set
                and an argument is specified: <samp>Illegal function call</samp>.
            </li>
            <li>
                If an error occurs, the screen is not cleared.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="COLOR"><code>COLOR</code> (text mode)</h4>
        <code class="flow">
            <b>COLOR</b> [<var>foreground</var>] [<b>,</b> [<var>background</var>] [<b>,</b> <var>border</var>]]
        </code>
        <p>
            Changes the current foreground and background attributes.
            All new characters printed will take the newly set attributes. Existing
            characters on the screen are not affected.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>foreground</var></code> is a numeric expression in <code>[0&#8212;31]</code>.
                This specifies the new foreground attribute. Attributes <code>16&#8212;31</code> are
                blinking versions of attributes <code>0&#8212;15</code>.
            </li>
            <li>
                <code><var>background</var></code> is a numeric expression in <code>[0&#8212;15]</code>.
                This specifies the new background attribute. It is taken <code>MOD 8</code>: Values
                <code>8&#8212;15</code> produce the same colour as <code>0&#8212;7</code>.
            </li>
            <li>
                <code><var>border</var></code> is a numeric expression in <code>[0&#8212;15]</code> specifying the border attribute.
            </li>
        </ul>
        <h5>Textmode attributes (colour)</h5>
        <div class="scrollable">
            <table>
                <tr><th rowspan="2" colspan="2"></th><th colspan="8">Background attribute</th></tr> <tr> <th>0</th> <th>1</th> <th>2</th> <th>3</th> <th>4</th> <th>5</th> <th>6</th> <th>7</th> </tr>
                <tr><th rowspan="32">FG</th>
                     <th>0</th> <td><code>00</code> <b><span style="color: #000000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>10</code> <b><span style="color: #000000; background-color:#0000aa;">X</span><span style="color: #000000; background-color:#0000aa;">X</span></b> </td> <td><code>20</code> <b><span style="color: #000000; background-color:#00aa00;">X</span><span style="color: #000000; background-color:#00aa00;">X</span></b> </td> <td><code>30</code> <b><span style="color: #000000; background-color:#00aaaa;">X</span><span style="color: #000000; background-color:#00aaaa;">X</span></b> </td> <td><code>40</code> <b><span style="color: #000000; background-color:#aa0000;">X</span><span style="color: #000000; background-color:#aa0000;">X</span></b> </td> <td><code>50</code> <b><span style="color: #000000; background-color:#aa00aa;">X</span><span style="color: #000000; background-color:#aa00aa;">X</span></b> </td> <td><code>60</code> <b><span style="color: #000000; background-color:#aa5500;">X</span><span style="color: #000000; background-color:#aa5500;">X</span></b> </td> <td><code>70</code> <b><span style="color: #000000; background-color:#aaaaaa;">X</span><span style="color: #000000; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>1</th> <td><code>01</code> <b><span style="color: #0000aa; background-color:#000000;">X</span><span style="color: #0000aa; background-color:#000000;">X</span></b> </td> <td><code>11</code> <b><span style="color: #0000aa; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>21</code> <b><span style="color: #0000aa; background-color:#00aa00;">X</span><span style="color: #0000aa; background-color:#00aa00;">X</span></b> </td> <td><code>31</code> <b><span style="color: #0000aa; background-color:#00aaaa;">X</span><span style="color: #0000aa; background-color:#00aaaa;">X</span></b> </td> <td><code>41</code> <b><span style="color: #0000aa; background-color:#aa0000;">X</span><span style="color: #0000aa; background-color:#aa0000;">X</span></b> </td> <td><code>51</code> <b><span style="color: #0000aa; background-color:#aa00aa;">X</span><span style="color: #0000aa; background-color:#aa00aa;">X</span></b> </td> <td><code>61</code> <b><span style="color: #0000aa; background-color:#aa5500;">X</span><span style="color: #0000aa; background-color:#aa5500;">X</span></b> </td> <td><code>71</code> <b><span style="color: #0000aa; background-color:#aaaaaa;">X</span><span style="color: #0000aa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>2</th> <td><code>02</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>12</code> <b><span style="color: #00aa00; background-color:#0000aa;">X</span><span style="color: #00aa00; background-color:#0000aa;">X</span></b> </td> <td><code>22</code> <b><span style="color: #00aa00; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>32</code> <b><span style="color: #00aa00; background-color:#00aaaa;">X</span><span style="color: #00aa00; background-color:#00aaaa;">X</span></b> </td> <td><code>42</code> <b><span style="color: #00aa00; background-color:#aa0000;">X</span><span style="color: #00aa00; background-color:#aa0000;">X</span></b> </td> <td><code>52</code> <b><span style="color: #00aa00; background-color:#aa00aa;">X</span><span style="color: #00aa00; background-color:#aa00aa;">X</span></b> </td> <td><code>62</code> <b><span style="color: #00aa00; background-color:#aa5500;">X</span><span style="color: #00aa00; background-color:#aa5500;">X</span></b> </td> <td><code>72</code> <b><span style="color: #00aa00; background-color:#aaaaaa;">X</span><span style="color: #00aa00; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>3</th> <td><code>03</code> <b><span style="color: #00aaaa; background-color:#000000;">X</span><span style="color: #00aaaa; background-color:#000000;">X</span></b> </td> <td><code>13</code> <b><span style="color: #00aaaa; background-color:#0000aa;">X</span><span style="color: #00aaaa; background-color:#0000aa;">X</span></b> </td> <td><code>23</code> <b><span style="color: #00aaaa; background-color:#00aa00;">X</span><span style="color: #00aaaa; background-color:#00aa00;">X</span></b> </td> <td><code>33</code> <b><span style="color: #00aaaa; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>43</code> <b><span style="color: #00aaaa; background-color:#aa0000;">X</span><span style="color: #00aaaa; background-color:#aa0000;">X</span></b> </td> <td><code>53</code> <b><span style="color: #00aaaa; background-color:#aa00aa;">X</span><span style="color: #00aaaa; background-color:#aa00aa;">X</span></b> </td> <td><code>63</code> <b><span style="color: #00aaaa; background-color:#aa5500;">X</span><span style="color: #00aaaa; background-color:#aa5500;">X</span></b> </td> <td><code>73</code> <b><span style="color: #00aaaa; background-color:#aaaaaa;">X</span><span style="color: #00aaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>4</th> <td><code>04</code> <b><span style="color: #aa0000; background-color:#000000;">X</span><span style="color: #aa0000; background-color:#000000;">X</span></b> </td> <td><code>14</code> <b><span style="color: #aa0000; background-color:#0000aa;">X</span><span style="color: #aa0000; background-color:#0000aa;">X</span></b> </td> <td><code>24</code> <b><span style="color: #aa0000; background-color:#00aa00;">X</span><span style="color: #aa0000; background-color:#00aa00;">X</span></b> </td> <td><code>34</code> <b><span style="color: #aa0000; background-color:#00aaaa;">X</span><span style="color: #aa0000; background-color:#00aaaa;">X</span></b> </td> <td><code>44</code> <b><span style="color: #aa0000; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>54</code> <b><span style="color: #aa0000; background-color:#aa00aa;">X</span><span style="color: #aa0000; background-color:#aa00aa;">X</span></b> </td> <td><code>64</code> <b><span style="color: #aa0000; background-color:#aa5500;">X</span><span style="color: #aa0000; background-color:#aa5500;">X</span></b> </td> <td><code>74</code> <b><span style="color: #aa0000; background-color:#aaaaaa;">X</span><span style="color: #aa0000; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>5</th> <td><code>05</code> <b><span style="color: #aa00aa; background-color:#000000;">X</span><span style="color: #aa00aa; background-color:#000000;">X</span></b> </td> <td><code>15</code> <b><span style="color: #aa00aa; background-color:#0000aa;">X</span><span style="color: #aa00aa; background-color:#0000aa;">X</span></b> </td> <td><code>25</code> <b><span style="color: #aa00aa; background-color:#00aa00;">X</span><span style="color: #aa00aa; background-color:#00aa00;">X</span></b> </td> <td><code>35</code> <b><span style="color: #aa00aa; background-color:#00aaaa;">X</span><span style="color: #aa00aa; background-color:#00aaaa;">X</span></b> </td> <td><code>45</code> <b><span style="color: #aa00aa; background-color:#aa0000;">X</span><span style="color: #aa00aa; background-color:#aa0000;">X</span></b> </td> <td><code>55</code> <b><span style="color: #aa00aa; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>65</code> <b><span style="color: #aa00aa; background-color:#aa5500;">X</span><span style="color: #aa00aa; background-color:#aa5500;">X</span></b> </td> <td><code>75</code> <b><span style="color: #aa00aa; background-color:#aaaaaa;">X</span><span style="color: #aa00aa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>6</th> <td><code>06</code> <b><span style="color: #aa5500; background-color:#000000;">X</span><span style="color: #aa5500; background-color:#000000;">X</span></b> </td> <td><code>16</code> <b><span style="color: #aa5500; background-color:#0000aa;">X</span><span style="color: #aa5500; background-color:#0000aa;">X</span></b> </td> <td><code>26</code> <b><span style="color: #aa5500; background-color:#00aa00;">X</span><span style="color: #aa5500; background-color:#00aa00;">X</span></b> </td> <td><code>36</code> <b><span style="color: #aa5500; background-color:#00aaaa;">X</span><span style="color: #aa5500; background-color:#00aaaa;">X</span></b> </td> <td><code>46</code> <b><span style="color: #aa5500; background-color:#aa0000;">X</span><span style="color: #aa5500; background-color:#aa0000;">X</span></b> </td> <td><code>56</code> <b><span style="color: #aa5500; background-color:#aa00aa;">X</span><span style="color: #aa5500; background-color:#aa00aa;">X</span></b> </td> <td><code>66</code> <b><span style="color: #aa5500; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>76</code> <b><span style="color: #aa5500; background-color:#aaaaaa;">X</span><span style="color: #aa5500; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>7</th> <td><code>07</code> <b><span style="color: #aaaaaa; background-color:#000000;">X</span><span style="color: #aaaaaa; background-color:#000000;">X</span></b> </td> <td><code>17</code> <b><span style="color: #aaaaaa; background-color:#0000aa;">X</span><span style="color: #aaaaaa; background-color:#0000aa;">X</span></b> </td> <td><code>27</code> <b><span style="color: #aaaaaa; background-color:#00aa00;">X</span><span style="color: #aaaaaa; background-color:#00aa00;">X</span></b> </td> <td><code>37</code> <b><span style="color: #aaaaaa; background-color:#00aaaa;">X</span><span style="color: #aaaaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>47</code> <b><span style="color: #aaaaaa; background-color:#aa0000;">X</span><span style="color: #aaaaaa; background-color:#aa0000;">X</span></b> </td> <td><code>57</code> <b><span style="color: #aaaaaa; background-color:#aa00aa;">X</span><span style="color: #aaaaaa; background-color:#aa00aa;">X</span></b> </td> <td><code>67</code> <b><span style="color: #aaaaaa; background-color:#aa5500;">X</span><span style="color: #aaaaaa; background-color:#aa5500;">X</span></b> </td> <td><code>77</code> <b><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>8</th> <td><code>08</code> <b><span style="color: #555555; background-color:#000000;">X</span><span style="color: #555555; background-color:#000000;">X</span></b> </td> <td><code>18</code> <b><span style="color: #555555; background-color:#0000aa;">X</span><span style="color: #555555; background-color:#0000aa;">X</span></b> </td> <td><code>28</code> <b><span style="color: #555555; background-color:#00aa00;">X</span><span style="color: #555555; background-color:#00aa00;">X</span></b> </td> <td><code>38</code> <b><span style="color: #555555; background-color:#00aaaa;">X</span><span style="color: #555555; background-color:#00aaaa;">X</span></b> </td> <td><code>48</code> <b><span style="color: #555555; background-color:#aa0000;">X</span><span style="color: #555555; background-color:#aa0000;">X</span></b> </td> <td><code>58</code> <b><span style="color: #555555; background-color:#aa00aa;">X</span><span style="color: #555555; background-color:#aa00aa;">X</span></b> </td> <td><code>68</code> <b><span style="color: #555555; background-color:#aa5500;">X</span><span style="color: #555555; background-color:#aa5500;">X</span></b> </td> <td><code>78</code> <b><span style="color: #555555; background-color:#aaaaaa;">X</span><span style="color: #555555; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>9</th> <td><code>09</code> <b><span style="color: #5555ff; background-color:#000000;">X</span><span style="color: #5555ff; background-color:#000000;">X</span></b> </td> <td><code>19</code> <b><span style="color: #5555ff; background-color:#0000aa;">X</span><span style="color: #5555ff; background-color:#0000aa;">X</span></b> </td> <td><code>29</code> <b><span style="color: #5555ff; background-color:#00aa00;">X</span><span style="color: #5555ff; background-color:#00aa00;">X</span></b> </td> <td><code>39</code> <b><span style="color: #5555ff; background-color:#00aaaa;">X</span><span style="color: #5555ff; background-color:#00aaaa;">X</span></b> </td> <td><code>49</code> <b><span style="color: #5555ff; background-color:#aa0000;">X</span><span style="color: #5555ff; background-color:#aa0000;">X</span></b> </td> <td><code>59</code> <b><span style="color: #5555ff; background-color:#aa00aa;">X</span><span style="color: #5555ff; background-color:#aa00aa;">X</span></b> </td> <td><code>69</code> <b><span style="color: #5555ff; background-color:#aa5500;">X</span><span style="color: #5555ff; background-color:#aa5500;">X</span></b> </td> <td><code>79</code> <b><span style="color: #5555ff; background-color:#aaaaaa;">X</span><span style="color: #5555ff; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>10</th> <td><code>0a</code> <b><span style="color: #55ff55; background-color:#000000;">X</span><span style="color: #55ff55; background-color:#000000;">X</span></b> </td> <td><code>1a</code> <b><span style="color: #55ff55; background-color:#0000aa;">X</span><span style="color: #55ff55; background-color:#0000aa;">X</span></b> </td> <td><code>2a</code> <b><span style="color: #55ff55; background-color:#00aa00;">X</span><span style="color: #55ff55; background-color:#00aa00;">X</span></b> </td> <td><code>3a</code> <b><span style="color: #55ff55; background-color:#00aaaa;">X</span><span style="color: #55ff55; background-color:#00aaaa;">X</span></b> </td> <td><code>4a</code> <b><span style="color: #55ff55; background-color:#aa0000;">X</span><span style="color: #55ff55; background-color:#aa0000;">X</span></b> </td> <td><code>5a</code> <b><span style="color: #55ff55; background-color:#aa00aa;">X</span><span style="color: #55ff55; background-color:#aa00aa;">X</span></b> </td> <td><code>6a</code> <b><span style="color: #55ff55; background-color:#aa5500;">X</span><span style="color: #55ff55; background-color:#aa5500;">X</span></b> </td> <td><code>7a</code> <b><span style="color: #55ff55; background-color:#aaaaaa;">X</span><span style="color: #55ff55; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>11</th> <td><code>0b</code> <b><span style="color: #55ffff; background-color:#000000;">X</span><span style="color: #55ffff; background-color:#000000;">X</span></b> </td> <td><code>1b</code> <b><span style="color: #55ffff; background-color:#0000aa;">X</span><span style="color: #55ffff; background-color:#0000aa;">X</span></b> </td> <td><code>2b</code> <b><span style="color: #55ffff; background-color:#00aa00;">X</span><span style="color: #55ffff; background-color:#00aa00;">X</span></b> </td> <td><code>3b</code> <b><span style="color: #55ffff; background-color:#00aaaa;">X</span><span style="color: #55ffff; background-color:#00aaaa;">X</span></b> </td> <td><code>4b</code> <b><span style="color: #55ffff; background-color:#aa0000;">X</span><span style="color: #55ffff; background-color:#aa0000;">X</span></b> </td> <td><code>5b</code> <b><span style="color: #55ffff; background-color:#aa00aa;">X</span><span style="color: #55ffff; background-color:#aa00aa;">X</span></b> </td> <td><code>6b</code> <b><span style="color: #55ffff; background-color:#aa5500;">X</span><span style="color: #55ffff; background-color:#aa5500;">X</span></b> </td> <td><code>7b</code> <b><span style="color: #55ffff; background-color:#aaaaaa;">X</span><span style="color: #55ffff; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>12</th> <td><code>0c</code> <b><span style="color: #ff5555; background-color:#000000;">X</span><span style="color: #ff5555; background-color:#000000;">X</span></b> </td> <td><code>1c</code> <b><span style="color: #ff5555; background-color:#0000aa;">X</span><span style="color: #ff5555; background-color:#0000aa;">X</span></b> </td> <td><code>2c</code> <b><span style="color: #ff5555; background-color:#00aa00;">X</span><span style="color: #ff5555; background-color:#00aa00;">X</span></b> </td> <td><code>3c</code> <b><span style="color: #ff5555; background-color:#00aaaa;">X</span><span style="color: #ff5555; background-color:#00aaaa;">X</span></b> </td> <td><code>4c</code> <b><span style="color: #ff5555; background-color:#aa0000;">X</span><span style="color: #ff5555; background-color:#aa0000;">X</span></b> </td> <td><code>5c</code> <b><span style="color: #ff5555; background-color:#aa00aa;">X</span><span style="color: #ff5555; background-color:#aa00aa;">X</span></b> </td> <td><code>6c</code> <b><span style="color: #ff5555; background-color:#aa5500;">X</span><span style="color: #ff5555; background-color:#aa5500;">X</span></b> </td> <td><code>7c</code> <b><span style="color: #ff5555; background-color:#aaaaaa;">X</span><span style="color: #ff5555; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>13</th> <td><code>0d</code> <b><span style="color: #ff55ff; background-color:#000000;">X</span><span style="color: #ff55ff; background-color:#000000;">X</span></b> </td> <td><code>1d</code> <b><span style="color: #ff55ff; background-color:#0000aa;">X</span><span style="color: #ff55ff; background-color:#0000aa;">X</span></b> </td> <td><code>2d</code> <b><span style="color: #ff55ff; background-color:#00aa00;">X</span><span style="color: #ff55ff; background-color:#00aa00;">X</span></b> </td> <td><code>3d</code> <b><span style="color: #ff55ff; background-color:#00aaaa;">X</span><span style="color: #ff55ff; background-color:#00aaaa;">X</span></b> </td> <td><code>4d</code> <b><span style="color: #ff55ff; background-color:#aa0000;">X</span><span style="color: #ff55ff; background-color:#aa0000;">X</span></b> </td> <td><code>5d</code> <b><span style="color: #ff55ff; background-color:#aa00aa;">X</span><span style="color: #ff55ff; background-color:#aa00aa;">X</span></b> </td> <td><code>6d</code> <b><span style="color: #ff55ff; background-color:#aa5500;">X</span><span style="color: #ff55ff; background-color:#aa5500;">X</span></b> </td> <td><code>7d</code> <b><span style="color: #ff55ff; background-color:#aaaaaa;">X</span><span style="color: #ff55ff; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>14</th> <td><code>0e</code> <b><span style="color: #ffff55; background-color:#000000;">X</span><span style="color: #ffff55; background-color:#000000;">X</span></b> </td> <td><code>1e</code> <b><span style="color: #ffff55; background-color:#0000aa;">X</span><span style="color: #ffff55; background-color:#0000aa;">X</span></b> </td> <td><code>2e</code> <b><span style="color: #ffff55; background-color:#00aa00;">X</span><span style="color: #ffff55; background-color:#00aa00;">X</span></b> </td> <td><code>3e</code> <b><span style="color: #ffff55; background-color:#00aaaa;">X</span><span style="color: #ffff55; background-color:#00aaaa;">X</span></b> </td> <td><code>4e</code> <b><span style="color: #ffff55; background-color:#aa0000;">X</span><span style="color: #ffff55; background-color:#aa0000;">X</span></b> </td> <td><code>5e</code> <b><span style="color: #ffff55; background-color:#aa00aa;">X</span><span style="color: #ffff55; background-color:#aa00aa;">X</span></b> </td> <td><code>6e</code> <b><span style="color: #ffff55; background-color:#aa5500;">X</span><span style="color: #ffff55; background-color:#aa5500;">X</span></b> </td> <td><code>7e</code> <b><span style="color: #ffff55; background-color:#aaaaaa;">X</span><span style="color: #ffff55; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>15</th> <td><code>0f</code> <b><span style="color: #ffffff; background-color:#000000;">X</span><span style="color: #ffffff; background-color:#000000;">X</span></b> </td> <td><code>1f</code> <b><span style="color: #ffffff; background-color:#0000aa;">X</span><span style="color: #ffffff; background-color:#0000aa;">X</span></b> </td> <td><code>2f</code> <b><span style="color: #ffffff; background-color:#00aa00;">X</span><span style="color: #ffffff; background-color:#00aa00;">X</span></b> </td> <td><code>3f</code> <b><span style="color: #ffffff; background-color:#00aaaa;">X</span><span style="color: #ffffff; background-color:#00aaaa;">X</span></b> </td> <td><code>4f</code> <b><span style="color: #ffffff; background-color:#aa0000;">X</span><span style="color: #ffffff; background-color:#aa0000;">X</span></b> </td> <td><code>5f</code> <b><span style="color: #ffffff; background-color:#aa00aa;">X</span><span style="color: #ffffff; background-color:#aa00aa;">X</span></b> </td> <td><code>6f</code> <b><span style="color: #ffffff; background-color:#aa5500;">X</span><span style="color: #ffffff; background-color:#aa5500;">X</span></b> </td> <td><code>7f</code> <b><span style="color: #ffffff; background-color:#aaaaaa;">X</span><span style="color: #ffffff; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>16</th> <td><code>80</code> <b><span style="color: #000000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>90</code> <b><span style="color: #000000; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a0</code> <b><span style="color: #000000; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b0</code> <b><span style="color: #000000; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c0</code> <b><span style="color: #000000; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d0</code> <b><span style="color: #000000; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e0</code> <b><span style="color: #000000; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f0</code> <b><span style="color: #000000; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>17</th> <td><code>81</code> <b><span style="color: #0000aa; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>91</code> <b><span style="color: #0000aa; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a1</code> <b><span style="color: #0000aa; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b1</code> <b><span style="color: #0000aa; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c1</code> <b><span style="color: #0000aa; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d1</code> <b><span style="color: #0000aa; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e1</code> <b><span style="color: #0000aa; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f1</code> <b><span style="color: #0000aa; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>18</th> <td><code>82</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>92</code> <b><span style="color: #00aa00; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a2</code> <b><span style="color: #00aa00; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b2</code> <b><span style="color: #00aa00; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c2</code> <b><span style="color: #00aa00; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d2</code> <b><span style="color: #00aa00; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e2</code> <b><span style="color: #00aa00; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f2</code> <b><span style="color: #00aa00; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>19</th> <td><code>83</code> <b><span style="color: #00aaaa; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>93</code> <b><span style="color: #00aaaa; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a3</code> <b><span style="color: #00aaaa; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b3</code> <b><span style="color: #00aaaa; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c3</code> <b><span style="color: #00aaaa; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d3</code> <b><span style="color: #00aaaa; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e3</code> <b><span style="color: #00aaaa; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f3</code> <b><span style="color: #00aaaa; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>20</th> <td><code>84</code> <b><span style="color: #aa0000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>94</code> <b><span style="color: #aa0000; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a4</code> <b><span style="color: #aa0000; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b4</code> <b><span style="color: #aa0000; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c4</code> <b><span style="color: #aa0000; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d4</code> <b><span style="color: #aa0000; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e4</code> <b><span style="color: #aa0000; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f4</code> <b><span style="color: #aa0000; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>21</th> <td><code>85</code> <b><span style="color: #aa00aa; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>95</code> <b><span style="color: #aa00aa; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a5</code> <b><span style="color: #aa00aa; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b5</code> <b><span style="color: #aa00aa; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c5</code> <b><span style="color: #aa00aa; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d5</code> <b><span style="color: #aa00aa; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e5</code> <b><span style="color: #aa00aa; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f5</code> <b><span style="color: #aa00aa; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>22</th> <td><code>86</code> <b><span style="color: #aa5500; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>96</code> <b><span style="color: #aa5500; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a6</code> <b><span style="color: #aa5500; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b6</code> <b><span style="color: #aa5500; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c6</code> <b><span style="color: #aa5500; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d6</code> <b><span style="color: #aa5500; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e6</code> <b><span style="color: #aa5500; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f6</code> <b><span style="color: #aa5500; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>23</th> <td><code>87</code> <b><span style="color: #aaaaaa; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>97</code> <b><span style="color: #aaaaaa; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a7</code> <b><span style="color: #aaaaaa; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b7</code> <b><span style="color: #aaaaaa; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c7</code> <b><span style="color: #aaaaaa; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d7</code> <b><span style="color: #aaaaaa; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e7</code> <b><span style="color: #aaaaaa; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f7</code> <b><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>24</th> <td><code>88</code> <b><span style="color: #555555; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>98</code> <b><span style="color: #555555; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a8</code> <b><span style="color: #555555; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b8</code> <b><span style="color: #555555; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c8</code> <b><span style="color: #555555; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d8</code> <b><span style="color: #555555; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e8</code> <b><span style="color: #555555; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f8</code> <b><span style="color: #555555; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>25</th> <td><code>89</code> <b><span style="color: #5555ff; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>99</code> <b><span style="color: #5555ff; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>a9</code> <b><span style="color: #5555ff; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>b9</code> <b><span style="color: #5555ff; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>c9</code> <b><span style="color: #5555ff; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>d9</code> <b><span style="color: #5555ff; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>e9</code> <b><span style="color: #5555ff; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>f9</code> <b><span style="color: #5555ff; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>26</th> <td><code>8a</code> <b><span style="color: #55ff55; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9a</code> <b><span style="color: #55ff55; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>aa</code> <b><span style="color: #55ff55; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>ba</code> <b><span style="color: #55ff55; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>ca</code> <b><span style="color: #55ff55; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>da</code> <b><span style="color: #55ff55; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>ea</code> <b><span style="color: #55ff55; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>fa</code> <b><span style="color: #55ff55; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>27</th> <td><code>8b</code> <b><span style="color: #55ffff; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9b</code> <b><span style="color: #55ffff; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>ab</code> <b><span style="color: #55ffff; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>bb</code> <b><span style="color: #55ffff; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>cb</code> <b><span style="color: #55ffff; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>db</code> <b><span style="color: #55ffff; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>eb</code> <b><span style="color: #55ffff; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>fb</code> <b><span style="color: #55ffff; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>28</th> <td><code>8c</code> <b><span style="color: #ff5555; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9c</code> <b><span style="color: #ff5555; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>ac</code> <b><span style="color: #ff5555; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>bc</code> <b><span style="color: #ff5555; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>cc</code> <b><span style="color: #ff5555; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>dc</code> <b><span style="color: #ff5555; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>ec</code> <b><span style="color: #ff5555; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>fc</code> <b><span style="color: #ff5555; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>29</th> <td><code>8d</code> <b><span style="color: #ff55ff; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9d</code> <b><span style="color: #ff55ff; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>ad</code> <b><span style="color: #ff55ff; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>bd</code> <b><span style="color: #ff55ff; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>cd</code> <b><span style="color: #ff55ff; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>dd</code> <b><span style="color: #ff55ff; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>ed</code> <b><span style="color: #ff55ff; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>fd</code> <b><span style="color: #ff55ff; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>30</th> <td><code>8e</code> <b><span style="color: #ffff55; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9e</code> <b><span style="color: #ffff55; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>ae</code> <b><span style="color: #ffff55; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>be</code> <b><span style="color: #ffff55; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>ce</code> <b><span style="color: #ffff55; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>de</code> <b><span style="color: #ffff55; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>ee</code> <b><span style="color: #ffff55; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>fe</code> <b><span style="color: #ffff55; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
                <tr> <th>31</th> <td><code>8f</code> <b><span style="color: #ffffff; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9f</code> <b><span style="color: #ffffff; background-color:#0000aa;">X</span><span style="color: #0000aa; background-color:#0000aa;">X</span></b> </td> <td><code>af</code> <b><span style="color: #ffffff; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> <td><code>bf</code> <b><span style="color: #ffffff; background-color:#00aaaa;">X</span><span style="color: #00aaaa; background-color:#00aaaa;">X</span></b> </td> <td><code>cf</code> <b><span style="color: #ffffff; background-color:#aa0000;">X</span><span style="color: #aa0000; background-color:#aa0000;">X</span></b> </td> <td><code>df</code> <b><span style="color: #ffffff; background-color:#aa00aa;">X</span><span style="color: #aa00aa; background-color:#aa00aa;">X</span></b> </td> <td><code>ef</code> <b><span style="color: #ffffff; background-color:#aa5500;">X</span><span style="color: #aa5500; background-color:#aa5500;">X</span></b> </td> <td><code>ff</code> <b><span style="color: #ffffff; background-color:#aaaaaa;">X</span><span style="color: #aaaaaa; background-color:#aaaaaa;">X</span></b> </td> </tr>
            </table>
        </div>

        <h5>Textmode attributes (monochrome)</h5>
        <div class="scrollable">
            <table>
                <tr><th rowspan="2" colspan="2"></th><th colspan="8">Background attribute</th></tr> <tr> <th>0</th> <th>1</th> <th>2</th> <th>3</th> <th>4</th> <th>5</th> <th>6</th> <th>7</th> </tr>
                <tr><th rowspan="32">FG</th>
                     <th>0</th> <td><code>00</code> <b><span style="color: #000000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>10</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>20</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>30</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>40</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>50</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>60</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>70</code> <b><span style="color: #000000; background-color:#00aa00;">X</span><span style="color: #000000; background-color:#00aa00;">X</span></b> </td> </tr>
                <tr> <th>1</th> <td><code>01</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>11</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>21</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>31</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>41</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>51</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>61</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>71</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span></b> </td> </tr>
                <tr> <th>2</th> <td><code>02</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>12</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>22</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>32</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>42</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>52</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>62</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>72</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>3</th> <td><code>03</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>13</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>23</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>33</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>43</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>53</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>63</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>73</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>4</th> <td><code>04</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>14</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>24</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>34</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>44</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>54</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>64</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>74</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>5</th> <td><code>05</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>15</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>25</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>35</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>45</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>55</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>65</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>75</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>6</th> <td><code>06</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>16</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>26</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>36</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>46</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>56</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>66</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>76</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>7</th> <td><code>07</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>17</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>27</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>37</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>47</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>57</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>67</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> <td><code>77</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #00aa00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>8</th> <td><code>08</code> <b><span style="color: #000000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>18</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>28</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>38</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>48</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>58</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>68</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>78</code> <b><span style="color: #005500; background-color:#00aa00;">X</span><span style="color: #005500; background-color:#00aa00;">X</span></b> </td> </tr>
                <tr> <th>9</th> <td><code>09</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>19</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>29</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>39</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>49</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>59</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>69</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>79</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span></b> </td> </tr>
                <tr> <th>10</th> <td><code>0a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>1a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>2a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>3a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>4a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>5a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>6a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>7a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>11</th> <td><code>0b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>1b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>2b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>3b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>4b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>5b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>6b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>7b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>12</th> <td><code>0c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>1c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>2c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>3c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>4c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>5c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>6c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>7c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>13</th> <td><code>0d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>1d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>2d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>3d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>4d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>5d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>6d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>7d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>14</th> <td><code>0e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>1e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>2e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>3e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>4e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>5e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>6e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>7e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>15</th> <td><code>0f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>1f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>2f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>3f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>4f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>5f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>6f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> <td><code>7f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #00ff00; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>16</th> <td><code>80</code> <b><span style="color: #000000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>90</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a0</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b0</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c0</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d0</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e0</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f0</code> <b><span style="color: #000000; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> </tr>
                <tr> <th>17</th> <td><code>81</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>91</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>a1</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>b1</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>c1</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>d1</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>e1</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>f1</code> <b><span style="color: #00aa00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> </tr>
                <tr> <th>18</th> <td><code>82</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>92</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a2</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b2</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c2</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d2</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e2</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f2</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>19</th> <td><code>83</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>93</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a3</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b3</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c3</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d3</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e3</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f3</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>20</th> <td><code>84</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>94</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a4</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b4</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c4</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d4</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e4</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f4</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>21</th> <td><code>85</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>95</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a5</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b5</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c5</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d5</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e5</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f5</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>22</th> <td><code>86</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>96</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a6</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b6</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c6</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d6</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e6</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f6</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>23</th> <td><code>87</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>97</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a7</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b7</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c7</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d7</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e7</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f7</code> <b><span style="color: #00aa00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>24</th> <td><code>88</code> <b><span style="color: #000000; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>98</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>a8</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>b8</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>c8</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>d8</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>e8</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>f8</code> <b><span style="color: #005500; background-color:#00aa00;">X</span><span style="color: #00aa00; background-color:#00aa00;">X</span></b> </td> </tr>
                <tr> <th>25</th> <td><code>89</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>99</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>a9</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>b9</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>c9</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>d9</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>e9</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> <td><code>f9</code> <b><span style="color: #00ff00; background-color:#000000; text-decoration: underline;">X</span><span style="color: #000000; background-color:#000000; text-decoration: underline;">X</span></b> </td> </tr>
                <tr> <th>26</th> <td><code>8a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9a</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>aa</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ba</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ca</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>da</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ea</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>fa</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>27</th> <td><code>8b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9b</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ab</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>bb</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>cb</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>db</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>eb</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>fb</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>28</th> <td><code>8c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9c</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ac</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>bc</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>cc</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>dc</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ec</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>fc</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>29</th> <td><code>8d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9d</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ad</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>bd</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>cd</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>dd</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ed</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>fd</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>30</th> <td><code>8e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9e</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ae</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>be</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ce</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>de</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ee</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>fe</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
                <tr> <th>31</th> <td><code>8f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>9f</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>af</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>bf</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>cf</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>df</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ef</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> <td><code>ff</code> <b><span style="color: #00ff00; background-color:#000000;">X</span><span style="color: #000000; background-color:#000000;">X</span></b> </td> </tr>
            </table>
        </div>
        <h5>Notes</h5>
        <ul>
            <li>
                The syntax and effect of <code>COLOR</code> is different in different <code>SCREEN</code>
                modes: <a href="#COLOR"><code>COLOR</code> (text mode)</a>,
                <a href="#COLOR-1"><code>COLOR</code> (<code>SCREEN 1</code>)</a>,
                <a href="#COLOR-3-9">(<code>SCREEN 3&#8212;9</code>)</a>.
            </li>
            <li>
                At least one parameter must be provided and the statement must not end in a comma.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the parameters has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                Any of the parameters is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>foreground</var></code> is not in <code>[0&#8212;31]</code>, <code><var>background</var></code> is not in
                <code>[0&#8212;15]</code> or <code><var>border</var></code> is not in <code>[0&#8212;15]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                Statement is used in <code>SCREEN 2</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="COLOR-1"><code>COLOR</code> (<code>SCREEN 1</code>)</h4>
        <code class="flow">
            <b>COLOR</b> [<var>palette_0</var>] [<b>,</b> <var>palette</var> [<b>,</b> <var>override</var>]]
        </code>
        <p>
            Assigns new colours to the palette of attributes.
        </p>
        <ul>
            <li>
                <code><var>palette_0</var></code> is a numeric expression  in <code>[0&#8212;255]</code>.
                This sets the palette colour associated with attribute 0; by default, the
                background has this attribute. All pixels with this attribute will
                change colour. The palette colour value is taken from the <a href="#ega-colours">64-colour
                set</a>. <code><var>palette_0</var></code> is taken <code>MOD 64</code>.
            </li>
            <li>
                <code><var>palette</var></code> is a numeric expression in <code>[0&#8212;255]</code> that specifies the palette:
                <ul>
                    <li>
                        <code><var>palette</var></code> odd sets the standard CGA palette (cyan, magenta, grey).
                    </li>
                    <li>
                        <code><var>palette</var></code> even sets the alternative palette (green, red, brown).
                    </li>
                </ul>
                All pixels with attributes 1,2,3 will change colour to the new palette.
            </li>
            <li>
                <code><var>override</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
                If <code><var>override</var></code> is specified, palette is set as above but using <code><var>override</var></code>
                instead of <code><var>palette</var></code>. <code><var>palette</var></code> is then ignored.
            </li>
        </ul>
        <h5 id="cga-palettes">CGA palettes</h5>
        <div class="scrollable">
            <table>
                <tr>
                <th rowspan="2">Attribute</th>
                <th colspan="3">Palette 0</th>
                <th colspan="3">Palette 1</th>
                <th colspan="3">Alternate palette</th>
                </tr>
                <tr>
                    <th>Colour</th><th>Lo</th><th>Hi</th>
                    <th>Colour</th><th>Lo</th><th>Hi</th>
                    <th>Colour</th><th>Lo</th><th>Hi</th>
                </tr>
                <tr>
                <td>0</td>
                    <td>Black</td><td style="background-color: #000000;"></td><td style="background-color: #000000;"></td>
                    <td>Black</td><td style="background-color: #000000;"></td><td style="background-color: #000000;"></td>
                    <td>Black</td><td style="background-color: #000000;"></td><td style="background-color: #000000;"></td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>Green</td><td style="background-color: #00aa00;"></td><td style="background-color: #55ff55;"></td>
                    <td>Cyan</td><td style="background-color: #00aaaa;"></td><td style="background-color: #aaffff;"></td>
                    <td>Cyan</td><td style="background-color: #00aaaa;"></td><td style="background-color: #aaffff;"></td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>Red</td><td style="background-color: #aa0000;"></td><td style="background-color: #ff5555;"></td>
                    <td>Magenta</td><td style="background-color: #aa00aa;"></td><td style="background-color: #ff55ff;"></td>
                    <td>Red</td><td style="background-color: #aa0000;"></td><td style="background-color: #ff5555;"></td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>Brown</td><td style="background-color: #aa5500;"></td><td style="background-color: #ffff55;"></td>
                    <td>White</td><td style="background-color: #aaaaaa;"></td><td style="background-color: #ffffff;"></td>
                    <td>White</td><td style="background-color: #aaaaaa;"></td><td style="background-color: #ffffff;"></td>
                </tr>
            </table>
        </div>
        <h5>Notes</h5>
        <ul>
            <li>
                The syntax and effect of <code>COLOR</code> is different in different <code>SCREEN</code>
                modes: <a href="#COLOR"><code>COLOR</code> (text mode)</a>,
                <a href="#COLOR-1"><code>COLOR</code> (<code>SCREEN 1</code>)</a>,
                <a href="#COLOR-3-9">(<code>SCREEN 3&#8212;9</code>)</a>.
            </li>
            <li>
                At least one parameter must be provided and the statement must not end in a comma.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the parameters has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                Any of the parameters is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                Any of the parameters is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="COLOR-3-9"><code>COLOR</code> (<code>SCREEN 3&#8212;9</code>)</h4>
        <code class="flow">
            <b>COLOR</b> [<var>foreground</var>] [<b>,</b> <var>palette_0</var> [<b>,</b> <var>dummy</var>]]
        </code>
        <p>
            Changes the current foreground attribute and the colour for attribute 0.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>foreground</var></code> is a numeric expression in <code>[1&#8212;15]</code>
                This sets the new foreground attribute. This applies only to new characters
                printed or pixels plotted.
            </li>
            <li>
                <code><var>palette_0</var></code> is a numeric expression in <code>[0&#8212;15]</code>
                This sets the colour associated with attribute 0; by default, the
                background has this attribute. All pixels with this attribute will
                change colour.
                In <code>SCREEN 7</code> and <code>8</code>, the <code><var>palette_0</var></code> colour is taken from the first 8 of
                the 16-colour EGA set. <code><var>palette_0</var></code> is taken <code>MOD 8</code>.
                IN <code>SCREEN 9</code>, the colour value is taken from the <a href="#ega-colours">64-colour set</a>.
            </li>
            <li>
                <code><var>dummy</var></code> is a numeric expression with a value in <code>[0&#8212;255]</code>
                The value of <code><var>dummy</var></code> is ignored.
            </li>
        </ul>

        <h5 id="ega-palette">EGA default palette</h5>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Attribute</th><th>Colour</th><th></th>
                </tr>
                <tr>
                    <td>0</td><td>Black</td><td style="background-color: #000000;"></td>
                </tr>
                <tr>
                    <td>1</td><td>Blue</td><td style="background-color: #0000aa;"></td>
                </tr>
                <tr>
                    <td>2</td><td>Green</td><td style="background-color: #00aa00;"></td>
                </tr>
                <tr>
                    <td>3</td><td>Cyan</td><td style="background-color: #00aaaa;"></td>
                </tr>
                <tr>
                    <td>4</td><td>Red</td><td style="background-color: #aa0000;"></td>
                </tr>
                <tr>
                    <td>5</td><td>Magenta</td><td style="background-color: #aa00aa;"></td>
                </tr>
                <tr>
                    <td>6</td><td>Brown</td><td style="background-color: #aa5500;"></td>
                </tr>
                <tr>
                    <td>7</td><td>Low-intensity white</td><td style="background-color: #aaaaaa;"></td>
                </tr>
                <tr>
                    <td>8</td><td>Grey</td><td style="background-color: #555555;"></td>
                </tr>
                <tr>
                    <td>9</td><td>Light Blue</td><td style="background-color: #5555ff;"></td>
                </tr>
                <tr>
                    <td>10</td><td>Light Green</td><td style="background-color: #55ff55;"></td>
                </tr>
                <tr>
                    <td>11</td><td>Light Cyan</td><td style="background-color: #55ffff;"></td>
                </tr>
                <tr>
                    <td>12</td><td>Light Red</td><td style="background-color: #ff5555;"></td>
                </tr>
                <tr>
                    <td>13</td><td>Light Magenta</td><td style="background-color: #ff55ff;"></td>
                </tr>
                <tr>
                    <td>14</td><td>Light Yellow</td><td style="background-color: #ffff55;"></td>
                </tr>
                <tr>
                    <td>15</td><td>High-intensity white</td><td style="background-color: #ffffff;"></td>
                </tr>
            </table>
        </div>

        <h5 id="ega-colours">EGA colour list</h5>
        <div class="scrollable">
            <table>
                <tr> <td>0</td><td style="background-color:#000000;"></td> <td>8</td><td style="background-color:#000055;"></td> <td>16</td><td style="background-color:#005500;"></td> <td>24</td><td style="background-color:#005555;"></td> <td>32</td><td style="background-color:#550000;"></td> <td>40</td><td style="background-color:#550055;"></td> <td>48</td><td style="background-color:#555500;"></td> <td>56</td><td style="background-color:#555555;"></td> </tr>
                <tr> <td>1</td><td style="background-color:#0000aa;"></td> <td>9</td><td style="background-color:#0000ff;"></td> <td>17</td><td style="background-color:#0055aa;"></td> <td>25</td><td style="background-color:#0055ff;"></td> <td>33</td><td style="background-color:#5500aa;"></td> <td>41</td><td style="background-color:#5500ff;"></td> <td>49</td><td style="background-color:#5555aa;"></td> <td>57</td><td style="background-color:#5555ff;"></td> </tr>
                <tr> <td>2</td><td style="background-color:#00aa00;"></td> <td>10</td><td style="background-color:#00aa55;"></td> <td>18</td><td style="background-color:#00ff00;"></td> <td>26</td><td style="background-color:#00ff55;"></td> <td>34</td><td style="background-color:#55aa00;"></td> <td>42</td><td style="background-color:#55aa55;"></td> <td>50</td><td style="background-color:#55ff00;"></td> <td>58</td><td style="background-color:#55ff55;"></td> </tr>
                <tr> <td>3</td><td style="background-color:#00aaaa;"></td> <td>11</td><td style="background-color:#00aaff;"></td> <td>19</td><td style="background-color:#00ffaa;"></td> <td>27</td><td style="background-color:#00ffff;"></td> <td>35</td><td style="background-color:#55aaaa;"></td> <td>43</td><td style="background-color:#55aaff;"></td> <td>51</td><td style="background-color:#55ffaa;"></td> <td>59</td><td style="background-color:#55ffff;"></td> </tr>
                <tr> <td>4</td><td style="background-color:#aa0000;"></td> <td>12</td><td style="background-color:#aa0055;"></td> <td>20</td><td style="background-color:#aa5500;"></td> <td>28</td><td style="background-color:#aa5555;"></td> <td>36</td><td style="background-color:#ff0000;"></td> <td>44</td><td style="background-color:#ff0055;"></td> <td>52</td><td style="background-color:#ff5500;"></td> <td>60</td><td style="background-color:#ff5555;"></td> </tr>
                <tr> <td>5</td><td style="background-color:#aa00aa;"></td> <td>13</td><td style="background-color:#aa00ff;"></td> <td>21</td><td style="background-color:#aa55aa;"></td> <td>29</td><td style="background-color:#aa55ff;"></td> <td>37</td><td style="background-color:#ff00aa;"></td> <td>45</td><td style="background-color:#ff00ff;"></td> <td>53</td><td style="background-color:#ff55aa;"></td> <td>61</td><td style="background-color:#ff55ff;"></td> </tr>
                <tr> <td>6</td><td style="background-color:#aaaa00;"></td> <td>14</td><td style="background-color:#aaaa55;"></td> <td>22</td><td style="background-color:#aaff00;"></td> <td>30</td><td style="background-color:#aaff55;"></td> <td>38</td><td style="background-color:#ffaa00;"></td> <td>46</td><td style="background-color:#ffaa55;"></td> <td>54</td><td style="background-color:#ffff00;"></td> <td>62</td><td style="background-color:#ffff55;"></td> </tr>
                <tr> <td>7</td><td style="background-color:#aaaaaa;"></td> <td>15</td><td style="background-color:#aaaaff;"></td> <td>23</td><td style="background-color:#aaffaa;"></td> <td>31</td><td style="background-color:#aaffff;"></td> <td>39</td><td style="background-color:#ffaaaa;"></td> <td>47</td><td style="background-color:#ffaaff;"></td> <td>55</td><td style="background-color:#ffffaa;"></td> <td>63</td><td style="background-color:#ffffff;"></td> </tr>
            </table>
        </div>


        <h5>Notes</h5>
        <ul>
            <li>
                The syntax and effect of <code>COLOR</code> is different in different <code>SCREEN</code>
                modes: <a href="#COLOR"><code>COLOR</code> (text mode)</a>,
                <a href="#COLOR-1"><code>COLOR</code> (<code>SCREEN 1</code>)</a>,
                <a href="#COLOR-3-9">(<code>SCREEN 3&#8212;9</code>)</a>.
            </li>
            <li>
                At least one parameter must be provided and the statement must not end in a comma.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the parameters has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                Any of the parameters is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>foreground</var></code> is not in <code>[1&#8212;15]</code>; <code><var>background</var></code> is not in <code>[0&#8212;15]</code>; or
                <code><var>dummy</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="COM"><code>COM</code></h4>
        <code class="flow">
            <b>COM(</b><var>port</var><b>)</b> {<b>ON</b>|<b>OFF</b>|<b>STOP</b>}
        </code>
        <ul>
            <li>
                <code>ON</code>: enables <code><a href="#ON-event">ON COM(<var>port</var>)</a></code> event trapping of the emulated serial port.
            </li>
            <li>
                <code>OFF</code>: disables trapping.
            </li>
            <li>
                <code>STOP</code>: halts trapping until <code>COM(<var>port</var>) ON</code> is used. Events that occur
                while trapping is halted will trigger immediately when trapping is re-enabled.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>port</var></code> is a numeric expression with a value of <code>1</code> or <code>2</code>. This specifies which
                serial port (<code>COM1:</code> or <code>COM2:</code>) is trapped. If <code><var>port</var></code> equals <code>0</code>, this statement does nothing.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>port</var></code> a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>port</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>port</var></code> is not in <code>[0&#8212;3]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>

    </section>
<hr />

    <section>
        <h4 id="COMMON"><code>COMMON</code></h4>
        <code class="flow">
            <b>COMMON</b> [<var>var_0</var> [<b>(</b> [<var>index_0</var>] <b>)</b>] [<b>,</b> [<var>var_1</var> [<b>(</b> [<var>index_1</var>] <b>)</b>] ]] ...]
        </code>
        <p>
            Specifies variables to be passed as common variables to the program called
            with <code><a href="#CHAIN">CHAIN</a></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>var_0</var>, <var>var_1</var>, ...</code> are names of scalar or array variables.
            </li>
            <li>
                <code><var>index_0</var>, <var>index_1</var>, ...</code> are optional number literals; they are ignored.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Array elements with square brackets and an index do not cause an error, but are ignored.
            </li>
            <li>
                <code>COMMON</code> statements are not executed during run time; rather, when a <code>CHAIN</code> command is encountered where <code>ALL</code> is not specified,
                all <code>COMMON</code> declarations in the program are parsed. As a consequence, the <code>DEFSTR</code>, <code>DEFINT</code>, <code>DEFSNG</code> or <code>DEFDBL</code> settings
                used are those that are active at the time of execution of the <code>CHAIN</code> statement.
            </li>
            <li>
                <code>COMMON</code> declarations need not be reachable in the program flow in order to be used.
                They may occur anywhere before or after the <code>CHAIN</code> statement that uses them.
            </li>
            <li>
                Variables may be repeated or occur in multiple <code>COMMON</code> declarations.
            </li>
            <li>
                If the <code>COMMON</code> keyword is not the first element of the statement, the
                declaration will be ignored. In particular, any <code>COMMON</code> declaration that occurs
                directly after a <code>THEN</code> or <code>ELSE</code> keyword will not be used. <code>COMMON</code>
                in the second or later statements of a compound statement after <code>THEN</code> or <code>ELSE</code>
                will be used regardless of the value of the <code>IF</code> condition.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="CONT"><code>CONT</code></h4>
        <code class="flow">
            <b>CONT</b> [<var>anything</var>]
        </code>
        <p>
            Resumes execution of a program that has been halted by
            <code><a href="#STOP">STOP</a></code>, <code><a href="#END">END</a></code>,
            <kbd>Ctrl</kbd>+<kbd>C</kbd>, or  <kbd>Ctrl</kbd>+<kbd>Break</kbd>.
            If run from a program, stops program execution and returns control to the user. Any further statements on the line will be ignored, also in direct mode.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                Anything after the <code>CONT</code> keyword is ignored.
            </li>
            <li>
                This statement can only be used in direct mode.
            </li>
            <li>
                If a break is encountered in <code><a href="#GOSUB">GOSUB</a></code> routine called from a continuing
                direct line (e.g. <code>GOSUB 100:PRINT A$</code>), <code>CONT</code> will overwrite the running
                direct line. As the subroutine <code><a href="#RETURN">RETURN</a></code>s to the position after the <code>GOSUB</code> in
                the old direct line, strange things may happen if commands are given after
                <code>CONT</code>. In GW-BASIC, this can lead to strange errors in non-existing
                program lines as the parser executes bytes that are not part of a program
                line. In PC-BASIC, if the new direct line is shorter, execution stops
                after <code>RETURN</code>; but if the direct line is extended beyond the old return
                position, the parser tries to resume at that return position, with strange
                effects.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No program is loaded, a program has not been run, after a program line
                has been modified or after <code><a href="#CLEAR">CLEAR</a></code>: <samp>Can't continue</samp>.
            </li>
            <li>
                The break occurred in a direct line: <samp>Can't continue</samp>.
            </li>
            <li>
                <code>CONT</code> is used in a program: <samp>Can't continue</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="DATA"><code>DATA</code></h4>
        <code class="flow">
            <b>DATA</b> [<var>const_0</var>] [<b>,</b> [<var>const_1</var>]] ...
        </code>
        <p>
            Specifies data that can be read by a <code><a href="#READ">READ</a></code> statement.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>const_0</var>, <var>const_1</var>, ...</code>
                are string and number literals or may be empty. String literals can be given
                with or without quotation marks. If quotation marks are omitted, leading and
                trailing whitespace is ignored and commas or colons will terminate the data
                statement.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>DATA</code> declarations need not be reachable in the program flow in order to be used.
                They may occur anywhere before or after the <code>READ</code> statement that uses them.
            </li>
            <li>
                If the <code>DATA</code> keyword is not the first element of the statement, the
                declaration will be ignored. In particular, any <code>DATA</code> declaration that occurs
                directly after a <code>THEN</code> or <code>ELSE</code> keyword will not be used. <code>DATA</code>
                in the second or later statements of a compound statement after <code>THEN</code> or <code>ELSE</code>
                will be used regardless of the value of the <code>IF</code> condition.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                If the type of the literal does not match that of the corresponding <code><a href="#READ">READ</a></code>
                statement, a <samp>Syntax error</samp> occurs on the <code>DATA</code> statement.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="DATE$-statement"><code>DATE$</code> (statement)</h4>
        <code class="flow">
            <b>DATE$ = </b><var>date</var>
        </code>
        <p>
            Sets the system date. <code><var>date</var></code> is a string expression that represents a
            date in one of the formats: <code><b>"</b><var>mm</var>{<b>-</b>|<b>/</b>}<var>dd</var>{<b>-</b>|<b>/</b>}<var>yy</var><b>"</b></code> or
            <code><b>"</b><var>mm</var>{<b>-</b>|<b>/</b>}<var>dd</var>{<b>-</b>|<b>/</b>}<var>yyyy</var><b>"</b></code>
        </p>
        <p>
            Of these,
        </p>
        <ul>
            <li>
                <code><var>mm</var></code> may be one or two characters long and must be in <code>[1&#8212;12]</code>.
            </li>
            <li>
                <code><var>dd</var></code> may be one or two characters long and must be in <code>[1&#8212;31]</code>.
            </li>
            <li>
                <code><var>yyyy</var></code> must be in <code>[1980&#8212;2099]</code>.
            </li>
            <li>
                <code><var>yy</var></code> may be one or two characters long and must be in one of the ranges:
                <ul>
                    <li>
                        <code>[0&#8212;77]</code>, interpreted as <code>2000&#8212;2077</code>; or
                    </li>
                    <li>
                        <code>[80&#8212;99]</code>, interpreted as <code>1980&#8212;1999</code>.
                    </li>
                </ul>
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The system date is not actually changed; rather, PC-BASIC remembers the
                offset from the true system date. This avoids requiring user permission
                to change the system time.
            </li>
            <li>
                GW-BASIC appears to accept invalid dates such as <code>"02-31-2000"</code>. PC-BASIC
                raises <samp>Illegal function call</samp> for these.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>date</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>date</var></code> is not in the format specified above:
                <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="DEF-FN"><code>DEF FN</code></h4>
        <code class="flow">
            <b>DEF FN</b>[ ]<var>name</var> [<b>(</b><var>arg_0</var> [<b>,</b> <var>arg_1</var>] ...<b>)</b>] <b>=</b> <var>expression</var>
        </code>
        <p>
            Defines a function called <code><a href="#FN">FN</a><var>name</var></code>
            (or <code>FN<var> name</var></code>: spaces between <code>FN</code> and <code><var>name</var></code> are optional).
            On calling <code>FN<var>name</var>( ... )</code>, <code><var>expression</var></code> is
            evaluated with the supplied parameters substituted. Any variable names used in the function that are not
            in the argument list refer to the corresponding global variables.
            The result of the
            evaluation is the return value of <code>FN<var>name</var></code>. The type of the return value
            must be compatible with the type indicated by <code><var>name</var></code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                This statement may only be used on a program line.
            </li>
            <li>
                As the function must be a single expression and PC-BASIC does not have a ternary operator, there is
                no way to define a recursive function that actually terminates.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>name</var></code> must be a legal variable name.
            </li>
            <li>
                <code><var>arg_0</var>, <var>arg_1</var>, ...</code> must be legal variable names. These are the parameters of the
                function. Variables of the same name may or may not exist in the program; their value is not affected or used by the defined function.
            </li>
            <li>
                <code><var>expression</var></code> must be a legal PC-BASIC expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                The statement is executed directly instead of in a program line: <samp>Illegal direct</samp>.
            </li>
            <li>
                If the type of the return value is incompatible with the type of <code><var>name</var></code>,
                no error is raised at the <code>DEF FN</code> statement; however, a <samp>Type mismatch</samp>
                will be raised at the first call of <code>FN<var>name</var></code>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="DEFINT"><code>DEFINT</code>, <code>DEFDBL</code>, <code>DEFSNG</code>, <code>DEFSTR</code></h4>
        <code class="flow">
            <b>{DEFINT|DEFDBL|DEFSNG|DEFSTR}</b> <var>first_0</var>[<b>-</b> <var>last_0</var>] [<b>,</b> <var>first_1</var>[<b>-</b> <var>last_1</var>]] ...
        </code>
        <p>
            Sets the type that is assumed if no <a href="#typechars">sigil</a> is specified when a variable name is used.
            The statement sets the default type for variables starting with a letter from the ranges specified.
        </p>
        <p>
            The default type is set to:
        </p>
        <dl class="compact">
            <dt><code>DEFINT</code></dt>
            <dd>integer (<code>%</code>)</dd>
            <dt><code>DEFDBL</code></dt>
            <dd>double (<code>#</code>)</dd>
            <dt><code>DEFSNG</code></dt>
            <dd>single (<code>!</code>)</dd>
            <dt><code>DEFSTR</code></dt>
            <dd>string (<code>$</code>)</dd>
        </dl>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>first_0</var>, <var>last_0</var>, ...</code> are letters of the alphabet.
                Pairs of letters connected by a dash <code>-</code> indicate inclusive ranges.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>DEFSNG A-Z</code> is the default setting.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="DEF-SEG"><code>DEF SEG</code></h4>
        <code class="flow">
            <b>DEF SEG</b> [<b>=</b> <var>address</var>]
        </code>
        <p>
            Sets the memory segment to be used by <code><a href="#BLOAD">BLOAD</a></code>, <code><a href="#BSAVE">BSAVE</a></code>, <code><a href="#CALL">CALL</a></code>,
            <code><a href="#PEEK">PEEK</a></code>, <code><a href="#POKE">POKE</a></code>, and <code><a href="#USR">USR</a></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>address</var></code> is a numeric expression in <code>[-32768&#8212;65535]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>address</var></code> is negative, it is interpreted as its two's complement.
            </li>
            <li>
                If <code><var>address</var></code> is not specified, the segment is set to the GW-BASIC data
                segment.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>address</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>address</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="DEF-USR"><code>DEF USR</code></h4>
        <code class="flow">
            <b>DEF USR</b>[<var>n</var>] <b>=</b> <var>address</var>
        </code>
        <p>
            Does nothing.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>n</var></code> is a digit between 0 and 9 inclusive.
            </li>
            <li>
                <code><var>address</var></code> is a numeric expression in <code>[-32768&#8212;65535]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, this statement sets the starting address of an assembly-language function.
            </li>
            <li>
                This statement is not implemented in PC-BASIC.
            </li>
            <li>
               If <code><var>address</var></code> is negative, it is interpreted as its two's complement.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
            <code><var>n</var></code> is not a digit in <code>[0&#8212;9]</code>: <samp>Syntax error</samp>.
        </li>
        <li>
            <code><var>address</var></code> has a string value: <samp>Type mismatch</samp>.
        </li>
        <li>
            <code><var>address</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
        </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="DELETE"><code>DELETE</code></h4>
        <code class="flow">
            <b>DELETE</b> [<var>line_number_0</var>|<b>.</b>] [<b>-</b>[<var>line_number_1</var>|<b>.</b>] ]
        </code>
        <p>
            Deletes a range of lines from the program.
            Also stops program execution and returns control to the user. Any further statements on the line will be ignored, also in direct mode.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number_0</var></code> and
                <code><var>line_number_1</var></code> are line numbers in the range <code>[0&#8212;65529]</code>, specifying the inclusive range of line numbers to delete.
            </li>
            <li>
                A <code>.</code> indicates the last line edited.
            </li>
            <li>
                If the start point is omitted, the range will start at the start of the program.
            </li>
            <li>
                If the end point is omitted, the range will end at the end of the program.
            </li>
            <li>
                If no range is specified, the whole program will be deleted.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line_number_0</var></code> or
                <code><var>line_number_1</var></code> is greater than <code>65529</code>: <samp>Syntax error</samp>.
            </li>
            <li>
                The range specified does not include any program lines stored: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="DIM"><code>DIM</code></h4>
        <code class="flow">
            <b>DIM</b> <var>name</var> [{<b>(</b>|<b>[</b>} <var>limit_0</var> [<b>,</b> <var>limit_1</var>] ... {<b>)</b>|<b>]</b>}] [<b>,</b> ... ]
        </code>
        <p>
            Allocates memory for one or more arrays.
            The <code>DIM</code> statement also fixes the number of indices of the array.
            An array can only be allocated once; to re-allocate an array, <code><a href="#ERASE">ERASE</a></code> or
            <code><a href="#CLEAR">CLEAR</a></code> must be executed first.
            If an array is first used without a <code>DIM</code> statement, it is automatically allocated with its maximum indices set at <code>10</code>
            for each index position used.
            A <code>DIM</code> entry with no brackets and no indices performs no operation. Empty brackets are not allowed.
            The least index allowed is determined by <code><a href="#OPTION-BASE">OPTION BASE</a></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>name</var>, ...</code> are legal variable names
                specifying the arrays to be allocated.
            </li>
            <li>
                <code><var>limit_0</var>, <var>limit_1</var>, ...</code> are numeric
                expressions that specify the greatest index allowed at that position.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Mixed brackets are allowed.
            </li>
            <li>
                The size of arrays is limited by the available BASIC memory.
            </li>
            <li>
                The maximum number of indices is, theoretically, <code>255</code>. In practice,
                it is limited by the 255-byte limit on the length of program lines.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>name</var></code> has already been dimensioned: <samp>Duplicate definition</samp>.
            </li>
            <li>
                An index is empty: <samp>Syntax error</samp>.
            </li>
            <li>
                An index is missing at the end: <samp>Missing operand</samp>.
            </li>
            <li>
                <code><var>limit_0</var>, <var>limit_1</var>, ...</code> have a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>limit_0</var>, <var>limit_1</var>, ...</code> are not within <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>limit_0</var>, <var>limit_1</var>, ...</code> are negative: <samp>Illegal function call</samp>.
            </li>
            <li>
                The array exceeds the size of available variable
                space: <samp>Out of memory</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="DRAW"><code>DRAW</code></h4>
        <code class="flow">
            <b>DRAW</b> <var>gml_string</var>
        </code>
        <p>
            Draws the shape specified by <code><var>gml_string</var></code>,
            a string expression in Graphics Macro Language (GML).
        </p>
        <h5>Graphics Macro Language reference</h5>
        <dl>
            <dt>Movement commands</dt>
            <dd>
                <code class="flow">
                    [<b>B</b>][<b>N</b>] <var>movement</var>
                </code>
                where the default is to move and draw; the optional prefixes mean:
                <div class="scrollable">
                <table>
                    <tr>
                        <td><code><b>B</b></code></td>
                        <td>move but do not plot</td>
                    </tr><tr>
                        <td><code><b>N</b></code></td>
                        <td>return to original point after move</td>
                    </tr>
                </table>
                </div>
                and <code><var>movement</var></code> is one of:
                <div class="scrollable">
                    <table>
                        <tr>
                            <td><code><b>U</b>[<var>n</var>]</code></td>
                            <td>up <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>L</b>[<var>n</var>]</code></td>
                            <td>left <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>D</b>[<var>n</var>]</code></td>
                            <td>down <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>R</b>[<var>n</var>]</code></td>
                            <td>right <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>E</b>[<var>n</var>]</code></td>
                            <td>up and right <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>F</b>[<var>n</var>]</code></td>
                            <td>down and right <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>G</b>[<var>n</var>]</code></td>
                            <td>down and left <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>H</b>[<var>n</var>]</code></td>
                            <td>up and left <code><var>n</var></code> steps</td>
                        </tr><tr>
                            <td><code><b>M</b>{<b>+</b>|<b>-</b>}<var>x</var><b>,</b>[<b>+</b>|<b>-</b>]<var>y</var></code></td>
                            <td>move (<code><var>x</var></code>,<code><var>y</var></code>) steps</td>
                        </tr><tr>
                            <td><code><b>M</b><var>x</var><b>,</b><var>y</var></code></td>
                            <td>move to view region coordinate (<code><var>x</var></code>,<code><var>y</var></code>)</td>
                        </tr>
                    </table>
                </div>
                <p>
                    where <code><var>n</var></code> is an integer in <code>[-32768&#8212;32767]</code> and
                    <code><var>x</var></code>, <code><var>y</var></code> are integers in <code>[0&#8212;9999]</code>.
                    Where optional, <code><var>n</var></code> defaults to <code>1</code>.
                </p>
            </dd>
            <dt>Scale commands</dt>
            <dd>
                <div class="scrollable">
                    <table>
                        <tr>
                            <td><code><b>S</b><var>n</var></code></td>
                            <td>
                                set the step size to <code><var>n</var>/4</code>. The default step size is 1 pixel.
                                <code><var>n</var></code> is an integer in <code>[1&#8212;255]</code>
                            </td>
                        </tr><tr>
                            <td><code><b>TA</b><var>n</var></code></td>
                            <td>
                                set the angle to <code><var>n</var></code> degrees. The default angle is 0 degrees.
                                <code><var>n</var></code> is an integer in <code>[-360&#8212;360]</code>
                            </td>
                        </tr>
                        <tr>
                            <td><code><b>A</b><var>n</var></code></td>
                            <td>
                                set the angle to
                                0 for <code><var>n</var>=0</code>,
                                90 for <code><var>n</var>=1</code>,
                                180 for <code><var>n</var>=2</code>,
                                270 for <code><var>n</var>=3</code>.
                                <code><var>n</var></code> is an integer in <code>[0&#8212;3]</code>
                            </td>
                        </tr>
                    </table>
                </div>
            </dd>
            <dt>Colour commands</dt>
            <dd>
                <div class="scrollable">
                    <table>
                        <tr>
                            <td><code><b>C</b><var>n</var></code></td>
                            <td>
                                set the foreground attribute to <code><var>n</var></code>,
                                where <code><var>n</var></code> is an integer in <code>[-32768&#8212;32767]</code>
                                See <code><a href="#COLOR">COLOR</a></code>.
                            </td>
                        </tr>
                        <tr>
                            <td><code><b>P</b><var>n</var>,<var>b</var></code></td>
                            <td>
                                flood fill with attribute <code><var>n</var></code> and boundary
                                attribute <code><var>b</var></code>,
                                where <code><var>n</var>, <var>b</var></code> are integers in <code>[0&#8212;9999]</code>
                                See <code><a href="#PAINT">PAINT</a></code>.
                            </td>
                        </tr>
                    </table>
                </div>
            </dd>
            <dt>Subroutine command</dt>
            <dd>
                <div class="scrollable">
                    <table>
                        <tr>
                            <td><code><b>X</b><var>s</var></code></td>
                            <td>execute a substring</td>
                        </tr>
                    </table>
                </div>
                <p><code><var>s</var></code> is one of the following:</p>
                <ul>
                    <li>a string variable name followed by semicolon (<code>;</code>)</li>
                    <li>the result of <code><a href="#VARPTR$">VARPTR$()</a></code> on a string variable</li>
                </ul>
            </dd>
        </dl>
        <p>
            Numeric variables <code><var>n</var></code>, <code><var>x</var></code>,
            <code><var>y</var></code>, <code><var>b</var></code> in the commands above can be:
        </p>
        <ul>
            <li>
                an integer literal, e.g. <code>DRAW "U100"</code>
            </li>
            <li>
                a numeric variable name or array element <code><var>var</var></code> preceded by <code>=</code> and followed by <code>;</code>.
                For example, <code>DRAW "U=VAR;"</code> or <code>DRAW "U=A(1);"</code>
            </li>
            <li>
                the result of <code>VARPTR$(<var>var</var>)</code> preceded by <code>=</code>.  For example, <code>DRAW "U=" + VARPTR$(VAR)</code>
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The <code>CLS</code> statement resets the step size to 1 pixel, angle to 0 degrees and position to the
                centre of the view region.
            </li>
            <li>
                The value <code><var>n</var></code> in the <code>TA</code>, <code>A</code> and <code>C</code> command can be left out but <em>only</em> if the
                command is terminated by a semicolon. <code><var>n</var></code> defaults to <code>0</code>.
            </li>
            <li>
                In GW-BASIC, the numeric arguments of <code><b>U</b></code>, <code><b>L</b></code>, <code><b>D</b></code>,
                <code><b>R</b></code>, <code><b>E</b></code>, <code><b>F</b></code>, <code><b>G</b></code>, <code><b>H</b></code>, and <code><b>C</b></code>
                can be in the range <code>[-99999&#8212;99999]</code>;
                however, results for large numbers are unpredictable. This is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>gml_string</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>gml_string</var></code> has errors in the GML: <samp>Illegal function call</samp>.
            </li>
            <li>
                A variable referenced in the GML string is of incorrect type: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="EDIT"><code>EDIT</code></h4>
        <code class="flow">
            <b>EDIT</b> {<var>line_number</var>|<b>.</b>}
        </code>
        <p>
            Displays the specified program line with the cursor positioned for editing.
            <code><var>line_number</var></code> must be a line that exists in the program, or a period (.) to
            indicate the last line stored.
            Also stops program execution and returns control to the user. Any further statements on the line will be ignored, also in direct mode.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                No line_number is specified: <samp>Undefined line number</samp>.
            </li>
            <li>
                More characters are written after the line number: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>line_number</var></code> is not in <code>[0&#8212;65529]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                The specified line number does not exist: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ELSE"><code>ELSE</code></h4>
        <code class="flow">
            <b>ELSE</b> [<var>anything</var>]
        </code>
        <p>
            Unless part of an <code><a href="#IF">IF</a></code> statement on the same line, anything after <code>ELSE</code> is ignored
            in the same way as after <code>'</code> or <code>:<a href="#REM">REM</a></code>. No colon <code>:</code> preceding
            the <code>ELSE</code> statement is necessary. See <code><a href="#IF">IF</a></code> for normal usage.
        </p>
    </section>
<hr />

    <section>
        <h4 id="END"><code>END</code></h4>
        <code class="flow">
            <b>END</b>
        </code>
        <p>
            Closes all files, stops program execution and returns control to the user.
            No message is printed. It is possible to resume execution at the next statement
            using <code><a href="#CONT">CONT</a></code>.
        </p>
    </section>
<hr />

    <section>
        <h4 id="ENVIRON"><code>ENVIRON</code></h4>
        <code class="flow">
            <b>ENVIRON</b> <var>command_string</var>
        </code>
        <p>
            Sets a shell environment variable.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>command_string</var></code> is a string expression of one of the following forms:
        </p>
        <dl>
            <dt>
                <code class="flow">
                    <b>"</b><var>VARIABLE</var><b>=</b><var>VALUE</var><b>"</b>
                </code>
            </dt>
            <dd>
                to set <code><var>VARIABLE</var></code> to <code><var>VALUE</var></code>;
            </dd>
            <dt>
                <code class="flow">
                    <b>"</b><var>VARIABLE</var><b>="</b>
                </code>
            </dt>
            <dd>
                to unset <code><var>VARIABLE</var></code>.
            </dd>
        </dl>
        <p>
            <code><var>VARIABLE</var></code> must be an
            ASCII string and will be converted to uppercase on case-sensitive systems.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>command_string</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>command_string</var></code> is not of the required form: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>VARIABLE</var></code> contains characters outside of ASCII: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ERASE"><code>ERASE</code></h4>
        <code class="flow">
            <b>ERASE</b> <var>array_0</var> [<b>,</b> <var>array_1</var>] ...
        </code>
        <p>
            De-allocates arrays. The data stored in the
            arrays is lost.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>array_0</var>, <var>array_1</var> ...</code> are names of existing arrays. The names must be
                specified without brackets.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No array names are given: <samp>Syntax error</samp>.
            </li>
            <li>
                <code><var>array_0</var>, <var>array_1</var> ...</code> do not exist: <samp>Illegal function call</samp>.
            </li>
            <li>
                If an error occurs, the arrays named before the error occurred are erased.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ERROR"><code>ERROR</code></h4>
        <code class="flow">
            <b>ERROR</b> <var>error_number</var>
        </code>
        <p>
            Raises the error with number <code><var>error_number</var></code>.
            See the <a href="#errors">list of error numbers and messages</a>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>error_number</var></code> is an expression
                with a numeric value.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>error_number</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>error_number</var></code> is not in  <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>error_number</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="FIELD"><code>FIELD</code></h4>
        <code class="flow">
            <b>FIELD</b> [<b>#</b>] <var>file_number</var> [<b>,</b> <var>width_0</var> <b>AS</b> <var>name_0</var> [<b>,</b> <var>width_1</var> <b>AS</b> <var>name_1</var>] ...]
        </code>
        <p>
            Assigns variables to the random-access record buffer. The record buffer is a
            region of memory of length defined by the <code><a href="#OPEN">OPEN</a></code> statement; the default record
            length is 128 bytes. The <code><a href="#FIELD">FIELD</a></code> statement assigns a portion of this region to
            one or more fixed-length string variables, so that the value of these strings
            is whatever happens to be in the record buffer at that location.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                A <code>FIELD</code> statement
                without any variables specified has no effect.
            </li>
            <li>
                Another  <code>FIELD</code> statement on the same file will specify an alternative mapping of the
                same file buffer; all mappings will be in effect simultaneously.
            </li>
            <li>
                A subsequent assignment or <code><a href="#LET">LET</a></code> or <code><a href="#MID$">MID$</a></code> statement on <code><var>name_0</var> , <var>name_1</var> ...</code> will dis-
                associate the string variable from the field buffer.
            </li>
            <li>
                Use <code><a href="#LSET">LSET</a></code>, <code><a href="#RSET">RSET</a></code> or
                <code><a href="#MID$-statement">MID$</a></code> to copy values into a <code><a href="#FIELD">FIELD</a></code> buffer.
            </li>
            <li>
                Use <code><a href="#GET-files">GET</a></code> to read values from the file into the field
                buffer, changing the variables.
            </li>
            <li>
                Use <code><a href="#PUT-files">PUT</a></code> to write the field buffer to the file.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is a numeric expression that yields the number of an open random-access file. The <code>#</code> is optional and has no effect.
            </li>
            <li>
                <code><var>width_0</var>, <var>width_1</var>, ...</code> are numeric
                expressions giving the length of the string variables
            </li>
            <li>
                <code><var>name_0</var> , <var>name_1</var> ...</code> are string variables.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not the number of an open file:
                <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is open under a mode other than <code>RANDOM</code>:
                <samp>Bad file mode</samp>.
            </li>
            <li>
                The statement ends in a comma: <samp>Missing operand</samp>.
            </li>
            <li>
                No file number is specified: <samp>Missing operand</samp>.
            </li>
            <li>
                The lengths in a <code><a href="#FIELD">FIELD</a></code> statement add up to a number larger than the
                record length of the field buffer: <samp>Field overflow</samp>.
            </li>
            <li>
                <code><var>name_0</var> , <var>name_1</var> ...</code> specify a non-string variable: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="FILES"><code>FILES</code></h4>
        <code class="flow">
            <b>FILES</b> [<var>filter_spec</var>]
        </code>
        <p>
            Displays the files fitting the specified filter in the specified directory on a disk device. If
            <code><var>filter_spec</var></code> is not specified, displays all files in the current working
            directory.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>filter_spec</var></code> is a string expression that
                is much like a <a href="#filespec">file specification</a>, but optionally allows the file
                name part to contain <dfn>wildcards</dfn>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The filename filter may contain the following wildcards:
                <div class="scrollable">
                    <table>
                        <tr>
                            <td><code>?</code></td>
                            <td>Matches any legal file name character.</td>
                        </tr>
                        <tr>
                            <td><code>*</code></td>
                            <td>Matches any series of legal file name characters.</td>
                        </tr>
                    </table>
                </div>
            </li>
            <li>
                The filter
                will only match <a href="#eightpointthree">MS-DOS style filenames</a>.
            </li>
            <li>
                Matched character series do not stretch across directory separators <code>\</code>
                or extension separators <code>.</code>. To match all files with all extensions,
                use <code>*.*</code>.
            </li>
            <li>
                Alternatively, if all files in a
                specified directory are required, end the directory name with a backslash <code>\</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>filter_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>filter_spec</var></code> is the empty string: <samp>Bad file name</samp>.
            </li>
            <li>
                The specified filter does not match any files: <samp>File not found</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="FOR"><code>FOR</code></h4>
        <code class="flow">
            <b>FOR</b> <var>loop_var</var> <b>=</b> <var>start</var> <b>TO</b> <var>stop</var> [<b>STEP</b> <var>step</var>]
        </code>
        <p>
            Initiates a <code>FOR&#8212;NEXT</code> loop.
        </p>
        <p>
            Initially, <code><var>loop_var</var></code> is set to <code><var>start</var></code>. Then, the statements between the <code>FOR</code>
            statement and the <code><a href="#NEXT">NEXT</a></code> statement are executed and <code><var>loop_var</var></code> is incremented by
            <code><var>step</var></code> (if <code><var>step</var></code> is not specified, by 1). This is repeated until <code><var>loop_var</var></code>
            has become greater than <code><var>stop</var></code>. Execution then continues at the statement
            following <code>NEXT</code>. The value of <code><var>loop_var</var></code> equals <code><var>stop</var>+<var>step</var></code> after the loop.
        </p>
        <p>
            <code><var>start</var></code>, <code><var>stop</var></code> and <code><var>step</var></code> are evaluated only once and the resulting
            values are used throughout the loop.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>loop_var</var></code> is an integer or single-precision variable.
            </li>
            <li>
                <code><var>start</var></code>, <code><var>stop</var></code> and <code><var>step</var></code> are numeric expressions.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No <code>NEXT</code> statement is found to match the <code>FOR</code>
                statement: <samp>FOR without NEXT</samp> occurs at the <code>FOR</code>
                statement.
            </li>
            <li>
                <code><var>loop_var</var></code> is a string variable or <code><var>start</var></code>,
                <code><var>stop</var></code>, or <code><var>end</var></code> has a string value:
                <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>loop_var</var></code> is a double-precision variable:
                <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>loop_var</var></code> is an array element: <samp>Syntax error</samp> .
            </li>
            <li>
                <code><var>loop_var</var></code> is an integer variable and a <code><var>start</var></code>, <code><var>stop</var></code> or <code><var>step</var></code>
                is outside the range <code>[-32768, 32767]</code>: <samp>Overflow</samp> .
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="GET-files"><code>GET</code> (files)</h4>
        <code class="flow">
            <b>GET</b> [<b>#</b>] <var>file_number</var> [<b>,</b> <var>record_number</var>]
        </code>
        <p>
            Read a record from the random-access file <code><var>file_number</var></code> at position
            <code><var>record_number</var></code>.
            The record can be accessed through the <code><a href="#FIELD">FIELD</a></code>
            variables or through <code><a href="#INPUT$">INPUT$</a></code>,
            <code><a href="#INPUT">INPUT</a></code> or
            <code><a href="#LINE-INPUT">LINE INPUT</a></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is a numeric expression that yields the number
                of an open random-access file. The <code>#</code> is optional and has no effect.
            </li>
            <li>
                <code><var>record_number</var></code> is a numeric expression in <code>[1&#8212;33554432]</code> (<code>2^25</code>), and is interpreted as the record number.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If the record number is beyond the end of the file, the file buffer is
                filled with null bytes.
            </li>
            <li>
                The record number is stored as single-precision; this precision is not high enough to distinguish single
                records near the maximum value of <code>2^25</code>.
            </li>
        </ul>
            <h5>Errors</h5>
        <ul>
            <li>
                <code><var>record_number</var></code> is not in <code>[1&#8212;33554432]</code>: <samp>Bad record number</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not the number of an open file:
                <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is open under a mode other than <code>RANDOM</code>:
                <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not specified: <samp>Missing operand</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="GET-serial"><code>GET</code> (communications)</h4>
        <code class="flow">
            <b>GET</b> [<b>#</b>] <var>com_file_number</var> [<b>,</b> <var>number_bytes</var>]
        </code>
        <p>
            Read <code><var>number_bytes</var></code> bytes from the communications buffer opened under file
            number <code><var>com_file_number</var></code>.
            The record can be accessed through the <code><a href="#FIELD">FIELD</a></code>
            variables or through <code><a href="#INPUT$">INPUT$</a></code>,
            <code><a href="#INPUT">INPUT</a></code> or
            <code><a href="#LINE-INPUT">LINE INPUT</a></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is a numeric expression that yields the number
                of a file open to a <code>COM</code> device. The <code>#</code> is optional and has no effect.
            </li>
            <li>
                <code><var>number_bytes</var></code> is a numeric expression between <code>1</code>
                and the <code>COM</code> buffer length, inclusive.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>bytes</var></code> is <code>32768</code> or greater, GW-BASIC hangs. This functionality is not implemented in PC-BASIC.
            </li>
            <li>
                In GW-BASIC, <samp>Device I/O error</samp> is raised for overrun error, framing error,
                and break interrupt. <samp>Device fault</samp> is raised if DSR is lost during I/O.
                <samp>Parity error</samp> is raised if parity is enabled and incorrect parity is
                encountered. This is according to the manual; it is untested.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>bytes</var></code> is less than 1: <samp>Bad record number</samp>
            </li>
            <li>
                <code><var>bytes</var></code> is less than <code>32768</code> and greater than the <code>COM</code> buffer length: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>com_file_number</var></code> is not specified: <samp>Missing operand</samp>.
            </li>
            <li>
                <code><var>com_file_number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>com_file_number</var></code> is not the number of an open file:
                <samp>Bad file number</samp>.
            </li>
            <li>
                If the serial input buffer is full, i.e. <code><a href="#LOF">LOF</a>(<var>com_file_number</var>) = 0</code>, and
                <code><a href="#LOC">LOC</a>(<var>com_file_number</var>) = 255</code>: <samp>Communication buffer overflow</samp>
            </li>
            <li>
                If the carrier drops during <code>GET</code>, hangs until the <kbd>Ctrl</kbd>+<kbd>Break</kbd> key is pressed.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="GET-graphics"><code>GET</code> (graphics)</h4>
        <code class="flow">
            <b>GET (</b><var>x0</var><b>,</b> <var>y0</var><b>) -</b> [<b>STEP</b>] <b>(</b><var>x1</var><b>,</b> <var>y1</var><b>),</b> <var>array_name</var>
        </code>
        <p>
            Stores a rectangular area of the graphics screen in an array.
            The area stored is a rectangle parallel to the screen edges, bounded by the
            top-left and bottom-right coordinates <code><var>x0</var></code>,<code><var>y0</var></code> and <code><var>x1</var></code>,<code><var>y1</var></code>. If <code>STEP</code> is
            specified, <code><var>x1</var></code>,<code><var>y1</var></code> is an offset from <code><var>x0</var></code>,<code><var>y0</var></code>. The area is such that these
            corner points are inside it.
        </p>
        <p>
            The image stored in the array can then be put on the screen using PUT. For the
            purposes of <code>GET</code>, any array is considered a string of bytes. The byte size of an
            array can be calculated as <code><var>number_elements</var> * <var>byte_size</var></code> with <code><var>byte_size</var></code> equal to
            <code>2</code> for integers (<code>%</code>), 4 for single (<code>!</code>) and 8 for double (<code>#</code>).
            Array byte size for
            string is 3, but string arrays are not allowed in <code>GET</code>. For calculating the
            number of elements, keep in mind that <code><a href="#OPTION-BASE">OPTION BASE</a> 0</code> is the default; in which
            case an array with maximum index 10 has 11 elements. This works through in
            multidimensional arrays.
        </p>
        <p>
            The array format is as follows:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Byte</th>
                    <th>Contains</th>
                </tr><tr>
                    <td>0, 1</td>
                    <td>Number of x pixels, unsigned int. In <code>SCREEN 1</code>, this value is doubled.</td>
                </tr><tr>
                    <td>2, 3</td>
                    <td>Number of y pixels, unsigned int.</td>
                </tr><tr>
                    <td>4&#8212;</td>
                    <td>
                        Pixel data. Data is arranged in 2-byte words. The first 16-bit word holds the bit 0 of
                        the first 16 pixels on the top row. The second word holds the second bit,
                        etc. Data is word-aligned at the end of each row. Thus, in a screen mode
                        with 4 bits per pixel, the first row takes at least 8 bytes (4 words), even
                        if it consists of only one pixel. The number of bits per pixel depends on
                        the <code><a href="#SCREEN-statement">SCREEN</a></code> mode.
                    </td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>array_name</var></code> is the name of a numeric array dimensioned with enough space to store the area.
            </li>
            <li>
                <code><var>x0</var></code>, <code><var>y0</var></code>, <code><var>x1</var></code>, <code><var>y1</var></code> are numeric expressions.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In PCjr/Tandy mode, in <code>SCREEN 6</code>, <code>GET</code> stores an area of <em>twice the width</em>
                of the specified rectangle.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                The array does not exist: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>array_name</var></code> refers to a string array: <samp>Type mismatch</samp>.
            </li>
            <li>
                The area is too large for the array: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>x0</var></code>, ... <code><var>y1</var></code> are string expressions: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x0</var></code>, ... <code><var>y1</var></code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>x0</var></code>, ... <code><var>y1</var></code> are outside the current <code>VIEW</code> or <code>WINDOW</code>:
                <samp>Illegal function call</samp>
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="GOSUB"><code>GOSUB</code></h4>
        <code class="flow">
            <b>GO</b>[ ]<b>SUB</b> <var>line_number</var> [<var>anything</var>]
        </code>
        <p>
            Jumps to a subroutine at <code><var>line_number</var></code>. The next
            <code><a href="#RETURN">RETURN</a></code> statement jumps back to
            the statement after <code>GOSUB</code>. Anything after <code><var>line_number</var></code> until the end of the
            statement is ignored. If executed from a direct line, <code>GOSUB</code> runs the subroutine and
            the following <code>RETURN</code> returns execution to the direct line.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> is an existing line number literal.
            </li>
            <li>
                Further characters on
                the line are ignored until end of statement.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If no <code>RETURN</code> is encountered, no problem.
            </li>
            <li>
                One optional space is allowed between <code>GO</code> and <code>SUB</code>; it will not be retained in
                the program.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                If <code><var>line_number</var></code> does not exist: <samp>Undefined line number</samp>.
            </li>
            <li>
                If <code><var>line_number</var></code> is greater than <code>65529</code>, only the first 4 characters are
                read (e.g. <code>6553</code>)
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="GOTO"><code>GOTO</code></h4>
        <code class="flow">
            <b>GO</b>[ ]<b>TO</b> <var>line_number</var> [<var>anything</var>]
        </code>
        <p>
            Jumps to <code><var>line_number</var></code>.  Anything after <code><var>line_number</var></code> until the end of the
            statement is ignored. If executed from a direct line, <code>GOTO</code> starts execution of the program at the specified line.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> is an existing line number literal.
            </li>
            <li>
                Further characters on
                the line are ignored until end of statement.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Any number of optional spaces is allowed between <code>GO</code> and <code>TO</code>, but they will
                not be retained in the program.
            </li>
            <li>
                If <code><var>line_number</var></code> is greater than <code>65529</code>, only the first 4 characters are
                read (e.g. <code>GOTO 65530</code> is executed as <code>GOTO 6553</code>)
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> does not exist: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="IF"><code>IF</code></h4>
        <code class="flow">
            <b>IF</b> <var>truth_value</var> [<b>,</b>] {<b>THEN</b>|<b>GOTO</b>} [<var>compound_statement_true</var>|<var>line_number_true</var> [<var>anything</var>]]
            [<b>ELSE</b> [<var>compound_statement_false</var>|<var>line_number_false</var> [<var>anything</var>]]]
       </code>
        <p>
            If <code><var>truth_value</var></code> is non-zero, executes <code><var>compound_statement_true</var></code> or jumps to <code><var>line_number_true</var></code> .
            If it is zero, executes <code><var>compound_statement_false</var></code> or jumps to <code><var>line_number_false</var></code> .
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>truth_value</var></code>
                is a numeric expression.
            </li>
            <li>
                <code><var>line_number_false</var></code> and <code><var>line_number_true</var></code> are existing line numbers.
            </li>
            <li>
                <code><var>compound_statement_false</var></code> and <code><var>compound_statement_true</var></code> are compound statements,
                consisting of at least one statement, optionally followed by further statements separated by colons <code>:</code>. The compound statements
                may contain nested <code>IF&#8212;THEN&#8212;ELSE</code> statements.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The comma is optional and ignored.
            </li>
            <li>
                <code><a href="#ELSE">ELSE</a></code> clauses are optional; they
                are bound to the innermost free <code>IF</code> statement if nested. Additional <code>ELSE</code>
                clauses that have no matching <code>IF</code> are ignored.
            </li>
            <li>
                All clauses must be on the same
                program line.
            </li>
            <li>
               <code>THEN</code> and <code>GOTO</code> are interchangeable; which one is chosen is independent
                of whether a statement or a line number is given. <code>GOTO PRINT 1</code> is fine.
            </li>
            <li>
                As in <code><a href="#GOTO">GOTO</a></code>, anything after the line number is ignored.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
               If <code><var>truth_value</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>truth_value</var></code> equals <code>0</code> and <code><var>line_number_false</var></code> is a non-existing line number,
                or
                <code><var>truth_value</var></code> is nonzero and <code><var>line_number_true</var></code> is a non-existing line number:
                <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="INPUT"><code>INPUT</code> (console)</h4>
        <code class="flow">
            <b>INPUT</b> [<b>;</b>] [<var>prompt</var> {<b>;</b>|<b>,</b>}] <var>var_0</var> [<b>,</b> <var>var_1</var>] ...
        </code>
        <p>
            Prints <code><var>prompt</var></code> to the screen and waits for the user to input values for the specified variables.
            The semicolon before the prompt, if present,
            stops a newline from being printed after the values have been entered.
            If the prompt is followed by a semicolon, it is printed with a trailing <code>?</code>. If
            the prompt is followed by a comma, no question mark is added.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>prompt</var></code> is a string literal.
            </li>
            <li>
                <code><var>var_0</var>, <var>var_1</var>, ...</code> are variable names or fully indexed array elements.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Values entered must be separated by commas. Leading and trailing whitespace
                is discarded.
            </li>
            <li>
                String values can be entered with or without double quotes (<code>"</code>).
            </li>
            <li>
                If a string with a comma, leading or trailing whitespace is needed,
                quotes are the only way to enter it.
            </li>
            <li>
                Between a closing quote and the comma at the end of the entry, only white-
                space is allowed.
            </li>
            <li>
                If quotes are needed in the string itself, the first character must be
                neither a quote nor whitespace. It is not possible to enter a string that
                starts with a quote through <code>INPUT</code>.
            </li>
            <li>
                If a given <code><var>var_n</var></code> is a numeric variable, the value entered must be
                number literal.
            </li>
            <li>
                Characters beyond the 255th character of the screen line are discarded.
            </li>
            <li>
                If user input is interrupted by <kbd>Ctrl</kbd>+<kbd>Break</kbd>,
                <code><a href="#CONT">CONT</a></code> will re-execute the
                <code>INPUT</code> statement.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                If the value entered for a numeric variable is not a valid numeric literal,
                or the number of values entered does not match the number of variables in
                the statement,
                <samp>?Redo from start</samp> is printed and all values must be entered again.
            </li>
            <li>
                A <samp>Syntax error</samp> that is caused after the prompt is printed is only raised
                after the value shave been entered. No values are stored.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="INPUT-file"><code>INPUT</code> (files)</h4>
        <code class="flow">
            <b>INPUT #</b> <var>file_num</var><b>,</b> <var>var_0</var> [<b>,</b> <var>var_1</var>] ...
        </code>
        <p>
            Reads string or numeric variables from a text file or the <code>FIELD</code> buffer
            of a random access file.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> is the number of a file open in
                <code>INPUT</code> mode or a random-access file open in <code>RANDOM</code> mode.
            </li>
            <li>
                <code><var>var_0</var>, <var>var_1</var>, ...</code> are variable names or fully indexed array elements.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The <code>#</code> is mandatory. There may or may not be whitespace between <code>INPUT</code> and <code>#</code>.
            </li>
            <li>
                String values can be entered with or without double quotes (<code>"</code>).
            </li>
            <li>
                Numeric values are terminated by <code>&#160;</code>, <code><i>LF</i></code>, <code><i>CR</i></code>, <code>,</code>.
            </li>
            <li>
                Unquoted strings are terminated by <code><i>LF</i></code>, <code><i>CR</i></code>, <code>,</code>.
            </li>
            <li>
                Quoted strings are terminated by the closing quote.
            </li>
            <li>
                Any entry is terminated by <code><i>EOF</i></code> character or its 255th character.
            </li>
            <li>
                Leading and trailing whitespace is discarded.
            </li>
            <li>
                If the entry cannot be converted to the requested type, a zero value is
                returned.
            </li>
            <li>
                If <code><var>file_num</var></code> is open to <code>KYBD:</code>, <code>INPUT#</code> reads from the keyboard until a
                return or comma is encountered (as in a file). Arrow keys and delete are
                passed as their control characters (<em>not</em> scancodes!) preceded by <code><a href="#CHR$">CHR$</a>(&amp;hFF)</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Input is requested after the end of a text file has been reached or an
                <code><i>EOF</i></code> character has been encountered: <samp>Input past end</samp>.
            </li>
            <li>
                The last character of the field buffer is read: <samp>Field overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is greater than <code>32767</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is less than zero: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not open for <code>INPUT</code> or <code>RANDOM</code>: <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is open to a <code>COM</code> port and this is the
                first <code><a href="#INPUT-file">INPUT</a></code>, <code><a href="#LINE-INPUT-file">LINE INPUT</a></code> or <code><a href="#INPUT$">INPUT$</a></code> call on that port
                since the buffer has filled up completely (i.e. <code><a href="#LOF">LOF</a>(<var>file_num</var>)</code> has become zero):
                <samp>Communication buffer overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="IOCTL"><code>IOCTL</code></h4>
        <code class="flow">
            <b>IOCTL</b> [<b>#</b>] <var>file_num</var><b>,</b> <var>control_string</var>
        </code>
        <p>
            Raises <samp>Illegal function call</samp>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, <code>IOCTL</code> sends a control string to a device.
            </li>
            <li>
                This statement is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
               Otherwise: <samp>Illegal function call</samp>
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="KEY-list"><code>KEY</code> (macro list)</h4>
        <code class="flow">
            <b>KEY</b> {<b>ON</b>|<b>OFF</b>|<b>LIST</b>}
        </code>
        <p>
            Turns the list of function-key macros on the bottom of the screen <code>ON</code> or <code>OFF</code>.
            If <code>LIST</code> is specified, prints a list of
            the 10 (or 12 with <code><a href="#--syntax">syntax</a>=tandy</code>) function keys
            with the function-key macros defined for those keys to the console.
        </p>
        <p>
            Most characters are represented by their symbol equivalent in the current <a href="#cp437">codepage</a>.
            However, some characters get a different representation, which is a symbolic representation
            of their effect as control characters on the screen.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th>
                        Code point
                    </th>
                    <th>
                        Replacement
                    </th>
                    <th>
                        Usual glyph
                    </th>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h07</code>
                    </td>
                    <td>
                        <code>&amp;h0E</code>
                    </td>
                    <td>
                        &#x266b;
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h08</code>
                    </td>
                    <td>
                        <code>&amp;hFE</code>
                    </td>
                    <td>
                        &#x25a0;
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h09</code>
                    </td>
                    <td>
                        <code>&amp;h1A</code>
                    </td>
                    <td>
                        &#x2192;
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h0A</code>
                    </td>
                    <td>
                        <code>&amp;h1B</code>
                    </td>
                    <td>
                        &#x2190;
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h0B</code>
                    </td>
                    <td>
                        <code>&amp;h7F</code>
                    </td>
                    <td>
                        &#x2302;
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h0C</code>
                    </td>
                    <td>
                        <code>&amp;h16</code>
                    </td>
                    <td>
                        &#x25ac;
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h0D</code>
                    </td>
                    <td>
                        <code>&amp;h1B</code>
                    </td>
                    <td>
                        &#x2190;
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h1C</code>
                    </td>
                    <td>
                        <code>&amp;h10</code>
                    </td>
                    <td>
                        &#x25ba;
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h1D</code>
                    </td>
                    <td>
                        <code>&amp;h11</code>
                    </td>
                    <td>
                        &#x25c4;
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h1E</code>
                    </td>
                    <td>
                        <code>&amp;h18</code>
                    </td>
                    <td>
                        &#x2191;
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h1F</code>
                    </td>
                    <td>
                        <code>&amp;h19</code>
                    </td>
                    <td>
                        &#x2193;
                    </td>
                </tr>
            </table>
        </div>
    </section>
<hr />

    <section>
        <h4 id="KEY-def"><code>KEY</code> (macro definition)</h4>
        <code class="flow">
            <b>KEY</b> <var>key_id</var><b>,</b> <var>string_value</var>
        </code>
        <p>
            Defines the string macro for function key <code><var>key_id</var></code>.
            Only the first 15 characters of <code><var>string_value</var></code> are stored.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>key_id</var></code> is a numeric expression in the range
                <code>[1&#8212;12]</code> (or <code>[1&#8212;10]</code>
                when <code><a href="#--syntax">syntax</a>=gwbasic</code>).
            </li>
            <li>
                <code><var>string_value</var></code> is a string expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>key_id</var></code> is not in the prescribed range,
                the statement is interpreted as an
                event-trapping <code><a href="#KEY-event">KEY</a></code> statement.
            </li>
            <li>
                If <code><var>string_value</var></code> is the empty string or
                the first character of <code><var>string_value</var></code> is
                <code>CHR$(0)</code>, the function key macro is switched off and
                subsequent catching of the associated function key with
                <code><a href="#INKEY$">INKEY$</a></code> is enabled.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>key_id</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>key_id</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>key_id</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="KEY-event"><code>KEY</code> (event switch)</h4>
        <code class="flow">
            <b>KEY</b> <b>(</b><var>key_id</var><b>)</b> {<b>ON</b>|<b>OFF</b>|<b>STOP</b>}
        </code>
        <p>
            Controls event trapping of the key with identifier <code><var>key_id</var></code>.
            Event trapping is switched <code>ON</code> or <code>OFF</code>. <code>STOP</code> suspends event trapping until
            a <code>KEY() ON</code> is executed. Up to one event can be triggered during
            suspension, provided that event handling was switched on prior to suspension.
            The event triggered during suspension is handled immediately after the next <code>KEY() ON</code>
            statement.
            Event trapping can only be active during execution of a program, it does not work in direct mode.
        </p>
        <h5>Parameters</h5>
        <p>
            <code><var>key_id</var></code> is a numeric expression in <code>[1&#8212;20]</code>.
            Keys are:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td>1</td>
                    <td><kbd>F1</kbd></td>
                </tr>
                <tr>
                    <td>2</td>
                    <td><kbd>F2</kbd></td>
                </tr>
                <tr>
                    <td>3</td>
                    <td><kbd>F3</kbd></td>
                </tr>
                <tr>
                    <td>4</td>
                    <td><kbd>F4</kbd></td>
                </tr>
                <tr>
                    <td>5</td>
                    <td><kbd>F5</kbd></td>
                </tr>
                <tr>
                    <td>6</td>
                    <td><kbd>F6</kbd></td>
                </tr>
                <tr>
                    <td>7</td>
                    <td><kbd>F7</kbd></td>
                </tr>
                <tr>
                    <td>8</td>
                    <td><kbd>F8</kbd></td>
                </tr>
                <tr>
                    <td>9</td>
                    <td><kbd>F9</kbd></td>
                </tr>
                <tr>
                    <td>10</td>
                    <td><kbd>F10</kbd></td>
                </tr>
                <tr>
                    <td>11</td>
                    <td><kbd>&#8593;<!--up--></kbd></td>
                </tr>
                <tr>
                    <td>12</td>
                    <td><kbd>&#8592;<!--left--></kbd></td>
                </tr>
                <tr>
                    <td>13</td>
                    <td><kbd>&#8594;<!--right--></kbd></td>
                </tr>
                <tr>
                    <td>14</td>
                    <td><kbd>&#8595;<!--down--></kbd></td>
                </tr>
            </table>
        </div>
        <p>
            Keys 15 to 25 are defined using the event trapping
            <code><a href="#KEY-event-def">KEY</a></code> definition statement.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                With <code><a href="#--syntax">syntax</a>=tandy</code>, key 11
                is <kbd>F11</kbd> and key 12 is <kbd>F12</kbd>.
                Pre-defined keys 11&#8212;14 shift to 13&#8212;16.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>key_id</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>key_id</var></code> is not in <code>[0&#8212;20]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>key_id</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="KEY-event-def"><code>KEY</code> (event definition)</h4>
        <code class="flow">
            <b>KEY</b> <var>key_id</var><b>,</b> <var>two_char_string</var>
        </code>
        <p>
            Defines the key to trap for <code><var>key_id</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>key_id</var></code> is a numeric
                expression in <code>[15&#8212;25]</code>
                (or <code>[15&#8212;20]</code> when <code><a href="#--syntax">syntax</a>=gwbasic</code>, or
                <code>[17&#8212;20]</code> when <code><a href="#--syntax">syntax</a>=tandy</code>).
            </li>
            <li>
                <code><var>two_char_string</var></code> is a string expression of length 2. The first character is interpreted as a modifier
                while the second character is interpreted as a <a href="#scancodes">scancode</a>.
                The modifier character is a bitwise <code>OR</code> combination of the following flags:
                <div class="scrollable">
                    <table>
                        <tr>
                            <td><code>CHR$(&amp;h80)</code></td>
                            <td>Extended (ignored)</td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h40)</code></td>
                            <td><kbd>Caps Lock</kbd></td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h20)</code></td>
                            <td><kbd>Num Lock</kbd></td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h10)</code></td>
                            <td><kbd>not used</kbd></td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h08)</code></td>
                            <td><kbd>Alt</kbd></td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h04)</code></td>
                            <td><kbd>Ctrl</kbd></td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h02)</code></td>
                            <td><kbd>Shift</kbd> (either side)</td>
                        </tr>
                        <tr>
                            <td><code>CHR$(&amp;h01)</code></td>
                            <td><kbd>Shift</kbd> (either side)</td>
                        </tr>
                    </table>
                </div>
                For the unmodified key, the modifier character is <code>CHR$(0)</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>key_id</var></code> is not in the prescribed range, no error is raised; such values are ignored.
                In GW-BASIC strange things can
                happen in this case: screen anomalies and crashes suggestive of unintended
                memory access.
            </li>
            <li>
                If <code><var>key_id</var></code> is in <code>[1&#8212;10]</code>
                (or <code>[1&#8212;12]</code> when <code><a href="#--syntax">syntax</a>=tandy</code>),
                the statement is interpreted as a
                <a href="#KEY-def">function-key macro definition</a>.
            </li>
            <li>
                The <em>extended</em> modifier <code>&amp;h80</code> refers to the additional keys
                that were introduced with the Model M 101-key keyboard in th earea between the main
                keyboard and the numerical keypad. These are the arrow keys,
                <kbd>Home</kbd>, <kbd>End</kbd>, <kbd>PgUp</kbd>, <kbd>PgDn</kbd>, <kbd>Ins</kbd>,
                <kbd>Del</kbd> as separate from the numerical keypad.
                PC-BASIC ignores this modifier; in a key definition, it does not make a difference
                whether or not it is set.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>key_id</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>key_id</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>key_id</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>two_char_string</var></code> is longer than two: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>two_char_string</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="KILL"><code>KILL</code></h4>
        <code class="flow">
            <b>KILL</b> <var>filter_spec</var>
        </code>
        <p>
            Deletes one or more files on a disk device.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                The string expression <code><var>filter_spec</var></code> is a
                valid <a href="#filespec">file specification</a> indicating the files to delete.
                Wildcards are allowed. See <a href="#FILES"><code>FILES</code></a> for a description
                of wildcards.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Be very careful with the use of wildcards in this statement: the DOS matching rules may
                not be the same as what is usual on your operating system, which could result in
                unexpected files being deleted.
            </li>
            <li>
                This statement may not delete hidden file and files that do not have short names
                which are legal DOS names. However, this behaviour is not guaranteed
                so you must not depend on it.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>filter_spec</var></code> is a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                A file with a base name equal to that of a file matching <code><var>filter_spec</var></code> is open: <samp>File already open</samp>
            </li>
            <li>
                No file matches <code><var>filter_spec</var></code> : <samp>File not found</samp>
            </li>
            <li>
                The user has no write permission: <samp>Permission denied</samp>
            </li>
            <li>
                If a syntax error occurs after the closing quote, the file is removed anyway.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LCOPY"><code>LCOPY</code></h4>
        <code class="flow">
            <b>LCOPY</b> [<var>num</var>]
        </code>
        <p>
            Does nothing.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>num</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                This statement does nothing in GW-BASIC. Presumably, it is left over from a
                statement in older versions of MS Basic that would copy the screen to the
                printer.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>num</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LET"><code>LET</code></h4>
        <code class="flow">
            [<b>LET</b>] <var>name</var> <b>=</b> <var>expression</var>
        </code>
        <p>
            Assigns the value of <code><var>expression</var></code> to the variable or array element <code><var>name</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>name</var></code> is a variable that may or may not already exist.
            </li>
            <li>
                The
                type of <code><var>expression</var></code> matches that of <code><var>name</var></code>: that is, all numeric types can
                be assigned to each other but strings can only be assigned to strings.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>name</var></code> and <code><var>expression</var></code> are not of matching types: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LINE"><code>LINE</code></h4>
        <code class="flow">
            <b>LINE</b> [[<b>STEP</b>] <b>(</b><var>x0</var><b>,</b> <var>y0</var><b>)</b>] <b>-</b> [<b>STEP</b>]
            <b>(</b><var>x1</var><b>,</b> <var>y1</var><b>)</b> [<b>,</b> [<var>attr</var>] [<b>,</b> [<b>B</b> [<b>F</b>]] [<b>,</b> <var>pattern</var>]]]
        </code>
        <p>
            Draws a line or a box in graphics mode. If <code>B</code> is not specified, a line is drawn
            from <code>(<var>x0</var>, <var>y0</var>)</code> to <code>(<var>x1</var>, <var>y1</var>)</code>, endpoints inclusive.
            If <code>B</code> is specified, a
            rectangle is drawn with sides parallel to the screen and two opposing corners
            specified by <code>(<var>x0</var>, <var>y0</var>)</code> and <code>(<var>x1</var>, <var>y1</var>)</code>. If the starting point is not given,
            the current graphics position is used as a staring point.  If <code>STEP</code> is
            specified, <code>(<var>x0</var>, <var>y0</var>)</code> is an offset from the current position and <code>(<var>x1</var>, <var>y1</var>)</code> is an
            offset from <code>(<var>x0</var>, <var>y0</var>)</code>.
            <code>LINE</code> moves the current graphics position to the last given endpoint.
            If <code>F</code> is specified with <code>B</code>, the rectangle is filled with the specified attribute.
            <code>F</code> and <code>B</code> may be separated by zero or more spaces.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>attr</var></code> is a numeric expression in <code>[0&#8212;255]</code>, which
                specifies the colour attribute of the line. If it is not given, the current
                attribute is used.
            </li>
            <li>
                <code><var>pattern</var></code> is a numeric expression in <code>[-32768&#8212;32767]</code>.
                This is interpreted as a 16-bit binary pattern mask
                applied to consecutive pixels in the line: a 1 bit indicates a pixel
                plotted; a 0 bit indicates a pixel left untouched. The pattern starts at
                the most significant bit, which is applied to the topmost endpoint. If a
                box is drawn, the pattern is applied in the following counter-intuitive
                sequence: <code>(<var>x1</var>, <var>y1</var>)&#8212;(<var>x0</var>, <var>y1</var>)</code>,
                <code>(<var>x1</var>, <var>y0</var>)&#8212;(<var>x0</var>, <var>y0</var>)</code>,
                then <code>(<var>x1</var>, <var>y0</var>)&#8212;(<var>x1</var>, <var>y1</var>)</code>,
                <code>(<var>x0</var>, <var>y0</var>)&#8212;(<var>x0</var>, <var>y1</var>)</code> if <code><var>y0</var>&lt;<var>y1</var></code> and <code><var>y0</var></code>,
                <code><var>y1</var></code> reversed if <code><var>y1</var>&lt;<var>y0</var></code>. When drawing a
                filled box, <code>LINE</code> ignores the pattern.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If a coordinate is outside the screen boundary, it is replaced with -1 (if
                less than 0) or the screen dimension (if larger than the screen dimension).
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                The statement ends in a comma and it is the first or third: <samp>Missing operand</samp>. If it is the second: <samp>Syntax error</samp>.
            </li>
            <li>
                Any of the coordinates is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                Any of the parameters has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LINE-INPUT"><code>LINE INPUT</code> (console)</h4>
        <code class="flow">
            <b>LINE INPUT</b> [<b>;</b>] [<var>prompt_literal</var> {<b>;</b>|<b>,</b>}] <var>string_name</var>
        </code>
        <p>
            Displays the prompt given in <code><var>prompt_literal</var></code> and reads user input from the
            keyboard, storing it into the variable <code><var>string_name</var></code>. All input is read until
            <kbd>Enter</kbd> is pressed; the first 255 characters are stored. If the <code>;</code> is given
            right after <code>LINE INPUT</code>, the <kbd>Enter</kbd> ending user input is not echoed to the
            screen.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>prompt_literal</var></code> is a string literal. It makes no difference whether it is
                followed by a comma or a semicolon.
            </li>
            <li>
                <code><var>string_name</var></code> is a string variable or array element.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If user input is interrupted by <kbd>Ctrl</kbd>+<kbd>Break</kbd>, <code>CONT</code> will re-execute the <code>LINE
                INPUT</code> statement.
            </li>
            <li>
                Unlike <code><a href="#INPUT">INPUT</a></code>, <code>LINE INPUT</code>
                does not end the prompt with <code>?</code>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LINE-INPUT-file"><code>LINE INPUT</code> (files)</h4>
        <code class="flow">
            <b>LINE INPUT</b> <b>#</b> <var>file_num</var><b>,</b> <var>string_name</var>
        </code>
        <p>
            Reads string or numeric variables from a text file or the <code>FIELD</code> buffer
            of a random access file. All input is read until <kbd>Enter</kbd> is pressed; the first
            255 characters are stored. <code><var>file_num</var></code> must be the number of a file open in
            <code>INPUT</code> mode or a random-access file open in <code>RANDOM</code> mode.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>string_name</var></code> is a string variable or array element.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The <code>#</code> is mandatory. There may or may not be whitespace between <code>INPUT</code> and <code>#</code>.
            </li>
            <li>
                Input is only terminated by a <code><i>CR</i></code>.
            </li>
            <li>
                If <code><var>file_num</var></code> is open to <code>KYBD:</code>, <code>LINE INPUT#</code> reads from the keyboard until a
                return or comma is encountered (as in a file). Arrow keys and delete are
                passed as their control characters (<em>not</em> scancodes!) preceded by <code>CHR$(&amp;hFF)</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Input is requested after the end of a text file has been reached or an
                <code><i>EOF</i></code> char has been encountered: <samp>Input past end</samp>.
            </li>
            <li>
                The last character of the field buffer is read: <samp>Field overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is less than zero: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not open for <code>INPUT</code> or <code>RANDOM</code>: <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is open to a <code>COM</code> port and this is the
                first <code><a href="#INPUT-file">INPUT</a></code>, <code><a href="#LINE-INPUT-file">LINE INPUT</a></code> or <code><a href="#INPUT$">INPUT$</a></code> call on that port
                since the buffer has filled up completely (i.e. <code><a href="#LOF">LOF</a>(<var>file_num</var>)</code> has become zero):
                <samp>Communication buffer overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LIST"><code>LIST</code></h4>
        <code class="flow">
            <b>LIST</b> [<var>line_number_0</var>|<b>.</b>] [<b>-</b>[<var>line_number_1</var>|<b>.</b>]] [<b>,</b> <var>file_spec</var> [<var>anything</var>]]
        </code>
        <p>
            Prints the program to the screen or a file,
            starting with <code><var>line_number_0</var></code> up to and
            including <code><var>line_number_1</var></code>.
            Also stops program execution and returns control to the user.
            If the <code>LIST</code> statement ends with a file specification, anything further is ignored.
            In all cases, any further
            statements in a compound after <code>LIST</code> will be ignored, both in a program and in direct mode.
        </p>
        <p>
            When listing to the screen, the same control characters are recognised as in the
            <code><a href="#PRINT">PRINT</a></code> statement.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC 3.23, <code>LIST</code> will not show line numbers
                <code>65531</code>&mdash;<code>65535</code> inclusive.
                By default, PC-BASIC's <code>LIST</code> does show these lines. However,
                showing them can be disabled with the option
                <code><a href="#--hide-listing">hide-listing=65530</a></code>.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number_0</var></code> and <code><var>line_number_1</var></code> are
                line numbers in the range <code>[0&#8212;65529]</code>
                or a <code>.</code> to indicate the last line edited. The line numbers do not need to exist;
                they specify a range. If the range is empty, nothing is printed.
            </li>
            <li>
                The string expression <code><var>file_spec</var></code> is a
                valid <a href="#filespec">file specification</a> indicating the file to list to.
                If this file already exists, it will be overwritten.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                A line number is greater than <code>65529</code>: <samp>Syntax error</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> ends in a colon but is not a device name or drive letter:
                <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LLIST"><code>LLIST</code></h4>
        <code class="flow">
            <b>LLIST</b> [<var>line_number_0</var>|<b>.</b>] [<b>-</b>[<var>line_number_1</var>|<b>.</b>]]
        </code>
        <p>
            Prints the program to the line printer <code>LPT1:</code>, starting with <code><var>line_number_0</var></code> up to and
            including <code><var>line_number_1</var></code>.
            Also stops program execution and returns control to the user. Any further
            statements on a line after <code>LLIST</code> will be ignored, both in a program and in direct mode.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC 3.23, <code>LLIST</code> will not show line numbers
                <code>65531</code>&mdash;<code>65535</code> inclusive.
                By default, PC-BASIC's <code>LLIST</code> does show these lines. However,
                showing them can be disabled with the option
                <code><a href="#--hide-listing">hide-listing=65530</a></code>.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number_0</var></code> and <code><var>line_number_1</var></code> are  line numbers in the range <code>[0&#8212;65529]</code>.
                or a <code>.</code> to indicate the last line edited. The line numbers do not need to exist;
                they specify a range. If the range is empty, nothing is printed.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                A line number is greater than <code>65529</code>: <samp>Syntax error</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LOAD"><code>LOAD</code></h4>
        <code class="flow">
            <b>LOAD</b> <var>file_spec</var> [<b>, R</b>]
        </code>
        <p>
            Loads the program stored in a file into memory.
            Existing variables will be cleared and any program in memory will be erased. <code>LOAD</code> implies
            <code><a href="#CLEAR">CLEAR</a></code>.
            Also stops program execution and returns control to the user. Any further statements on the line will be ignored, also in direct mode.
        </p>
        <p>
            If <code>,R</code> is specified, keeps all data files open and runs the specified file.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                The string expression <code><var>file_spec</var></code> is a valid <a href="#filespec">file specification</a> indicating
                the file to read the program from.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
            <li>
                The file specified in <code><var>file_spec</var></code>
                cannot be found: <samp>File not found</samp>.
            </li>
            <li>
                A loaded text file contains lines without line numbers:
                <samp>Direct statement in file</samp>.
            </li>
            <li>
                A loaded text file contains lines longer than 255 characters:
                <samp>Line buffer overflow</samp>.
                Attempting to load a text file that has <code><i>LF</i></code> rather than <code><i>CR LF</i></code> line endings may cause this error.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LOCATE"><code>LOCATE</code></h4>
        <code class="flow">
            <b>LOCATE</b> [<var>row</var>] [<b>,</b> [<var>col</var>] [<b>,</b> [<var>cursor_visible</var>] [<b>,</b> [<var>start_line</var>] [<b>,</b> [<var>stop_line</var>] [<b>,</b>]]]]]
        </code>
        <p>
            Positions the cursor at <code><var>row</var></code>, <code><var>col</var></code> on the screen and changes the cursor shape and visibility.
            <code><var>cursor_visible</var></code> may be 0 or 1. If <code><var>cursor_visible</var></code> is 0, it makes
            the cursor invisible; if it is 1, makes the cursor visible. This works only while a program is running.
             The cursor shape is adjusted
             within a character cell to start from <code><var>start_line</var></code> and end on <code><var>end_line</var></code> where
            <code><var>start_line</var></code> and <code><var>end_line</var></code> are in <code>[0&#8212;31]</code>. If <code><var>start_line</var></code> or <code><var>end_line</var></code> is
            greater than the character cell height (15), substitute 15.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                On emulated VGA cards, the cursor shape parameters are interpreted
                in a complicated way that is intended to maintain functional compatibility with CGA.
            </li>
            <li>
                In GW-BASIC, cursor shape is preserved after pressing <kbd>Ins</kbd> twice. The insert-mode cursor is different from the usual half-block.
                In PC-BASIC, insert mode resets the cursor shape to default.
            </li>
            <li>
                Cursor shape and visibility options have no effect in graphics mode.
            </li>
            <li>
                Locate accepts a 5th comma at the end, which is ignored.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any parameter has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                Any parameter is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>row</var></code> is outside the current view area: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>col</var></code> is greater than the current width: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>cursor_visible</var></code> is not in <code>[0, 1]</code> (<code>[0&#8212;255]</code> on Tandy/PCjr): <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LOCK"><code>LOCK</code></h4>
        <code class="flow">
            <b>LOCK</b> [<b>#</b>] <var>file_number</var> [<b>,</b> <var>record_0</var>]
        </code>
        <code class="flow">
            <b>LOCK</b> [<b>#</b>] <var>file_number</var><b>,</b> [<var>record_0</var>] <b>TO</b> <var>record_1</var>
        </code>
        <p>
            Locks a file or part of a file against access by other users. On a <code>RANDOM</code> file,
            <code><var>record_0</var></code> is the first record locked and <code><var>record_1</var></code> is the last
            record locked. On any other kind of file <code><var>record_0</var></code> and <code><var>record_1</var></code> have no
            effect. If <code><var>record_0</var></code> is not specified, it is assumed to be 1. If no records
            are specified, the whole file is locked.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
            <li>
                <code><var>record_0</var></code> and <code><var>record_1</var></code> are numeric expressions in <code>[1&#8212;2^25-2]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC under MS-DOS, the <code>LOCK</code> command requires <code>SHARE.EXE</code> to be loaded.
                The maximum number of locks is specified in the MS-DOS <code>SHARE</code> command. If <code>SHARE</code> has
                not been activated or all locks are used, <code>LOCK</code> raises <samp>Permission denied</samp>.
                PC-BASIC behaves as if <code>SHARE</code> has been activated with unlimited locks.
            </li>
            <li>
                If <code><var>file_number</var></code> is open for <code>RANDOM</code>,
                <code><a href="#LOCK">LOCK</a></code> and <code><a href="#UNLOCK">UNLOCK</a></code>
                statements must match in terms of <code><var>record_0</var></code> and
                <code><var>record_1</var></code>. An non-matching <code>UNLOCK</code> will raise
                <samp>Permission denied</samp>.
            </li>
            <li>
                To check if another open file is the same file, PC-BASIC only looks at the base name
                of the file, i.e. its DOS name without directories. As a consequence, if a file <samp>"test.txt"</samp>
                is open and locked, an attempt to lock a file <samp>"dir\test.txt"</samp> will fail, even if these are
                different files. Conversely, if two file names are different but point to the same file in the
                file system (for example due to file system links), then these will be considered as different files by BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any parameter has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                <code>LOCK</code> (part of) a file with the same name as a file already locked: <samp>Permission denied</samp>.
            </li>
            <li>
                <code><var>record_0</var></code> or <code><var>record_1</var></code> is not in <code>[1&#8212;2^25-2]</code>: <samp>Bad record number</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="LPRINT"><code>LPRINT</code></h4>
        <p>
            See <code><a href="#PRINT">PRINT</a></code>.
        </p>
    </section>
<hr />

    <section>
        <h4 id="LSET"><code>LSET</code></h4>
        <code class="flow">
            <b>LSET</b> <var>string_name</var> <b>=</b> <var>expression</var>
        </code>
        <p>
            Copies a string value into an existing string variable or array element.
            The value will be left-justified and any remaining characters are replaced by
            spaces.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>string_name</var></code> is a string variable or array element.
            </li>
                <li><code><var>expression</var></code> is a string expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>expression</var></code> has a value that is longer than the length of the target variable,
                it is truncated at the tail to the length of the target variable.
            </li>
            <li>
                If <code><var>string_name</var></code> has not been allocated before, this statement has no effect.
            </li>
            <li>
                Use <code><a href="#LSET">LSET</a></code>, <code><a href="#RSET">RSET</a></code> or
                <code><a href="#MID$-statement">MID$</a></code> to copy values into a <code><a href="#FIELD">FIELD</a></code> buffer.
            </li>
            <li>
                If <code><a href="#LET">LET</a></code> is used on a <code>FIELD</code> variable
                instead of <code>L|RSET</code>, the variable is
                detached from the field and a new, normal string variable is allocated.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>string_name</var></code> is not a string variable: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>expression</var></code> does not have a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="MERGE"><code>MERGE</code></h4>
        <code class="flow">
            <b>MERGE</b> <var>file_spec</var>
        </code>
        <p>
            Overlays the lines of a program from a plain-text program file into the existing program. The loaded
            lines overwrite existing lines if they have the same line number.
        </p>
        <p>
            Also stops program execution and returns control to the user. Any further statements on the line will be ignored, also in direct mode.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                The string expression <code><var>file_spec</var></code> is a valid <a href="#filespec">file specification</a> indicating
                the file to read the program from.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> cannot be found: <samp>File not found</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
            <li>
                <code><var>file_spec</var></code> was not saved as plain text: <samp>Bad file mode</samp>.
            </li>
            <li>
                A loaded text file contains lines without line numbers:
                <samp>Direct statement in file</samp>.
            </li>
            <li>
                A loaded text file contains lines longer than 255 characters:
                <samp>Line buffer overflow</samp>.
                Attempting to load a text file that has <code><i>LF</i></code> rather than <code><i>CR LF</i></code> line endings may cause this error.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="MID$-statement"><code>MID$</code> (statement)</h4>
        <code class="flow">
            <b>MID$(</b><var>string_name</var><b>,</b> <var>position</var> [<b>,</b> <var>length</var>]<b>) =</b> <var>substring</var>
        </code>
        <p>
            Replaces part of <code><var>string_name</var></code> with <code><var>substring</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>string_name</var></code> is a valid string variable name.
            </li>
            <li>
                <code><var>position</var></code> is a numeric expression between 1 and the string length, inclusive.
            </li>
            <li>
                <code><var>length</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                No whitespace is allowed between <code>MID$</code> and <code>(</code>.
            </li>
            <li>
                If <code><var>substring</var></code> is longer than <code><var>length</var></code>, only the first <code><var>length</var></code> characters
                are used.
            </li>
            <li>
                If <code><var>substring</var></code> is shorter than <code><var>length</var></code>, only <code>LEN(<var>substring</var>)</code> characters
                are replaced.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>position</var></code> is greater than the length of <code><var>string_name</var></code>:
                <samp>Illegal function call</samp>, except if <code><var>length</var></code> is specified as 0.
            </li>
            <li>
                <code><var>position</var></code> is not in <code>[1&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>length</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>position</var></code> or <code><var>length</var></code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="MKDIR"><code>MKDIR</code></h4>
        <code class="flow">
            <b>MKDIR</b> <var>dir_spec</var>
        </code>
        <p>
            Creates a new directory on a disk device.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                The string expression <code><var>dir_spec</var></code> is a valid
                <a href="#filespec">file specification</a> that specifies the
                path of the new directory on a disk device.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>dir_spec</var></code> is not a string: <samp>Type mismatch</samp>.
            </li>
            <li>
                The parent directory does not exist: <samp>Path not found</samp>.
            </li>
            <li>
                The directory name already exists on that path: <samp>Path/File access error</samp>.
            </li>
            <li>
                The user has no write permission: <samp>Permission denied</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="MOTOR"><code>MOTOR</code></h4>
        <code class="flow">
            <b>MOTOR</b> [<var>num</var>]
        </code>
        <p>
            Does nothing.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>num</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, this statement turns on the cassette motor if <code><var>num</var></code>
                is nonzero or omitted, and turns it off if <code><var>num</var></code>
                is zero. This is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>num</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="NAME"><code>NAME</code></h4>
        <code class="flow">
            <b>NAME</b> <var>old_name</var> <b>AS</b> <var>new_name</var>
        </code>
        <p>
            Renames the disk file <code><var>old_name</var></code> into <code><var>new_name</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                The string expressions <code><var>old_name</var></code> and <code><var>new_name</var></code>
                are valid <a href="#filespec">file specifications</a> giving the path on a disk device to the old and new filenames,
                respectively.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
               <code><var>new_name</var></code> will be modified into <a href="#eightpointthree">all-uppercase 8.3 format</a>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>old_name</var></code> or <code><var>new_name</var></code> have number values: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>old_name</var></code> does not exist: <samp>File not found</samp>.
            </li>
            <li>
                A file with a base name equal to that of <code><var>old_name</var></code> or <code><var>new_name</var></code> is open: <samp>File already open</samp>.
            </li>
            <li>
                <code><var>new_name</var></code> exists: <samp>File already exists</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="NEW"><code>NEW</code></h4>
        <code class="flow">
            <b>NEW</b>
        </code>
        <p>
            Stops execution of a program, deletes the program in memory, executes
            <code><a href="#CLEAR">CLEAR</a></code> and <code><a href="#RESTORE">RESTORE</a></code>
            and returns control to the user.
        </p>
    </section>
<hr />

    <section>
        <h4 id="NEXT"><code>NEXT</code></h4>
        <code class="flow">
            <b>NEXT</b> [<var>var_0</var> [<b>,</b> <var>var_1</var>] ...]
        </code>
        <p>
            Iterates a <code>FOR&#8212;NEXT</code> loop: increments the loop variable and
            jumps to the <code><a href="#FOR">FOR</a></code>
            statement. If no variables are specified, next matches the most recent <code>FOR</code>
            statement. Several nested <code>NEXT</code> statements can be consolidated into one by
            using the variable list. If one or more variables are specified, their order
            must match the order of earlier <code>FOR</code> statements.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>var_0</var>, <var>var_1</var>, ...</code> are numeric variables which are loop counters in a <code>FOR</code> statement.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No <code>FOR</code> statement is found to match the <code>NEXT</code> statement and variables:
                <samp>NEXT without FOR</samp>.
            </li>
            <li>
                <code><var>var_0</var>, <var>var_1</var>, ...</code> are string variables: <samp>NEXT without FOR</samp>.
            </li>
            <li>
                The (implicit or explicit) loop variable is an integer variable and is
                taken outside the range <code>[-32768, 32767]</code> when incremented after the final iteration: <samp>Overflow</samp> .
            </li>

        </ul>
    </section>
<hr />

    <section>
        <h4 id="NOISE"><code>NOISE</code></h4>
        <code class="flow">
            <b>NOISE</b> <var>source</var><b>,</b> <var>volume</var><b>,</b> <var>duration</var>
        </code>
        <p>
            Generates various kinds of noise.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>source</var></code> is a numeric expression in  <code>[0&#8212;7]</code>.
                It indicates the type of noise:
                <div class="scrollable">
                    <table>
                        <tr>
                            <th>source</th>
                            <th>type</th>
                            <th>top of frequency band (Hz)</th>
                        </tr>
                        <tr>
                            <td>0</td>
                            <td>periodic</td>
                            <td>6991</td>
                        </tr>
                        <tr>
                            <td>1</td>
                            <td>periodic</td>
                            <td>3495</td>
                        </tr>
                        <tr>
                            <td>2</td>
                            <td>periodic</td>
                            <td>1747</td>
                        </tr>
                        <tr>
                            <td>3</td>
                            <td>periodic</td>
                            <td>last tone played on voice 2</td>
                        </tr>
                        <tr>
                            <td>0</td>
                            <td>white noise</td>
                            <td>6991</td>
                        </tr>
                        <tr>
                            <td>1</td>
                            <td>white noise</td>
                            <td>3495</td>
                        </tr><tr>
                            <td>2</td>
                            <td>white noise</td>
                            <td>1747</td>
                        </tr><tr>
                            <td>3</td>
                            <td>white noise</td>
                            <td>last tone played on voice 2</td>
                        </tr>
                    </table>
                </div>
            </li>
            <li>
                <code><var>volume</var></code> is a numeric expression in <code>[0&#8212;15]</code>.
            </li>
            <li>
                <code><var>duration</var></code> is a numeric expression.
            </li>
        </ul>
        <p>
            Volume and duration are determined in the same way as for the
            <code><a href="#SOUND">SOUND</a></code> statement; see there.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                This statement is only available if
                <code><a href="#--syntax">syntax</a>={pcjr|tandy}</code> is set.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code>SOUND ON</code> has not been executed: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>duration</var></code> is not in <code>[-65535&#8212;65535]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>volume</var></code> is not in <code>[0&#8212;15]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>source</var></code> is not in <code>[0&#8212;7]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ON-jump"><code>ON</code> (calculated jump)</h4>
        <code class="flow">
            <b>ON</b> <var>n</var> {<b>GOTO</b>|<b>GOSUB</b>} <var>line_number_0</var> [<b>,</b> <var>line_number_1</var>] ...
        </code>
        <p>
            Jumps to the <code><var>n</var></code>th line number specified in the list. If <code><var>n</var></code> is 0 or greater
            than the number of line numbers in the list, no jump is performed. If <code>GOTO</code> is specified,
            the jump is unconditional; if <code>GOSUB</code> is specified, jumps to a subroutine.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>n</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
                The expression must not start with the <code>STRIG</code>, <code>PEN</code>, <code>PLAY</code> or <code>TIMER</code>
                function keywords; if you need these functions, the expression must be bracketed.
            </li>
            <li>
                <code><var>line_number_0</var>, <var>line_number_1</var>, ...</code> are existing line numbers in the program.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>n</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>n</var></code> is not in <code>[-32768&#8212;32767]</code>, <samp>Overflow</samp> .
            </li>
            <li>
                <code><var>n</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                The line number jumped to does not exist: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ON-event"><code>ON</code> (event trapping)</h4>
        <code class="flow">
            <b>ON</b> {<b>COM(</b><var>n</var><b>)</b>|<b>KEY(</b><var>n</var><b>)</b>|<b>STRIG(</b><var>n</var><b>)</b>|<b>PEN</b>|<b>PLAY(</b><var>n</var><b>)</b>|<b>TIMER(</b><var>x</var><b>)</b>}
            <b>GOSUB</b> <var>line_number</var>
        </code>
        <p>
            Defines an event trapping subroutine.
            The type of event is given by one of the following keywords:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>COM(<var>n</var>)</code></td>
                    <td>
                        The event is triggered
                        if data is present in the input buffer of the
                        <code>COM<var>n</var>:</code>. <code><var>n</var></code>
                        is the port number in <code>[1,2]</code>.
                    </td>
                </tr>
                <tr>
                    <td><code>KEY(<var>n</var>)</code></td>
                    <td>
                        The event is triggered if key <code><var>n</var></code> is pressed.
                        <code><var>n</var></code> is the key number <code>[1&#8212;20]</code>
                        defined in the <code><a href="#KEY-event-def">KEY</a></code> statement.
                    </td>
                </tr>
                <tr>
                    <td><code>STRIG(<var>n</var>)</code></td>
                    <td>
                        They event is triggered if fire button <code><var>n</var></code> is pressed.
                        <code><var>n</var></code> in <code>[0,2,4,6]</code> refer to the
                        two fire triggers on two joysticks.
                    </td>
                </tr>
                <tr>
                    <td><code>PEN</code></td>
                    <td>
                        The event is triggered if the light pen is on the
                        screen. (In PC-BASIC, the light pen is emulated by default by the
                        right mouse button).
                    </td>
                </tr>
                <tr>
                    <td><code>PLAY(<var>n</var>)</code></td>
                    <td>
                        The event is triggered if there are exactly <code><var>n</var></code> notes left on the
                        music background queue. <code><var>n</var></code> is a numeric expression in <code>[1&#8212;32]</code>.
                    </td>
                </tr>
                <tr>
                    <td><code>TIMER(<var>x</var>)</code></td>
                    <td>
                        The event is triggered every <code><var>x</var></code> seconds after the <code><a href="#TIMER">TIMER ON</a></code>
                        statement. <code><var>x</var></code> is a numeric expression in <code>[1&#8212;86400]</code>.
                    </td>
                </tr>
            </table>
        </div>
        <h5>Notes</h5>
        <ul>
            <li>
                Event trapping for your chosen event first needs to be enabled using one of the
                statements: <code><a href="#COM">COM(<var>n</var>) ON</a></code>,
                <code><a href="#KEY-event">KEY(<var>n</var>) ON</a></code>,
                <code><a href="#STRIG-events">STRIG(<var>n</var>) ON</a></code>,
                <code><a href="#PEN-statement">PEN ON</a></code>,
                <code><a href="#PLAY-event">PLAY ON</a></code>,
                <code><a href="#TIMER-event">TIMER ON</a></code>
            </li>
            <li>
                Events are only trapped when a program is running.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>n</var></code> or <code><var>x</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>n</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>n</var></code> or <code><var>x</var></code> is outside the specified range: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="ON-ERROR"><code>ON ERROR</code></h4>
        <code class="flow">
            <b>ON ERROR GOTO</b> {<var>line_number</var>|<b>0</b>}
        </code>
        <p>
            Turns error trapping on or off. When <code><var>line_number</var></code> is set, any error causes the error handling
            routine starting at that line number to be called; no message is printed and program execution is not stopped. The
            error handling routine is ended by a <code><a href="#RESUME">RESUME</a></code> statement.
            While in an error handling routine, events are paused and error trapping is
            disabled. After the <code>RESUME</code> statement, any triggered events are picked up in the following
            order: <code>KEY</code>, <code>TIMER</code>, <code>PLAY</code> - the order of the others is unknown.
            Unlike event trapping, error trapping remains active when no program is running.
            <code>ON ERROR GOTO 0</code> turns off error trapping.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> is an existing line number in the program.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                It is not possible to start the error handler at line number <code>0</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> does not exist: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="OPEN"><code>OPEN</code></h4>
        <code class="flow">
            <b>OPEN</b> <var>mode_char</var><b>,</b> [<b>#</b>] <var>file_num</var><b>,</b> <var>file_spec</var> [<b>,</b> <var>rec_len</var>]
        </code>
        <code class="flow">
            <b>OPEN</b> <var>file_spec</var> [<b>FOR</b> {<b>INPUT</b>|<b>OUTPUT</b>|<b>APPEND</b>|<b>RANDOM</b>}]
                       [<b>ACCESS</b> {<b>READ</b>|<b>WRITE</b>|<b>READ WRITE</b>}]
                       [<b>SHARED</b>|<b>LOCK</b> {<b>READ</b>|<b>WRITE</b>|<b>READ WRITE</b>}]
                       <b>AS</b> [<b>#</b>] <var>file_num</var> [<b>LEN =</b> <var>rec_len</var>]
        </code>
        <p>
            Opens a data file on a device.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                The string expression <code><var>file_spec</var></code> is a valid <a href="#filespec">file specification</a>.
            </li>
            <li>
                <code><var>file_num</var></code> is a numeric expression in <code>[1&#8212;<var>max_files</var>]</code>,
                where <code><var>max_files</var></code> is the <a href="#--max-files">maximum file number</a> (default 3).
            </li>
            <li>
                <code><var>rec_len</var></code> is a numeric expression in <code>[1&#8212;128]</code>: the record length.
            </li>
            <li>
                <code><var>mode_char</var></code> is a string expression of which the first character is
                one of <code>["I", "O", "A", "R"]</code>.
            </li>
        </ul>
        <h5>Access modes</h5>
        <p>
            The <code>FOR</code> modes or <code><var>mode_char</var></code> are as follows:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>mode_char</var></code></th>
                    <th><code>FOR</code></th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code>"I"</code></td>
                    <td><code>INPUT</code></td>
                    <td>
                        Opens a text file for reading and positions the file pointer at the
                        start.
                    </td>
                </tr>
                <tr>
                    <td><code>"O"</code></td>
                    <td><code>OUTPUT</code></td>
                <td>
                    Truncates a text file at the start and opens it for writing. Any
                    data previously present in the file will be deleted.
                </td>
                </tr>
                <tr>
                    <td><code>"A"</code></td>
                    <td><code>APPEND</code></td>
                    <td>Opens a text file for writing at the end of any existing data.</td>
                </tr>
                <tr>
                    <td><code>"R"</code></td>
                    <td><code>RANDOM</code></td>
                    <td>
                        Opens a file for random access; the file is divided in records of
                        length <code><var>rec_len</var></code>. If <code>LEN</code> is not specified, the record length defaults to
                        128. The file contents can be accessed using <code><a href="#GET-files">GET</a></code>
                        and <code><a href="#PUT-files">PUT</a></code> of the <code><a href="#FIELD">FIELD</a></code>
                        buffer; the <code>FIELD</code> buffer can be accessed through <code>FIELD</code> variables or through
                        <code><a href="#PRINT">PRINT#</a></code> and <code><a href="#INPUT-file">INPUT#</a></code> statements.
                    </td>
                </tr>
            </table>
        </div>
        <p>
            If no <code>FOR</code> mode or <code><var>mode_char</var></code> is specified, the file is opened for <code>RANDOM</code>.
        </p>
        <p>
            If both <code>FOR</code> and <code>ACCESS</code> are specified, any <code>ACCESS</code> mode is allowed for
            <code>RANDOM</code> but for the other modes the access must match as follows:
        </p>
        <div class="scrollable">
        <table>
            <tr>
                <th><code>FOR</code></th>
                <th>default <code>ACCESS</code></th>
                <th>allowed <code>ACCESS</code></th>
            </tr>
            <tr>
                <td><code>INPUT</code></td>
                <td><code>READ</code></td>
                <td><code>READ</code></td>
            </tr>
            <tr>
                <td><code>OUTPUT</code></td>
                <td><code>WRITE</code></td>
                <td><code>WRITE</code></td>
            </tr>
            <tr>
                <td><code>APPEND</code></td>
                <td><code>READ WRITE</code></td>
                <td><code>READ WRITE</code></td>
            </tr>
            <tr>
                <td><code>RANDOM</code></td>
                <td><code>READ WRITE</code></td>
                <td>all</td>
            </tr>
        </table>
        </div>
        <h5>Sharing and locks</h5>
        <p>
            If neither <code>SHARED</code> nor <code>LOCK</code> are specified. Inside this process, a file may be opened multiple
            times for <code>INPUT</code> or <code>RANDOM</code> but only once for <code>OUTPUT</code> or <code>APPEND</code>, as long as it
            is again opened in default mode. It may not be opened in <code>SHARED</code> or any <code>LOCK</code>
            modes.
        </p>
        <p>
            If <code>SHARED</code>, <code>LOCK READ</code>, <code>LOCK WRITE</code> or <code>LOCK READ WRITE</code> is specified, whether
            two <code>OPEN</code> statements may access the same file depends on one's <code>LOCK</code> status
            and the other's <code>ACCESS</code> status and vice versa.
            For two <code>OPEN</code> statements as follows:
            <code class="block">
                <b>OPEN "file"</b> <var>lock_1</var> <b>AS 1</b>
                <br />
                <b>OPEN "file" ACCESS</b> <var>acc_2</var> <b>SHARED</b> <b>AS 2</b>
            </code>
            the following combinations are allowed:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th rowspan="2" colspan="2">Access allowed</th>
                    <th colspan="3"><code><var>acc_2</var></code></th>
                </tr><tr>
                    <th><code>READ</code></th>
                    <th><code>WRITE</code></th>
                    <th><code>READ WRITE</code></th>
                </tr><tr>
                    <th rowspan="4"><code><var>lock_1</var></code></th>
                    <th><code>SHARED</code></th>
                    <td>yes</td>
                    <td>yes</td>
                    <td>yes</td>
                </tr><tr>
                    <th><code>LOCK READ</code></th>
                    <td>no</td>
                    <td>yes</td>
                    <td>no</td>
                </tr><tr>
                    <th><code>LOCK WRITE</code></th>
                    <td>yes</td>
                    <td>no</td>
                    <td>no</td>
                </tr><tr>
                    <th><code>LOCK READ WRITE</code></th>
                    <td>no</td>
                    <td>no</td>
                    <td>no</td>
                </tr>
            </table>
        </div>
        <p>
            In GW-BASIC under MS-DOS with <code>SHARE.EXE</code> active, these locks should be enforced
            across a network as well as inside a single BASIC process. Without
            <code>SHARED</code> and <code>LOCK</code>, the file is locked exclusively
            for use by the GW-BASIC process. By contrast, in PC-BASIC,
            the locks are only implemented internally. Whether other processes may access
            the file will depend on the host OS.
        </p>
        <p>
            To check if another open file is the same file, PC-BASIC only looks at the base name
            of the file, i.e. its DOS name without directories. As a consequence, if a file <samp>"test.txt"</samp>
            is open and locked, an attempt to lock a file <samp>"dir\test.txt"</samp> will fail, even if these are
            different files. Conversely, if two file names are different but point to the same file in the
            file system (for example due to file system links), then these will be considered as different files by BASIC.
        </p>
        <h5 id="filespec">File specifications</h5>
        <p>
            A <dfn>file specification</dfn> <code><var>file_spec</var></code>
            is a non-empty string expression of the form
            <code><b>"</b>[<var>device</var><b>:</b>]<var>parameters</var><b>"</b></code>,
            where <code><var>device</var></code> is a PC-BASIC <a href="#devices">device</a>
            and the form of the <code><var>parameters</var></code> is specific to
            the type of device. If <code><var>device</var></code> is omitted,
            the current device (one of the disk devices or <code>CAS1:</code>)
            is used.
        </p>
        <dl>
            <dt id="eightpointthree">
                Disk devices <code>A:</code>&mdash;<code>Z:</code> and <code>@:</code>
            </dt>
            <dd>
                <p>
                    <code><var>parameters</var></code> must specify a valid file path of
                    the form <code>[<b>\</b>][<var>dirname</var><b>\</b>] ... <var>filename</var></code>.
                </p>
                <p>
                    PC-BASIC follows DOS file system conventions.
                    Directory names are separated with
                    backslashes <code>\</code> (even if the host OS separates paths with
                    forward slashes). File and directory names consist of a
                    8-character name and 3-character extension. Names are case insensitive.
                    Permissible characters for both filename and extension are the
                    printable ASCII characters in the range
                    <code>&amp;h20</code>&ndash;<code>&amp;h7E</code> excluding the characters
                    <code>" * + . , / : ; &lt; = &gt; ? \ [ ] |</code>.
                    Spaces are allowed but leading and trailing spaces are ignored.
                    The names <code>AUX</code>, <code>CON</code>, <code>PRN</code> and
                    <code>NUL</code> are reserved as device aliases and are not legal names
                    for files or directories on a disk device.
                </p>
                <p>
                    A path starting with a backslash is interpreted as an absolute path,
                    starting at the root of the specified disk device. Otherwise, the
                    path is interpreted as relative to the current directory on the
                    specified device. The special directory name
                    <code><b>..</b></code> refers to the parent directory of a preceding path, or the
                    parent directory of the current directory if no path is given.
                    The special directory name <code><b>.</b></code> refers to the same directory as
                    given by the preceding path, or the current directory if no preceding path is given.
                </p>
                <p>
                    If the file name provided does not contain any dots, the <code><a href="#LOAD">LOAD</a></code>,
                    <code><a href="#SAVE">SAVE</a></code>,
                    <code><a href="#BLOAD">BLOAD</a></code>,
                    <code><a href="#BSAVE">BSAVE</a></code>,
                    <code><a href="#CHAIN">CHAIN</a></code>,
                    <code><a href="#MERGE">MERGE</a></code>,
                    <code><a href="#RUN">RUN</a></code>, and
                    <code><a href="#LIST">LIST</a></code> statements
                    append the default
                    extension <code>.BAS</code>. To refer
                    to a file name without an extension, the file specification should
                    end in a dot <code>.</code>. For other statements, appending a dot is allowed but not required.
                </p>
                <h5>Compatibility notes</h5>
                <p>
                    Unlike PC-BASIC, some versions of MS-DOS
                    allow certain characters in the range
                    <code>&amp;h7F</code>&ndash;<code>&amp;hFF</code>. However, their
                    permissibility and interpretation depends on the console code page,
                    which may be different from the display code page that affects GW-BASIC.
                    Depending on its console code page, MS-DOS will replace accented
                    letters by their unaccented uppercase variant.
                    Some DOS implementations will remove spaces from filenames;
                    notably, this is the case on DOSBox.
                </p>
                <p>
                    In order to allow access to files whose name on the host system does
                    not conform to DOS standards while maintaining compatibility with GW-BASIC,
                    PC-BASIC will follow these steps to match DOS-style file names to host file names:
                </p>
                <ol>
                    <li>
                        Look for a file with the name as provided.
                        This can be a long file name which may contain non-permissible characters and which will be case sensitive if
                        your file system is.
                    </li>
                    <li>
                        If such a file is not found, it will truncate the name
                        provided to all-uppercase 8.3 format and look for an exact match.
                        The truncated name consists of the first 8 characters before the first dot,
                        followed by the first three characters after the first dot.
                        If the resulting file name contains non-permissible characters, an error will be raised.
                    </li>
                    <li>
                        Look for 8.3 names in mixed case which match the name
                        provided in a case-insensitive way. Such files are searched in lexicographic
                        order. File names longer than 8.3 will not be matched, unless their name is entered exactly.
                        On Windows, the name matched can be a short filename as well as a
                        long filename provided it is of 8.3 length &#8212; it may, for example, contain
                        spaces and thus not be a valid Windows short file name.
                    </li>
                </ol>
                <p>
                    If the file name provided ends in a single dot and contains no other dots,
                    PC-BASIC will first match the name as provided; if this is not found, it will match
                    the name as provided but without the single dot. The 8.3 format of such a file name will match
                    file names with and without the dot, in lexicographic order.
                </p>
                <p>
                    If no matching file is found for an output file name, a new file will be
                    created with an all-uppercase 8.3 file name.
                </p>
            </dd>
            <dt>
                Cassette device <code>CAS1:</code>
            </dt>
            <dd>
                <code><var>parameters</var></code> can be a file name of up to eight characters.
                Cassette file names are case sensitive, have no path or extension,
                may be empty and do not need to be unique. They may contain any
                character in the range <code>&amp;h20</code>&ndash;<code>&amp;hFF</code>.
                On the cassette device, when called in direct mode,
                <code><a href="#OPEN">OPEN</a></code>,
                <code><a href="#CHAIN">CHAIN</a></code>,
                <code><a href="#MERGE">MERGE</a></code>,
                <code><a href="#LOAD">LOAD</a></code>
                and <code><a href="#BLOAD">BLOAD</a></code> will print a message to the console
                for each file found while winding the tape. The message consists
                of the filename followed by a dot and the
                file type and concluded with a status message. The file type is one of
                the following:
                <dl class="compact">
                    <dt><samp>A</samp></dt>
                    <dd>Program file in text format</dd>
                    <dt><samp>B</samp></dt>
                    <dd>Program file in tokenised format</dd>
                    <dt><samp>D</samp></dt>
                    <dd>Data file</dd>
                    <dt><samp>M</samp></dt>
                    <dd><code><a href="#BSAVE">BSAVE</a></code> memory image</dd>
                    <dt><samp>P</samp></dt>
                    <dd>Program file in protected format</dd>
                </dl>
                If the file does not match the file specification and required file type,
                the status is <samp>Skipped</samp>; if the file matches, the status is
                <samp>Found</samp>. When called from a program, these statements do
                not print messages to the console.
                If the <code><var>device</var></code> was specified explicitly,
                <code><var>parameters</var></code> may also be empty. In this case the
                first file of the appropriate type is opened.
            </dd>
            <dt>
                Console and parallel devices <code>SCRN:</code>, <code>KYBD:</code>, and <code>LPT<var>n</var>:</code>
            </dt>
            <dd>
                These devices do not allow further device parameters.
            </dd>
            <dt>
                Serial devices <code>COM<var>n</var>:</code>
            </dt>
            <dd>
                <p>
                    When opening a <code>COM</code> port, the <code><var>file_spec</var></code> has the form
                    <code class="flow"><b>"COM</b><var>n</var><b>:</b>[<var>speed</var>[<b>,</b><var>parity</var>[<b>,</b><var>data</var>[<b>,</b><var>stop</var>[<b>,RS</b>][<b>,CS</b>[<var>n</var>]][<b>,DS</b>[<var>n</var>]][<b>,CD</b>[<var>n</var>]][<b>,LF</b>][<b>,PE</b>]]]]]<b>"</b></code>
                    The first four parameters after the device colon must be given
                    in the order specified but the named parameters
                    can be given in any order.
                    The meaning of the parameters is:
                </p>
                <div class="scrollable">
                    <table>
                        <tr>
                            <th>Parameter</th>
                            <th>Default</th>
                            <th>Meaning</th>
                        </tr>
                        <tr>
                            <td><code><var>speed</var></code></td>
                            <td><code>300</code></td>
                            <td>
                                Baud (bps) rate for the connection. <code><var>speed</var></code> is one of
                                <code>[75, 110, 150, 300, 600, 1200, 1800, 2400, 4800, 9600]</code>.
                            </td>
                        </tr>
                        <tr>
                            <td><code><var>parity</var></code></td>
                            <td><code>E</code></td>
                            <td>
                                Parity bit convention. <code><var>parity</var></code> is one of <code>[S, M, O, E, N]</code>.
                                <table>
                                    <tr>
                                        <th><code><var>parity</var></code></th>
                                        <th>Meaning</th>
                                        <th>Effect</th>
                                    </tr>
                                    <tr>
                                        <td><code>S</code></td>
                                        <td>SPACE</td>
                                        <td>Parity bit always set to 0.</td>
                                    </tr>
                                    <tr>
                                        <td><code>M</code></td>
                                        <td>MARK</td>
                                        <td>Parity bit always set to 1.</td>
                                    </tr>
                                    <tr>
                                        <td><code>O</code></td>
                                        <td>ODD</td>
                                        <td>Parity bit set so that character parity is odd.</td>
                                    </tr>
                                    <tr>
                                        <td><code>E</code></td>
                                        <td>EVEN</td>
                                        <td>Parity bit set so that character parity is even.</td>
                                    </tr>
                                    <tr>
                                        <td><code>N</code></td>
                                        <td>NONE</td>
                                        <td>No parity bit transmitted or received.</td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td><code><var>data</var></code></td>
                            <td><code>7</code></td>
                            <td>
                                Data bits per byte. <code><var>data</var></code> must be one of <code>[4, 5, 6, 7, 8]</code>.
                                A byte consists of the data bits plus parity bit, if
                                any. Byte size must be in the range <code>[5&#8212;8]</code>:
                                if <code><var>data</var></code> is <code>4</code>,
                                <code><var>parity</var></code> must not be <code>N</code>;
                                if <code><var>data</var></code> is <code>8</code>,
                                <code><var>parity</var></code> must be <code>N</code>.
                            </td>
                        </tr>
                        <tr>
                            <td><code><var>stop</var></code></td>
                            <td><code>1</code></td>
                            <td>
                                The number of stop bits. <code><var>stop</var></code> must be <code>1</code> or <code>2</code>.
                                Default is <code>2</code> if <code><var>speed</var></code> is <code>75</code> or <code>110</code>; <code>1</code> otherwise.
                            </td>
                        </tr>
                        <tr>
                            <td><code>RS</code></td>
                            <td>no</td>
                            <td>Suppress <i>Request To Send</i>.</td>
                        </tr>
                        <tr>
                            <td><code>CS[<var>n</var>]</code></td>
                            <td><code>CS1000</code></td>
                            <td>
                                Set <i>Clear To Send</i> timeout to <code><var>n</var></code> milliseconds.
                                If <code><var>n</var></code> is <code>0</code> or not given, disable CTS check.
                                Default is <code>CS0</code> if <code>RS</code> is set; <code>CS1000</code> otherwise.
                            </td>
                        </tr>
                        <tr>
                            <td><code>DS[<var>n</var>]</code></td>
                            <td><code>DS1000</code></td>
                            <td>
                                Set <i>Data Set Ready</i> timeout to <code><var>n</var></code> milliseconds.
                                If <code><var>n</var></code> is <code>0</code> or not given, disable DSR check.
                            </td>
                        </tr>
                        <tr>
                            <td><code>CD[<var>n</var>]</code></td>
                            <td><code>CD0</code></td>
                            <td>
                                Set <i>Carrier Detect</i> timeout to <code><var>n</var></code> milliseconds.
                                If <code><var>n</var></code> is <code>0</code> or not given, disable CD check.
                            </td>
                        </tr>
                        <tr>
                            <td><code>LF</code></td>
                            <td>no</td>
                            <td>Send a line feed after each carriage return.</td>
                        </tr>
                        <tr>
                            <td><code>PE</code></td>
                            <td>no</td>
                            <td>Enable parity checking (This setting is ignored by PC-BASIC).</td>
                        </tr>
                    </table>
                </div>
            </dd>

        </dl>

        <h5>Notes</h5>
        <ul>
            <li>
                If a <code>COM</code> port is opened for <code>RANDOM</code>, access is
                byte-for-byte rather than through <code>FIELD</code> records; <code>PRINT#</code> and <code>INPUT#</code> access
                the port directly. <code><var>rec_len</var></code> sets the number of bytes read by the <code>GET</code> and
                <code>PUT</code> statements.
            </li>
            <li>
                For <code>INPUT</code>, <code>OUTPUT</code> and <code>APPEND</code> modes, <code>LEN</code> may be specified but is ignored.
            </li>
            <li>
                If I/O is attempted contravening the <code>FOR</code> mode specified,
                the <code><a href="#PRINT">PRINT</a></code> or
                <code><a href="#INPUT-file">INPUT</a></code>
                statement will raise <samp>Bad file mode</samp>.
            </li>
            <li>
                If <code>RANDOM</code> I/O is attempted contravening the <code>ACCESS</code> mode specified, the
                <code>PUT</code> or <code>GET</code> statement will raise <samp>Path/File access error</samp>.
            </li>
            <li>
                The <code>#</code> is optional and has no effect.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> is empty or a non-existent device: <samp>Bad file number</samp>.
            </li>
            <li>
                <code>FOR APPEND ACCESS WRITE</code> is specified: <samp>Path/File access error</samp>.
            </li>
            <li>
                <code>FOR</code> and <code>ACCESS</code> mismatch in other ways: <samp>Syntax error</samp>.
            </li>
            <li>
                The <code>COM:</code> <code><var>file_spec</var></code> parameters do not follow the specification:
                <samp>Bad file name</samp>.
            </li>
            <li>
                The <code>CAS1:</code> <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp>.
            </li>
            <li>
                A file with the same name is already open for <code>OUTPUT</code> or <code>APPEND</code>: <samp>File already open</samp>.
                This is only raised for <code>COMn:</code>, <code>CASn:</code> and disk devices.
            </li>
            <li>
                <code><var>rec_len</var></code> or <code><var>file_num</var></code> have string values: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> or <code><var>mode_char</var></code> have number values: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not in <code>[1&#8212;<var>max_files</var>]</code>: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>rec_len</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
            <code>
                <var>rec_len</var></code> is not in <code>[1&#8212;128]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>mode_char</var></code> is empty or the first character is not in
                <code>["I", "O", "A", "R"]</code>: <samp>Bad file mode</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="OPTION-BASE"><code>OPTION BASE</code></h4>
        <code class="flow">
            <b>OPTION BASE</b> <var>n</var>
        </code>
        <p>
            Sets the starting index of all arrays to <code><var>n</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>n</var></code> is a literal digit  <code>0</code> or <code>1</code>. Expressions are not allowed.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code>OPTION BASE</code> has not been called,
                the first array allocation defaults to starting index 0.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>n</var></code> is not a digit <code>0</code> or <code>1</code>: <samp>Syntax error</samp>.
            </li>
            <li>
                <code>OPTION BASE 1</code> is called but an array has already been allocated before: <samp>Duplicate definition</samp>.
            </li>
            <li>
                <code>OPTION BASE</code> is called more than once with different starting index:
                <samp>Duplicate definition</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="OUT"><code>OUT</code></h4>
        <code class="flow">
            <b>OUT</b> <var>port</var><b>,</b> <var>value</var>
        </code>
        <p>
            Sends a byte to an emulated machine port.
        </p>
        <p>
            The following machine ports are emulated in PC-BASIC:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>port</var></code></th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code>&amp;h201</code></td>
                    <td>resets the game port (joystick port)</td>
                </tr>
                <tr>
                    <td><code>&amp;h3C5</code></td>
                    <td>sets the write bitmask for <code>SCREEN 7</code>, <code>8</code>, <code>9</code> colour planes.
                                <code><var>bitmask</var> = 2 ^ <var>value</var></code>.</td>
                </tr>
                <tr>
                    <td><code>&amp;h3CF</code></td>
                    <td>sets the read colour plane to <code><var>value</var></code>.</td>
                </tr>
                <tr>
                    <td><code>&amp;h3D8</code></td>
                    <td>
                        if <code><var>value</var> = &amp;h1A</code>, enable composite colorburst.<br/>
                        if <code><var>value</var> = &amp;h1E</code>, disable composite colorburst.<br/>
                        Requires <code><a href="#--video">video</a>={cga, tandy, pcjr}</code>.
                    </td>
                </tr>
            </table>
        </div>
        <h5>Notes</h5>
        <ul>
            <li>
                Only a limited number of machine ports are emulated.
            </li>
            <li>
                In GW-BASIC under MS-DOS, the sequence needed to set the colour plane mask is:
                <code class="block">
                    OUT &amp;h3C4, 2<br />
                    OUT &amp;h3C5, 2 ^ <var>plane</var>
                </code>
                The sequence needed to set the colour plane is:
                <code class="block">
                    OUT &amp;h3CE, 4<br />
                    OUT &amp;h3CF, <var>plane</var>
                </code>
                The initial <code>OUT</code> statements currently have no effect in PC-BASIC.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>port</var></code> is a numeric expression in <code>[-32768&#8212;65535]</code>.
            </li>
            <li>
                <code><var>value</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>port</var></code> or <code><var>value</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>port</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>value</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>value</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PAINT"><code>PAINT</code></h4>
        <code class="flow">
            <b>PAINT</b> [<b>STEP</b>] <b>(</b><var>x</var><b>,</b> <var>y</var><b>)</b> [<b>,</b> <var>attrib</var> [<b>,</b> <var>border</var> [<b>,</b> <var>background</var>]]]
        </code>
        <p>
            Flood-fills the screen with a colour or pattern, starting from the given seed point.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code>, <code><var>y</var></code> are numeric expressions in the range <code>[-32768&#8212;32767]</code>
                If <code>STEP</code> is specified, <code><var>x</var></code> <code><var>y</var></code> are offsets
                from the current position. If the seed point is outside the visible screen
                area, no flood fill is performed.
            </li>
            <li>
                <code><var>attrib</var></code> is an expression that specifies the fill attribute or pattern. If not
                specified, the current foreground attribute is used.
            </li>
            <li>
                If <code><var>attrib</var></code> has a number value, it must be in <code>[0&#8212;255]</code>; it specifies the colour
                attribute used to fill.
            </li>
            <li>
                If <code><var>attrib</var></code> has a string value, it specifies a tile pattern (see below).
            </li>
            <li>
                <code><var>border</var></code> is a numeric expression in <code>[0&#8212;255]</code>. It specifies the attribute
                of the fill boundary (see below).
            </li>
            <li>
                <code><var>background</var></code> is a string expression that represents a background tile
                pattern to ignore when determining boundaries (see below).
            </li>
        </ul>
        <h5>Tile patterns</h5>
        <p>
            A tile pattern can be specified by a string of up to 255 characters. The
            interpretation of the string depends on the number of bits per pixel and on
            the current screen mode.
        </p>
        <dl>
            <dt>
                1 bit per pixel (e.g. <code>SCREEN 2</code>)
            </dt>
            <dd>Here is an example:
                <table>
                    <tr>
                        <th>
                            <code>76543210</code>
                        </th>
                        <th>
                            Byte value
                        </th>
                    </tr>
                    <tr>
                        <td>
                            <code>
                                *.......
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h80
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <code>
                                .*......
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h40
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <code>
                                ..*.....
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h20
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <code>
                                ...*....
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h10
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <code>
                                ....*...
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h08
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <code>
                                .....*..
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h04
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <code>
                                ......*.
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h02
                            </code>
                        </td>
                    </tr>
                </table>
                This diagonal stripe pattern can thus be produced with
                <code class="flow">
                    PAINT (0, 0), CHR$(128)+CHR$(64)+CHR$(32)+CHR$(16)+CHR$(8)+CHR$(4)+CHR$(2)
                </code>
            </dd>
            <dt>
                <code>SCREEN 7</code>, <code>8</code>, <code>9</code>
            </dt>
            <dd>
                The tile pattern is always 8 pixels wide. The first character in the
                pattern string contains the first bit of each of these 8 pixels, the
                second character contains the second bits, etc.
                For example, in a 2-bits-per-pixel mode, four colour attributes can be used in the pattern.
                To create a diagonal stripe pattern of the same shape, in attribute <code>&amp;h03</code>, we now need a tile
                string that is twice as long:
                <table>
                    <tr>
                        <th>
                            Attribute bit
                        </th>
                        <th>
                            <code>76543210</code>
                        </th>
                        <th>
                            Byte value
                        </th>
                    </tr>
                    <tr>
                        <td>0</td>
                        <td>
                            <code>
                                *.......
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h80
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>
                            <code>
                                *.......
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h80
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>0</td>
                        <td>
                            <code>
                                .*......
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h40
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>
                            <code>
                                .*......
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h40
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>0</td>

                        <td>
                            <code>
                                ..*.....
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h20
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>
                            <code>
                                ..*.....
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h20
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>0</td>

                        <td>
                            <code>
                                ...*....
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h10
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>
                            <code>
                                ...*....
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h10
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>0</td>
                        <td>
                            <code>
                                ....*...
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h08
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>
                            <code>
                                ....*...
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h08
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>0</td>
                        <td>
                            <code>
                                .....*..
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h04
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>
                            <code>
                                .....*..
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h04
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>0</td>
                        <td>
                            <code>
                                ......*.
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h02
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>
                            <code>
                                ......*.
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h02
                            </code>
                        </td>
                    </tr>
                </table>
                If the pattern string is truncated before all bits of the last line
                have been defined, the remaining bits will be zero.
            </dd>
            <dt>
                <code>SCREEN 1</code>, <code>3</code>, <code>4</code>, <code>5</code> , <code>6</code>
            </dt>
            <dd>
                Each row of the tile pattern represents a screen row. Colours are
                encoded in consecutive bits; the more bits per pixel, the narrower the
                pattern is. For 2 bits per pixel, the pattern is 4 pixels wide; for 4
                bits per pixel it is 2 pixels wide. The following pattern string encodes
                a diagonal dotted stripe in two colours:
                <table>
                    <tr>
                        <th>
                            <code>3210</code>
                        </th>
                        <th>
                            <code>76543210</code>
                        </th>
                        <th>
                            Byte value
                        </th>
                    </tr>
                    <tr>
                        <td><code>2000</code></td>
                        <td>
                            <code>
                                *.......
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h80
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td><code>1000</code></td>
                        <td>
                            <code>
                                .*......
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h40
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td><code>0200</code></td>
                        <td>
                            <code>
                                ..*.....
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h20
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td><code>0100</code></td>
                        <td>
                            <code>
                                ...*....
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h10
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td><code>0020</code></td>
                        <td>
                            <code>
                                ....*...
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h08
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td><code>0010</code></td>
                        <td>
                            <code>
                                .....*..
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h04
                            </code>
                        </td>
                    </tr>
                    <tr>
                        <td><code>0002</code></td>
                        <td>
                            <code>
                                ......*.
                            </code>
                        </td>
                        <td>
                            <code>
                                &amp;h02
                            </code>
                        </td>
                    </tr>
                </table>
            </dd>
        </dl>
        <p>
            The tile pattern is anchored to the screen; imagine a grid starting at
            <code>(0,0)</code> and covering the screen. Whenever an area is tile-filled,
            the tiles are put into this grid. In this way, adjacent areas will have
            continuous tiling even if they were filled from different seed points.
        </p>
        <h5>Boundaries</h5>
        <p>
            A solid flood fill stops at pixels that have the same attribute as the fill
            or that have the specified border attribute, if specified.
            A tiling flood fill stops at the specified border attribute; if no border
            attribute is specified, it stops at the current foreground attribute.
            A tiling flood fill also stops at scan line intervals that are the same as
            the tiling pattern for that line, unless a background pattern is specified
            and the interval also equals the background pattern for that line.</p>
        <p>
            The background tile pattern is constructed just like the tile pattern. However, only
            the first row of the background tile is taken into account; the rest is ignored.
            The background tile must not match the attribute tile, or more than two consecutive rows of it.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                If more than two consecutive rows of the attribute tile (or all rows, if there are less than three)
                equal the first row of the background tile: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>background</var></code> has a number value: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>border</var></code>,<code><var>x</var></code>, or <code><var>y</var></code> have a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>border</var></code>,<code><var>x</var></code>, or <code><var>y</var></code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>border</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>attrib</var></code> is numeric and not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>attrib</var></code> is numeric and not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PALETTE"><code>PALETTE</code></h4>
        <code class="flow">
            <b>PALETTE</b> [<var>attrib</var><b>,</b> <var>colour</var>]
        </code>
        <p>
            Assigns a colour to an attribute. All pixels with that attribute will change
            colour immediately.
            If no parameters are specified, <code>PALETTE</code> resets to the initial setting.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>attrib</var></code> is a numeric expression between 0 and the current palette
                size, less one.
            </li>
            <li>
                <code><var>colour</var></code> is a numeric expression between -1 and the maximum number of
                colours for the current screen mode, less one. If <code><var>colour</var></code> equals -1,
                the palette remains unchanged.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>attrib</var></code> or <code><var>colour</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>attrib</var></code> or <code><var>colour</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>
            </li>
            <li>
                <code><var>attrib</var></code> or <code><var>colour</var></code> is not in range: <samp>Illegal function call</samp>
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PALETTE-USING"><code>PALETTE USING</code></h4>
        <code class="flow">
            <b>PALETTE USING</b> <var>int_array_name</var> {<b>(</b>|<b>[</b>} <var>start_index</var> {<b>)</b>|<b>]</b>}
        </code>
        <p>
            Assigns new colours to all attributes.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>int_array_name</var></code> is a single- or multidimensional
                array of integers (<code>%</code>) that will supply the
                new values for the palette.
            </li>
            <li>
                <code><var>start_index</var></code> is a numeric expression that
                indicates at which index in the array to start mapping to the palette.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                Array values are assigned to palette entries in the order in which they are stored in memory.
                See <a href="#arrays">Arrays</a> for details about the layout of arrays in memory.
            </li>
            <li>
                If an array entry has value <code>-1</code>, the matching attribute is left unchanged.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>int_array_name</var></code> has not been allocated: <samp>Illegal function call</samp>.
                The array will not be automatically allocated.
            </li>
            <li>
            <code><var>int_array_name</var></code> is not an integer array: <samp>Type mismatch</samp>.
            </li>
            <li>
            <code><var>int_array_name</var></code> is too short: <samp>Illegal function call</samp>.
            </li>
            <li>
            <code><var>start_index</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
            <code><var>start_index</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>
            </li>
            <li>
            <code><var>start_index</var></code> is outside array dimensions: <samp>Subscript out of range</samp>
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PCOPY"><code>PCOPY</code></h4>
        <code class="flow">
            <b>PCOPY</b> <var>src</var><b>,</b> <var>dst</var>
        </code>
        <p>
            Copies the screen page <code><var>src</var></code> to <code><var>dst</var></code>. All text and graphics on <code><var>dst</var></code> is
            replaced by those of <code><var>src</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>src</var></code> and <code><var>dst</var></code> are numeric expressions between 0 and the current video
                mode's number of pages, less one.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>src</var></code> or <code><var>dst</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>src</var></code> or <code><var>dst</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>src</var></code> or <code><var>dst</var></code> is out of range: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PEN-statement"><code>PEN</code> (statement)</h4>
        <code class="flow"><b>PEN</b> {<b>ON</b>|<b>OFF</b>|<b>STOP</b>}</code>
        <p>
            Controls event trapping and read access of the light pen (emulated through the mouse in PC-BASIC).
            <code>PEN ON</code> switches pen reading and trapping on.  <code>PEN OFF</code> switches it off.
            <code>PEN STOP</code> suspends <code>PEN</code> event trapping until <code>PEN ON</code> is
            executed. Up to one event can be triggered during suspension, provided that
            event handling was switched on prior to suspension. The event triggered during
            suspension is handled immediately after the next <code>PEN ON</code> statement.
        </p>
    </section>
<hr />

    <section>
        <h4 id="PLAY-event"><code>PLAY</code> (event switch)</h4>
        <code class="flow">
            <b>PLAY</b> {<b>ON</b>|<b>OFF</b>|<b>STOP</b>}
        </code>
        <ul>
            <li>
                <code>ON</code>: enables <code><a href="#ON-event">ON PLAY</a></code> event
                trapping of the music queue.
            </li>
            <li>
                <code>OFF</code>: disables trapping.
            </li>
            <li>
                <code>STOP</code>: halts trapping until <code>PLAY ON</code> is used.
                Events that occur while trapping is halted will trigger immediately when
                trapping is re-enabled.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PLAY"><code>PLAY</code> (music statement)</h4>
        <code class="flow">
            <b>PLAY</b> [<var>mml_string_0</var>] [<b>,</b> [<var>mml_string_1</var>] [<b>,</b> <var>mml_string_2</var>]]
        </code>
        <p>
            Plays the tune defined by the Music Macro Language strings <code><var>mml_string_0</var>, ...</code>.
        </p>
        <p>
            Unless <code><a href="#--syntax">syntax</a>={tandy | pcjr}</code> is set, only the single-voice syntax is available.
            The three separate MML strings correspond to the three voices of the PCjr/Tandy sound adapter.
            The notes in these strings are played synchronously.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>mml_string_0</var></code>, <code><var>mml_string_1</var></code>, <code><var>mml_string_2</var></code> are string expressions in MML.
            </li>
            <li>
                At least one parameter must be provided and the statement must not end in a comma.
            </li>
        </ul>
        <h5>Music Macro Language reference</h5>
        <h6>Notes and Pauses</h6>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Command</th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code>{<b>A</b>|<b>B</b>|<b>C</b>|<b>D</b>|<b>E</b>|<b>F</b>|<b>G</b>}[<b>#</b>|<b>+</b>|<b>-</b>][<var>m</var>]</code></td>
                    <td>
                        Play a note. <br/>
                        <code>+</code> or <code>#</code> indicates sharp. <br/>
                        <code>-</code> indicates flat. <br/>
                        <code><var>m</var></code> is a numeric literal and
                        indicates duration of an <code><var>m</var></code>th note.
                        <code><var>m</var></code> is in the range <code>[0&#8212;64]</code>.
                        If <code><var>m</var>=0</code> or omitted, use the default length.
                    </td>
                </tr>
                <tr>
                    <td><code><b>N</b><var>n</var></code></td>
                    <td>Play note <code><var>n</var></code>, in the range <code>[0&#8212;84]</code> (7 octaves).<br/>
                        <code><var>n</var> = 0</code> means rest.</td>
                </tr>
                <tr>
                    <td><code><b>O</b><var>n</var></code></td>
                    <td>Set the current octave to <code><var>n</var></code>, in the range <code>[0&#8212;6]</code>. Default is 4.</td>
                </tr>
                <tr>
                    <td><code><b>&gt;</b></code></td>
                    <td>Increase the current octave by 1, with a maximum of 6.</td>
                </tr>
                <tr>
                    <td><code><b>&lt;</b></code></td>
                    <td>Decrease the current octave by 1, with a minimum of 0.</td>
                </tr>
                <tr>
                    <td><code><b>P</b><var>n</var></code></td>
                    <td>
                        Pause for the duration of an <code><var>n</var></code>th note.
                        <code><var>n</var></code> is in the range <code>[0&#8212;64]</code>.
                        If <code><var>n</var>=0</code>, this has no effect.
                    </td>
                </tr>
            </table>
        </div>
        <h6>Timing commands</h6>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Command</th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code><b>.</b></code></td>
                    <td>
                        Increase the duration of the preceding note by 1/2 times its normal
                        duration. Periods can be repeated to increase duration further.</td>
                </tr>
                <tr>
                    <td><code><b>L</b><var>n</var></code></td>
                    <td>
                        Set the duration of following note to an <code><var>n</var></code>th note.
                        (<code><var>n</var>=4</code> is a quarter note, etc.)
                        <code><var>n</var></code> is in the range <code>[1&#8212;64]</code>.
                    </td>
                </tr>
                <tr>
                    <td><code><b>MN</b></code></td>
                    <td>Normal: 7/8 of the duration is sound, with 1/8 silence. Default mode.</td>
                </tr>
                <tr>
                    <td><code><b>ML</b></code></td>
                    <td>Legato: full duration is sound.</td>
                </tr>
                <tr>
                    <td><code><b>MS</b></code></td>
                    <td>Staccato: 3/4 of the duration is sound, with 1/4 silence.</td>
                </tr>
                <tr>
                    <td><code><b>T</b><var>n</var></code></td>
                    <td>
                        Sets the tempo to <code><var>n</var></code> <code>L4</code>s per minute.
                        <code><var>n</var></code> is in the range <code>[32&#8212;255]</code>.  Default is 120.
                    </td>
                </tr>
            </table>
        </div>
        <h6>Background-mode commands</h6>
        <p>
            These commands affect <code><a href="#SOUND">SOUND</a></code>,
            <code><a href="#PLAY">PLAY</a></code> and <code><a href="#BEEP">BEEP</a></code>
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Command</th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code><b>MB</b></code></td>
                    <td>
                        Turns on background mode; sound commands exit without waiting for the
                        music to finish. The music keeps playing while other commands are
                        executed. There can be up to 32 notes in the background music queue;
                        if more notes are played, <code>PLAY</code> will block until there are only 32 left.
                        Note that the gaps between notes in the default articulation and in staccato
                        are counted as separate notes on the queue.
                    </td>
                </tr>
                <tr>
                    <td><code><b>MF</b></code></td>
                    <td>Turns off background mode; sound commands block. Default mode.</td>
                </tr>
            </table>
        </div>
        <h6>Subroutine command</h6>
        <div class="scrollable">
            <table>
                <tr>
                    <th>Command</th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code><b>X</b><var>s</var></code></td>
                    <td>Execute substring. <code><var>s</var></code> is one of the following:
                        <ul>
                            <li>
                                a string variable name followed by a<code>;</code>
                            </li>
                            <li>
                                the result of <code><a href="#VARPTR$">VARPTR$()</a></code> on a string variable
                            </li>
                        </ul>
                    </td>
                </tr>
            </table>
        </div>
        <h6>Volume control</h6>
        <p>
            Volume control is available on <code><a href="#--syntax">syntax</a>={tandy | pcjr}</code> only:
        </p>
        <div class="scrollable">
        <table>
            <tr>
                <th>Command</th>
                <th>Effect</th>
            </tr>
            <tr>
                <td>
                    <code><b>V</b><var>n</var></code>
                </td>
                <td>
                    Set the volume to <code><var>n</var></code>, in the range <code>[-1&#8212;15]</code>. <code>-1</code> means full volume.
                    If <code><a href="#SOUND-switch">SOUND ON</a></code>
                    has not been executed, this has no effect.
                </td>
            </tr>
        </table>
        </div>
        <h6>MML Parameters</h6>
        <p>
            Numeric variables <code><var>n</var></code> in the commands above can be:
        </p>
        <ul>
            <li>
                an integer literal, e.g. <code>PLAY "L4G"</code>
            </li>
            <li>
                a numeric variable name or array element <code><var>var</var></code> preceded by <code>=</code> and followed by <code>;</code>.
                For example, <code>PLAY "L=VAR;G"</code> or <code>PLAY "L=A(1);G"</code>
            </li>
            <li>
                the result of <code>VARPTR$(<var>var</var>)</code> preceded by <code>=</code>.  For example, <code>PLAY "L=" + VARPTR$(VAR) + "G"</code>
            </li>
        </ul>
        <p>
            Note that only number <em>literals</em> may follow named notes and dereferencing variables or arrays is not allowed there.
            It is an error to write <code>PLAY "G=VAR;"</code> or <code>PLAY "G=" + VARPTR$(VAR)</code>.
            Use <code>PLAY "G4"</code> or <code>PLAY "L=VAR;G"</code> or <code>PLAY "L=" + VARPTR$(VAR) + "G"</code> instead.
        </p>
        <p>
            Commands may optionally be separated by one semicolon <code>;</code>, but not by more than one.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>mml_string</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>mml_string</var></code> has errors in the MML: <samp>Illegal function call</samp>.
            </li>
            <li>
                A variable in an MML string is of incorrect type: <samp>Type mismatch</samp>.
            </li>
            <li>
                No MML string is specified: <samp>Missing operand</samp>.
            </li>
            <li>
                If <code>SOUND ON</code> has not been executed, using the three-voice syntax
                will raise <samp>Syntax error</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="POKE"><code>POKE</code></h4>
        <code class="flow">
            <b>POKE</b> <var>address</var><b>,</b> <var>value</var>
        </code>
        <p>
            Sets the value of the memory byte at
            <code><var>segment</var> * 16 + <var>address</var></code> to <code><var>value</var></code>,
            where <code><var>segment</var></code> is the current segment set with
            <code><a href="#DEF-SEG">DEF SEG</a></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>address</var></code> is a numeric expression in <code>[-32768&#8212;65535]</code>. Negative values are
                interpreted as their two's complement.
            </li>
            <li>
                <code><var>value</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The memory is only partly emulated in PC-BASIC. See <a href="#memory">Memory model</a> for supported addresses.
                Outside emulated areas of memory, this statement has no effect.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>address</var></code> or <code><var>value</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>address</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>value</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>value</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PSET"><code>PSET</code> and <code>PRESET</code></h4>
        <code class="flow">
            { <b>PSET</b> | <b>PRESET</b> } [<b>STEP</b>] <b>(</b><var>x</var><b>,</b> <var>y</var><b>)</b> [<b>,</b> <var>attrib</var>]
        </code>
        <p>
            Change the attribute of a pixel on the screen at position <code>(<var>x</var>, <var>y</var>)</code>.
            If <code>STEP</code> is specified, <code>(<var>x</var>, <var>y</var>)</code> is an offset from the current position.
        </p>
        <p>
            If <code><var>attrib</var></code> is between 0 and the screen mode's palette size, the pixel is changed to
            attribute <code><var>attrib</var></code>. If <code><var>attrib</var></code> is larger than the palette size, the pixel's
            attribute is changed to the highest legal attribute value.
            If <code><var>attrib</var></code> is not specified, <code>PSET</code> changes the attribute to the current
            foreground attribute while <code>PRESET</code> changes it to zero.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x</var></code>, <code><var>y</var></code> are numeric expressions in <code>[-32768&#8212;32767]</code>.
            </li>
            <li>
                <code><var>attrib</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>x</var></code> or <code><var>y</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>attrib</var></code>, <code><var>x</var></code> or <code><var>y</var></code> or the physical coordinates they translate into are not in
                <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>attrib</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PRINT"><code>PRINT</code> and <code>LPRINT</code></h4>
        <code class="flow">
            {<b>LPRINT</b>|{<b>PRINT</b>|<b>?</b>} [<b>#</b> <var>file_num</var><b>,</b>]} [<var>expr_0</var>|<b>;</b>|<b>,</b>|<b>SPC(</b><var>n</var><b>)</b>|<b>TAB(</b><var>n</var><b>)</b>] ...
            [<b>USING</b> <var>format</var><b>;</b> <var>uexpr_0</var> [{<b>;</b>|<b>,</b>} <var>uexpr_1</var>] ... [<b>;</b>|<b>,</b>]]
        </code>
        <p>
            Writes expressions to the screen, printer, or file. If <code>LPRINT</code> is used,
            output goes to <code>LPT1:</code>. If <code><var>file_num</var></code> is specified, output goes to the file
            open under that number. <code>?</code> is a shorthand for <code>PRINT</code>.
        </p>
        <p>
            When writing a string expression to the screen, the following control characters have special meaning.
            Other characters are shown as their corresponding glyph in the current <a href="#cp437">codepage</a>.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th>
                        Code point
                    </th>
                    <th>
                        Control character
                    </th>
                    <th>
                        Effect
                    </th>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h07</code>
                    </td>
                    <td>
                        <code><i>BEL</i></code>
                    </td>
                    <td>
                        Beep the speaker.
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h08</code>
                    </td>
                    <td>
                        <code><i>BS</i></code>
                    </td>
                    <td>
                        Erase the character in the previous column and move the cursor back.
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h09</code>
                    </td>
                    <td>
                        <code><i>HT</i></code>
                    </td>
                    <td>
                        Jump to the next 8-cell tab stop.
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h0A</code>
                    </td>
                    <td>
                        <code><i>LF</i></code>
                    </td>
                    <td>
                        Go to the leftmost column in the next row; connect the rows to one logical line.
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h0B</code>
                    </td>
                    <td>
                        <code><i>VT</i></code>
                    </td>
                    <td>
                        Move the cursor to the top left of the screen.
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h0C</code>
                    </td>
                    <td>
                        <code><i>FF</i></code>
                    </td>
                    <td>
                        Clear the screen.
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h0D</code>
                    </td>
                    <td>
                        <code><i>CR</i></code>
                    </td>
                    <td>
                        Go to the leftmost column in the next row.
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h1C</code>
                    </td>
                    <td>
                        <code><i>FS</i></code>
                    </td>
                    <td>
                        Move the cursor one column to the right.
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h1D</code>
                    </td>
                    <td>
                        <code><i>GS</i></code>
                    </td>
                    <td>
                        Move the cursor one column to the left.
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h1E</code>
                    </td>
                    <td>
                        <code><i>RS</i></code>
                    </td>
                    <td>
                        Move the cursor one row up.
                    </td>
                </tr>
                <tr>
                    <td>
                        <code>&amp;h1F</code>
                    </td>
                    <td>
                        <code><i>US</i></code>
                    </td>
                    <td>
                        Move the cursor one row down.
                    </td>
                </tr>
            </table>
        </div>
        <p>
            Expressions can optionally be separated by one or more of the following keywords:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th>
                        Keyword
                    </th>
                    <th>
                        Effect
                    </th>
                </tr>
                <tr>
                    <td><code>;</code></td>
                    <td>
                        Attaches two expressions tight together; strings will be
                        printed without any space in between, numbers will have one space
                        separating them, in addition to the space or minus sign that indicate
                        the sign of the number.
                    </td>
                </tr>
                <tr>
                    <td><code>,</code></td>
                    <td>
                        The expression after will be positioned at the next available
                        zone. The output file is divided in 14-character zones; if the width of the
                        file is not a multiple of 14, the remaining spaces are unused and the first
                        zone of the next line is used instead. If the file has a width of less
                        than 14 characters, the zones are determined as if the file were wrapping
                        continuously.
                    </td>
                </tr>
                <tr>
                    <td><code>SPC(<var>n</var>)</code></td>
                    <td>
                        Produces <code><var>n</var></code> spaces, where <code><var>n</var></code> is a numeric
                        expression. if <code><var>n</var></code> is less than zero, it defaults to zero. If <code><var>n</var></code> is
                        greater than the file width, it is taken modulo the file width.
                    </td>
                </tr>
                <tr>
                    <td><code>TAB(<var>n</var>)</code></td>
                    <td>
                        Moves to column <code><var>n</var></code>, where <code><var>n</var></code> is a numeric
                        expression. if <code><var>n</var></code> is less than zero, it defaults to zero. If <code><var>n</var></code> is
                        greater than the file width, it is taken modulo the file width. If the
                        current column is greater than <code><var>n</var></code>, TAB moves to column <code><var>n</var></code> on the next
                        line.
                    </td>
                </tr>
            </table>
        </div>
        <p>
            If the print statement does not end in one of these four separation tokens, a newline is
            printed after the last expression.
            String expressions can be separated by one or more spaces, which has the same
            effect as separating by semicolons.
        </p>
        <h5>Format string syntax</h5>
        <p>
            A <code>USING</code> declaration occurs at the end of an <code>[L]PRINT[#]</code> statement and writes a
            formatted string to the screen, printer or file. The following tables list the format tokens
            that can be used inside the <code><var>format</var></code> string.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>_</code></td>
                    <td>
                        Escape character; causes the next character in the format string to be
                        printed as is rather than interpreted as a format token.
                    </td>
                </tr>
            </table>
        </div>
        <p>For string expressions:</p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>!</code></td>
                    <td>Prints the first character of a string.</td>
                </tr>
                <tr>
                    <td><code>\\</code></td>
                    <td>
                        Prints 2 or more characters of a string. A greater number of characters is
                        selected by separating the <code>\</code>s by spaces.
                    </td>
                </tr>
                <tr>
                    <td><code>&amp;</code></td>
                    <td>   Prints the whole string.</td>
                </tr>
            </table>
        </div>
        <p>
            For numeric expressions, the format string specifies a width and alignment.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>#</code></td>
                    <td>
                    Indicate a position for a digit.
                    </td>
                </tr>
                <tr>
                    <td><code>.</code></td>
                    <td>
                    Indicate the decimal point.
                    </td>
                </tr>
                <tr>
                    <td><code>,</code></td>
                    <td>
                        Before the decimal point: cause digits to be grouped in threes separated by
                        commas. After the decimal point it is not a token.
                        Provides one digit position.
                    </td>
                </tr>
            </table>
        </div>
        <p>
            The number of characters in the field must not exceed 24.
        </p>
        <p>
            Tokens preceding the number field:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>+</code></td>
                    <td>
                        Cause the sign to be printed for positive as well as negative numbers. The sign is to be printed to the left of the
                        number.
                    </td>
                </tr>
                <tr>
                    <td><code>**</code></td>
                    <td>
                        Cause any leading spaces to be replaced with <code>*</code>s.
                        Provides two digit positions.
                    </td>
                </tr>
                <tr>
                    <td><code>$$</code></td>
                    <td>
                        Cause a <code>$</code> to be printed to the left of the number.
                        Provides one digit position.
                    </td>
                </tr>
            </table>
        </div>
        <p>
            Tokens trailing the number field:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>+</code></td>
                    <td>
                        Cause the sign to be printed for positive as well as negative numbers.
                        The sign will be printed to the right of the number.
                    </td>
                </tr>
                <tr>
                    <td><code>-</code></td>
                    <td>
                        Cause the sign for negative numbers to be printed
                        to the right of the number. Note that <code>-</code> preceding the field is not a token
                        but printed literally.
                    </td>
                </tr>
                <tr>
                    <td><code>^^^^</code></td>
                    <td>
                        Specify that scientific notation is to be used, with a mantissa and an exponent represented by <code>E+00</code>.
                        In scientific notation, thousands separators will not be shown and any <code>,</code> character has the same effect as <code>#</code>.
                    </td>
                </tr>
            </table>
        </div>
        <p>
            Numeric expressions are always fully printed, even if they do not fit in the
            positions specified. If the number does not fit in the allowed space, a <code>%</code> is
            printed preceding it.
        </p>
        <ul>
            <li>
                If there are more expressions than format fields, the format string is
                wrapped around.
            </li>
            <li>
                Expressions may be separated with semicolons or commas; the effect is the
                same.
            </li>
            <li>
               If the <code>USING</code> declaration ends in a comma or semicolon, no newline is printed at
                the end.
            </li>
            <li>
               After a <code>USING</code> declaration, other elements of the <code>PRINT</code> syntax such as <code>SPC(</code> and <code>TAB(</code> can not
                be used.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>expr_0</var>, <var>expr_1</var>, ...</code> are expressions of any type.
            </li>
            <li>
                <code><var>format</var></code> is a string expression that specifies the output format.
            </li>
            <li>
                <code><var>uexpr_0</var>, <var>uexpr_1</var>, ...</code> are expressions matching a token in the format string.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If an error is raised, the output before the error was encountered is
                printed as normal.
            </li>
            <li>
                In GW-BASIC, when formatting a number with a dollar sign, if the number is in the range <code>[-10000&mdash;-32767]</code> and does not fit in the width of the number field,
                the minus sign is omitted. This is not implemented in PC-BASIC.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>n</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>n</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                The format string contains no tokens: <samp>Illegal function call</samp>.
            </li>
            <li>
                An expression doesn't match the corresponding format token type: <samp>Type mismatch</samp>.
            </li>
            <li>
                A number field in the format string exceeds 24 characters: <samp>Illegal function call</samp>.
            </li>
            <li>
                A number field in the format string contains no <code>#</code> characters: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PUT-files"><code>PUT</code> (files)</h4>
        <code class="flow">
            <b>PUT</b> [<b>#</b>] <var>file_number</var> [<b>,</b> <var>record_number</var>]
        </code>
        <p>
            Writes a record to the random-access file <code><var>file_number</var></code> at position
            <code><var>record_number</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is a numeric expression that yields the number
                of an open random-access file. The <code>#</code> is optional and has no effect.
            </li>
            <li>
                <code><var>record_number</var></code> is a numeric expression in <code>[1&#8212;33554432]</code> (<code>2^25</code>) and is interpreted as the record number.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                The record number is stored as single-precision; this precision is not high enough to distinguish single
                records near the maximum value of <code>2^25</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>record_number</var></code> is not in <code>[1&#8212;33554432]</code>: <samp>Bad record number</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not the number of an open file:
                <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is open under a mode other than <code>RANDOM</code>:
                <samp>Bad file mode</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not specified: <samp>Missing operand</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PUT-serial"><code>PUT</code> (communications)</h4>
        <code class="flow">
            <b>PUT</b> [<b>#</b>] <var>com_file_number</var> [<b>,</b> <var>number_bytes</var>]
        </code>
        <p>
            Writes <code><var>number_bytes</var></code> bytes to the communications buffer opened under file
            number <code><var>com_file_number</var></code>. <code><var>number_bytes</var></code> is a numeric expression between 1
            and the <code>COM</code> buffer length, inclusive.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                In GW-BASIC, <samp>Device I/O error</samp> is raised for overrun error, framing error,
                and break interrupt. <samp>Device fault</samp> is raised if DSR is lost during I/O. A
                <samp>Parity error</samp> is raised if parity is enabled and incorrect parity is
                encountered. This is according to the manual; it is untested.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>bytes</var></code> is less than 1: <samp>Bad record number</samp>.
            </li>
            <li>
                <code><var>bytes</var></code> is less than <code>32768</code> and greater than the <code>COM</code> buffer length: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>com_file_number</var></code> is not specified: <samp>Missing operand</samp>.
            </li>
            <li>
                <code><var>com_file_number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>com_file_number</var></code> is not the number of an open file:
                <samp>Bad file number</samp>.
            </li>
            <li>
                The serial input buffer is full, i.e. <code><a href="#LOF">LOF</a>(<var>com_file_number</var>) = 0</code> and
                <code><a href="#LOC">LOC</a>(<var>com_file_number</var>)=255</code>: <samp>Communication buffer overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="PUT-graphics"><code>PUT</code> (graphics)</h4>
        <code class="flow">
            <b>PUT (</b><var>x0</var><b>,</b> <var>y0</var><b>),</b> <var>array_name</var> [<b>,</b> {<b>PSET</b>|<b>PRESET</b>|<b>AND</b>|<b>OR</b>|<b>XOR</b>}]
        </code>
        <p>
            Displays an array to a rectangular area of the graphics screen.
            Usually, <code>PUT</code> is used with arrays that have been stored using <code>GET</code>. See <code><a href="#GET-graphics">GET</a></code> for the
            format of the array.
        </p>
        <p>
            The keywords have the following effect:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <td><code>PSET</code></td>
                    <td>Overwrite the screen location with the new image</td>
                </tr>
                <tr>
                    <td><code>PRESET</code></td>
                    <td>Overwrite the screen location with the inverse image</td>
                </tr>
                <tr>
                    <td><code>AND</code></td>
                    <td>Combines the old and new attributes with bitwise AND</td>
                </tr>
                <tr>
                    <td><code>OR</code></td>
                    <td>Combines the old and new attributes with bitwise OR</td>
                </tr>
                <tr>
                    <td><code>XOR</code></td>
                    <td>Combines the old and new attributes with bitwise XOR</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>array_name</var></code> is a numeric array.
            </li>
            <li>
                <code><var>x0</var></code>, <code><var>y0</var></code> are numeric expressions.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                The array does not exist: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>array_name</var></code> refers to a string array: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x0</var></code>, <code><var>y0</var></code> are string expressions: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x0</var></code>, <code><var>y0</var></code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>x0</var></code>, <code><var>y0</var></code> is outside the current <code>VIEW</code> or <code>WINDOW</code>:
                <samp>Illegal function call</samp>
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="RANDOMIZE"><code>RANDOMIZE</code></h4>
        <code class="flow">
            <b>RANDOMIZE</b> [<var>expr</var>]
        </code>
        <p>
            Seeds the random number generator with <code><var>expr</var></code>.
            If no seed is specified, <code>RANDOMIZE</code> will prompt the user
            to enter a random seed. The user-provided value is rounded to an integer.
            The random seed is formed of the last two bytes of that integer or <code><var>expr</var></code>.
            If <code><var>expr</var></code> is a float (4 or 8 bytes), these are
            <code><a href="#boolean-operators">XOR</a></code>ed with the preceding 2. The
            first 4 bytes of a double are ignored.
            The same random seed will lead to the same sequence of pseudorandom numbers
            being generated by the <code><a href="#RND">RND</a></code> function.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>expr</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                For the same seed, PC-BASIC produces the same pseudorandom numbers as
                GW-BASIC 3.23.
            </li>
            <li>
                The random number generator is very poor and should not be used for serious purposes.
                See <code><a href="#RND">RND</a></code> for details.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>expr</var></code> has a string value: <samp>Illegal function call</samp>.
            </li>
            <li>
                The user provides a seed outside <code>[-32768&#8212;32767]</code> at the prompt: <samp>Overflow</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="READ"><code>READ</code></h4>
        <code class="flow">
            <b>READ</b> <var>var_0</var> [<b>,</b> <var>var_1</var>] ...
        </code>
        <p>
            Assigns data from a <code><a href="#DATA">DATA</a></code> statement to variables. Reading starts at the current
            <code>DATA</code> position, which is the <code>DATA</code> entry immediately after the last one read by
            previous <code>READ</code> statements. The <code>DATA</code> position is reset
            to the start by the <code><a href="#RUN">RUN</a></code>
            and <code><a href="#RESTORE">RESTORE</a></code> statements.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>var_0</var></code>, <code><var>var_1</var></code> are variables or array elements.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Not enough data is present in <code>DATA</code> statements: <samp>Out of DATA</samp>.
            </li>
            <li>
                The type of the variable is not compatible with that of the data entry
                being read: a <samp>Syntax error</samp> occurs on the <code>DATA</code> line.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="REM"><code>REM</code></h4>
        <code class="flow">
            {<b>REM</b>|<b>'</b>} [<var>anything</var>]
        </code>
        <p>
            Ignores everything until the end of the line. The <code>REM</code> statement is intended for
            comments. Everything after <code>REM</code> will be stored in the program unaltered and
            uninterpreted. <code>'</code> (apostrophe) is an alias for <code>:REM'</code>; it can be placed at any
            point in the program line and will ensure that the rest of the line is ignored.
        </p>
        <p>
            Note that a colon <code>:</code> does not terminate the <code>REM</code> statement; the colon and everything
            after it will be treated as part of the comment.
        </p>
    </section>
<hr />

    <section>
        <h4 id="RENUM"><code>RENUM</code></h4>
        <code class="flow">
            <b>RENUM</b> [<var>new</var>|<b>.</b>] [<b>,</b> [<var>old</var>|<b>.</b>] [<b>,</b> <var>increment</var>]]
        </code>
        <p>
            Replaces the line numbers in the program by a systematic enumeration starting
            from <code><var>new</var></code> and increasing by <code><var>increment</var></code>. If <code><var>old</var></code> is specified, line numbers
            less than <code><var>old</var></code> remain unchanged.
            <code><var>new</var></code>, <code><var>old</var></code> are line numbers; the dot <code>.</code> signifies the last line edited.
            <code><var>increment</var></code> is a line number but must not be a dot or zero.
            Also stops program execution and returns control to the user. Any further statements on the line will be ignored, also in direct mode.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                Line numbers afer the following keywords will be renumbered:
                <code><a href="#AUTO">AUTO</a></code>, <code><a href="#EDIT">EDIT</a></code>,
                <code><a href="#ELSE">ELSE</a></code>, <code><a href="#ERL">ERL</a></code>,
                <code><a href="#DELETE">DELETE</a></code>, <code><a href="#GOSUB">GOSUB</a></code>,
                <code><a href="#GOTO">GOTO</a></code>, <code><a href="#LIST">LIST</a></code>,
                <code><a href="#LLIST">LLIST</a></code>, <code><a href="#RENUM">RENUM</a></code>,
                <code><a href="#RESTORE">RESTORE</a></code>, <code><a href="#RESUME">RESUME</a></code>,
                <code><a href="#RETURN">RETURN</a></code>, <code><a href="#RUN">RUN</a></code>,
                <code><a href="#THEN">THEN</a></code>.
            </li>
            <li>
                Any line numbers in <code><a href="#CHAIN">CHAIN</a></code> statements will not be
                renumbered; note that these line numbers refer to another program.
            </li>
            <li>
                All arguments of <code>RENUM</code> or <code>AUTO</code> statements in a program will be renumbered,
                including any line number offsets or increments, even though that does not make much sense.
            </li>
            <li>
                A zero line number following the keywords <code>ERROR GOTO</code> will not be renumbered.
            </li>
            <li>
                If a referenced line number does not exist in the program, a
                message <samp>Undefined line <var>ref</var> in <var>old_line</var></samp>
                is printed. Here, <code><var>old_line</var></code>
                is the line number prior to renumbering. The referenced line number will be
                left unchanged, but the line's old line number will be renumbered.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the parameters is not in <code>[0&#8212;65529]</code>: <samp>Syntax error</samp>.
            </li>
            <li>
                Any of the newly generated line numbers is greater than <code>65529</code>:
                <samp>Illegal function call</samp>. The line numbers up to the error have not been
                changed.
            </li>
            <li>
                <code><var>increment</var></code> is empty or zero: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>old</var></code> is specified and <code><var>new</var></code> is less than or equal to an existing line
                number less than old: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="RESET"><code>RESET</code></h4>
        <code class="flow">
            <b>RESET</b>
        </code>
        <p>
            Closes all open files.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                Official GW-BASIC documentation and many other sources state that
                <code>RESET</code> closes all files <em>on disk devices</em>.
                However, in reality GW-BASIC 3.23 also closes files on tape
                and any other device, making this statement identical to
                <code><a href="#CLOSE">CLOSE</a></code> with no arguments.
                PC-BASIC follows this behaviour.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="RESTORE"><code>RESTORE</code></h4>
        <code class="flow">
            <b>RESTORE</b> [<var>line</var>]
        </code>
        <p>
            Resets the <code><a href="#DATA">DATA</a></code> pointer.
            <code><var>line</var></code> is a line number. If <code><var>line</var></code>
            is not specified, the <code>DATA</code> pointer is reset to the first
            <code>DATA</code> entry in the program. If it is specified, the <code>DATA</code> pointer is
            reset to the first <code>DATA</code> entry in or after <code><var>line</var></code>.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line</var></code> is not an existing line number: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="RESUME"><code>RESUME</code></h4>
        <code class="flow">
            <b>RESUME</b> [<b>0</b>|<b>NEXT</b>|<var>line</var>]
        </code>
        <p>
            Continues normal execution after an error handling routine.
            If <code>0</code> or no option is specified, re-executes the statement that caused the
            error. If <code>NEXT</code> is specified, executes the statement following the one that
            caused the error. If <code><var>line</var></code> is specified, it must be a valid line number.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code>RESUME</code> is encountered outside of an error trapping routine:
                <samp>RESUME without error</samp>.
            </li>
            <li>
                The program ends inside an error trapping routine without a <code>RESUME</code>
                or <code>END</code> statement: <samp>No RESUME</samp>.
            </li>
            <li>
                <code><var>line</var></code> is not an existing line number: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="RETURN"><code>RETURN</code></h4>
        <code class="flow">
            <b>RETURN</b> [<var>line</var>]
        </code>
        <p>
            Returns from a <code><a href="#GOSUB">GOSUB</a></code> subroutine.
            If <code><var>line</var></code> is not specified, <code>RETURN</code> jumps back
            to the statement after the <code>GOSUB</code> that jumped into the subroutine.
            If <code><var>line</var></code> is specified, it must be a valid line number. <code>RETURN</code> jumps to that
            line (and pops the <code>GOSUB</code> stack).
            When returning from an error trapping routine, <code>RETURN</code> re-enables the event
            trapping which was stopped on entering the trap routine.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line</var></code> is not an existing line number: <samp>Undefined line number</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="RMDIR"><code>RMDIR</code></h4>
        <code class="flow">
            <b>RMDIR</b> <var>dir_spec</var>
        </code>
        <p>
            Removes an empty directory on a disk device.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                The string expression <code><var>dir_spec</var></code> is a
                valid <a href="#filespec">file specification</a> that specifies the path and name of the directory.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>dir_spec</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>dir_spec</var></code> is an empty string: <samp>Bad file name</samp>.
            </li>
            <li>
                No matching path is found: <samp>Path not found</samp>.
            </li>
            <li>
                Directory to remove is not empty: <samp>Path/File access error</samp>.
            </li>
        </ul>
    </section>
<hr />


    <section>
        <h4 id="RSET"><code>RSET</code></h4>
        <code class="flow">
            <b>RSET</b> <var>string_name</var> <b>=</b> <var>expression</var>
        </code>
        <p>
            Copies a string value into an existing string variable or array element.
            The value will be right-justified and any remaining characters are replaced by
            spaces.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>string_name</var></code> is a string variable or array element.
            </li>
                <li><code><var>expression</var></code> is a string expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><var>expression</var></code> has a value that is longer than the length of the target variable,
                it is truncated at the tail to the length of the target variable.
            </li>
            <li>
                If <code><var>string_name</var></code> has not been allocated before, this statement has no effect.
            </li>
            <li>
                Use <code><a href="#LSET">LSET</a></code>, <code><a href="#RSET">RSET</a></code> or
                <code><a href="#MID$-statement">MID$</a></code> to copy values into a <code><a href="#FIELD">FIELD</a></code> buffer.
            </li>
            <li>
                If <code><a href="#LET">LET</a></code> is used on a <code>FIELD</code> variable
                instead of <code>L|RSET</code>, the variable is
                detached from the field and a new, normal string variable is allocated.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>string_name</var></code> is not a string variable: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>expression</var></code> does not have a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />
<hr />

    <section>
        <h4 id="RUN"><code>RUN</code></h4>
        <code class="flow">
            <b>RUN</b> [<var>line_number</var> [<var>anything</var>]|<var>file_spec</var> [<b>, R</b>]]
        </code>
        <p>
            Executes a program.
            Existing variables will be cleared. <code>RUN</code> implies <code><a href="#CLEAR">CLEAR</a></code>.
            If <code><var>file_spec</var></code> is given, any program in memory will be erased.
            If <code>,R</code> is specified after <code><var>file_spec</var></code>, files are kept open; if not, all files are closed.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> is a valid line number in the current program.
                If specified, execution starts from this line number. The rest of the <code>RUN</code> statement is ignored in this case.
            </li>
            <li>
                The string expression <code><var>file_spec</var></code>, if specified,
                is a valid <a href="#filespec">file specification</a> indicating
                the file to read the program from.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>line_number</var></code> is not a line number in the current program: <samp>Undefined line number</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> cannot be found: <samp>File not found</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> is an empty string: <samp>Bad file number</samp>.
            </li>
            <li>
                A loaded text file contains lines without line numbers:
                <samp>Direct statement in file</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="SAVE"><code>SAVE</code></h4>
        <code class="flow">
            <b>SAVE</b> <var>file_spec</var> [<b>,</b> {<b>A</b>|<b>P</b>}]
        </code>
        <p>
            Stores the current program in a file.
        </p>
        <ul>
            <li>
                If <code><b>,A</b></code> is specified, the program will be saved in plain text format.
                In this case, program execution will stop and control will be returned to the user.
                Any further statements on teh line will be ignored, also in direct mode.
            </li>
            <li>
                If <code><b>,P</b></code> is specified, the program will be saved in <a href="#protected-file-format">protected format</a>.
                When a protected program is loaded in GW-BASIC, it cannot be <code>LIST</code>ed or <code>SAVE</code>d in non-protected
                format.
            </li>
            <li>
                If neither is specified, the program will be saved in <a href="#tokenised-file-format">tokenised format</a>.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                The string expression <code><var>file_spec</var></code> is a valid <a href="#filespec">file specification</a>
                indicating the file to store to.
           </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_spec</var></code> has a number value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> is an empty string: <samp>Bad file number</samp>.
            </li>
            <li>
                <code><var>file_spec</var></code> contains disallowed characters:
                <samp>Bad file number</samp> (on <code>CAS1:</code>);
                <samp>Bad file name</samp> (on disk devices).
            </li>
            <li>
                <code><a href="#--hide-protected">hide-protected</a></code> is enabled, the current program is protected and <code>,P</code> is not specified:
                <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="SCREEN-statement"><code>SCREEN</code> (statement)</h4>
        <code class="flow">
            <b>SCREEN</b> [<var>mode</var>] [<b>,</b> [<var>colorburst</var>] [<b>,</b> [<var>apage</var>] [<b>,</b> [<var>vpage</var>] [<b>,</b> <var>erase</var>]]]]
        </code>
        <p>
            Change the video mode, composite colorburst, active page and visible page. Video modes are described in the <a href="#videomodes">Video Modes</a> section.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>mode</var></code> is a numeric expression that sets the screen mode.
            </li>
            <li>
                <code><var>colorburst</var></code> is a numeric expression. See notes below.
            </li>
            <li>
                <code><var>apage</var></code> is a numeric expression that sets the active page.
            </li>
            <li>
                <code><var>vpage</var></code> is a numeric expression that sets the visible page.
            </li>
            <li>
                <code><var>erase</var></code> is a numeric expression in the range <code>[0, 1, 2]</code>.
                It is only legal with <code><a href="#--syntax">syntax</a>={pcjr, tandy}</code>. See notes below.
            </li>
        </ul>
        <h5 id="videomodes">Video modes</h5>
        <p>The video modes are as follows:</p>
        <dl>
            <dt><code>SCREEN 0</code> Text mode</dt>
            <dd>
                80x25 or 40x25 characters of 8x16 pixels<br/>
                16 attributes picked from 64 colours<br/>
                Attributes 16-31 are blinking versions of 0-15<br/>
                4 pages <code>ega</code>
            </dd>
            <dt><code>SCREEN 1</code> CGA colour</dt>
            <dd>
                320x200 pixels<br/>
                40x25 characters of 8x8 pixels<br/>
                4 attributes picked from 16 colours; 2 bits per pixel<br/>
                1 page <code>ega</code> 2 pages <code>pcjr</code> <code>tandy</code><br/>
            </dd>
            <dt><code>SCREEN 2</code> CGA monochrome</dt>
            <dd>
                640x200 pixels<br/>
                80x25 characters of 8x8 pixels<br/>
                2 attributes picked from 16 colours; 1 bit per pixel<br/>
                1 page <code>ega</code> 2 pages <code>pcjr</code> <code>tandy</code><br/>
            </dd>
            <dt><code>SCREEN 3</code> Low-res 16-colour <code>pcjr</code> <code>tandy</code></dt>
            <dd>
                160x200 pixels<br/>
                20x25 characters of 8x8 pixels<br/>
                16 attributes picked from 16 colours; 4 bits per pixel<br/>
                2 pages<br/>
            </dd><dt><code>SCREEN 3</code> Hercules monochrome <code>hercules</code><br/></dt>
            <dd>
                720x348 pixels<br/>
                80x25 characters of 9x14 pixels (with bottom line truncated by 2 px)<br/>
                2 attributes; 1 bit per pixel<br/>
                2 pages<br/>
            </dd>
            <dt><code>SCREEN 3&#8212;255</code> Altissima risoluzione <code>olivetti</code><br/></dt>
            <dd>
                640x400 pixels<br/>
                80x25 characters of 8x16 pixels<br/>
                2 attributes of which one picked from 16 colours; 2 bits per pixel<br/>
                1 page<br/>
            </dd>
            <dt><code>SCREEN 4</code> Med-res 4-colour <code>pcjr</code> <code>tandy</code><br/></dt>
            <dd>
                320x200 pixels<br/>
                40x25 characters of 8x8 pixels<br/>
                4 attributes picked from 16 colours; 2 bits per pixel<br/>
                2 pages<br/>
            </dd>
            <dt><code>SCREEN 5</code> Med-res 16-colour <code>pcjr</code> <code>tandy</code><br/></dt>
            <dd>
                320x200 pixels<br/>
                40x25 characters of 8x8 pixels<br/>
                16 attributes picked from 16 colours; 4 bits per pixel<br/>
                1 page<br/>
                <p><em>Note: a minimum of 32768 bytes of video memory must be
                reserved to use this video mode.</em> Use the statement
                <code><a href="#CLEAR">CLEAR</a> ,,,32768!</code>
                or the option
                <code><a href="#--video-memory">video-memory</a>=32768</code>.</p>
            </dd>
            <dt><code>SCREEN 6</code> High-res 4-colour <code>pcjr</code> <code>tandy</code><br/></dt>
            <dd>
                640x200 pixels<br/>
                80x25 characters of 8x8 pixels<br/>
                4 attributes picked from 16 colours; 2 bits per pixel<br/>
                1 page<br/>
                <p><em>Note: a minimum of 32768 bytes of video memory must be
                reserved to use this video mode.</em> Use the statement
                <code><a href="#CLEAR">CLEAR</a> ,,,32768!</code>
                or the option
                <code><a href="#--video-memory">video-memory</a>=32768</code>.</p>
            </dd>
            <dt><code>SCREEN 7</code> EGA colour <code>ega</code></dt>
            <dd>
                320x200 pixels<br/>
                40x25 characters of 8x8 pixels<br/>
                16 attributes picked from 16 colours; 4 bits per pixel<br/>
                8 pages<br/>
            </dd>
            <dt><code>SCREEN 8</code> EGA colour <code>ega</code></dt>
            <dd>
                640x200 pixels<br/>
                80x25 characters of 8x8 pixels<br/>
                16 attributes picked from 16 colours; 4 bits per pixel<br/>
                4 pages<br/>
            </dd>
            <dt><code>SCREEN 9</code> EGA colour <code>ega</code></dt>
            <dd>
                640x350 pixels<br/>
                80x25 characters of 8x14 pixels<br/>
                16 attributes picked from 64 colours; 4 bits per pixel<br/>
                2 pages<br/>
            </dd>
            <dt><code>SCREEN 10</code> EGA monochrome <code>ega</code> <code>monitor=mono</code></dt>
            <dd>
                640x350 pixels<br/>
                80x25 characters of 8x14 pixels<br/>
                4 attributes picked from 9 pseudocolours; 2 bits per pixel<br/>
                2 pages<br/>
            </dd>
        </dl>
        <h5>NTSC Composite Colorburst</h5>
        <p>
            On CGA, Tandy and PCjr, <code><var>colorburst</var></code> has the following effects, depending on the
            type of monitor - RGB (default) or composite:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>mode</var></code></th>
                    <th><code><var>colorburst</var></code></th>
                    <th>CGA mode</th>
                    <th>Effect (composite)</th>
                    <th>Effect (RGB)</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>0</td>
                    <td>0, 2</td>
                    <td>greyscale</td>
                    <td>default palette</td>
                </tr>
                <tr>
                    <td>0</td>
                    <td>1</td>
                    <td>1, 3</td>
                    <td>colour</td>
                    <td>default palette</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>0</td>
                    <td>4</td>
                    <td>colour</td>
                    <td>default palette</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>1</td>
                    <td>5</td>
                    <td>greyscale</td>
                    <td>alternate palette</td>
                </tr>
            </table>
        </div>
        <p>
            On <code>SCREEN 2</code>, <code><var>colorburst</var></code> has no effect; on a composite monitor, colour artifacts
            can be enabled on this screen through <code>OUT</code> (see there). On <code>SCREEN 3</code> and up, <code><var>colorburst</var></code> has no effect.
        </p>
        <h5>Erase</h5>
        <p>
            By default, if the <code><var>mode</var></code> changes or the <code><var>colorburst</var></code>
            changes between zero and non-zero, the old page and the new page of the screen
            are cleared. On <code><a href="#--syntax">syntax</a>={pcjr, tandy}</code>,
            the <code><var>erase</var></code> parameter can be used to change this behaviour.
            Its values are as follows:
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>erase</var></code></th>
                    <th>Effect</th>
                </tr>
                <tr>
                    <td><code>0</code></td>
                    <td>Do not erase any screen page</td>
                </tr>
                <tr>
                    <td><code>1</code> (default)</td>
                    <td>If the <code><var>mode</var></code> changes or the <code><var>colorburst</var></code>
                    changes between zero and non-zero, the old page and the new page of the screen
                    are cleared.</td>
                </tr>
                <tr>
                    <td><code>2</code></td>
                    <td>If the <code><var>mode</var></code> changes or the <code><var>colorburst</var></code>
                    changes between zero and non-zero, all pages of the screen are cleared.</td>
                </tr>
            </table>
        </div>
        <h5>Notes</h5>
        <ul><li>
            At least one parameter must be specified.
        </li><li>
            Composite colour artifacts are emulated only crudely in PC-BASIC, and not at
            all in <code>SCREEN 1</code>.
        </li></ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No parameters are specified: <samp>Missing operand</samp>.
            </li>
            <li>
                Any parameter has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                Any parameter is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>mode</var></code> is not an available video mode number for your video card setting: <samp>Illegal function call</samp>.
            </li>
            <li>
            <code><var>vpage</var></code>, <code><var>apage</var></code> are not between 0 and the number of pages for the
                chosen video mode, less one:  <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>colorburst</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>erase</var></code> is not in <code>[0, 1, 2]</code>:
                <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="SHELL"><code>SHELL</code></h4>
        <code class="flow">
            <b>SHELL</b> [<var>command</var>]
        </code>
        <p>
            Starts an operating system subshell on the console.
            If <code><var>command</var></code> is specified, the command is executed on the shell and execution
            returns to the program.
        </p>
        <p>
            To enable this statement, the <code><a href="#--shell">shell</a></code> option must be set to
            a valid command interpreter.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>command</var></code> is a string expression.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
            Be careful when enabling this command, as it allows the running BASIC program full access to your files and operating system.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><a href="#--shell">shell</a></code> option is not specified: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>command</var></code> has a number value: <samp>Type mismatch</samp>.
            </li>
            <li>
                All output from the operating system subshell, including error messages, is displayed
                on the PC-BASIC screen.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="SOUND"><code>SOUND</code> (tone)</h4>
        <code class="flow">
            <b>SOUND</b> <var>frequency</var><b>,</b> <var>duration</var> [<b>,</b> <var>volume</var> [<b>,</b> <var>voice</var>]]
        </code>
        <p>
            Produces a sound at <code><var>frequency</var></code> Hz for <code><var>duration</var>/18.2</code> seconds.
            On PCjr and Tandy, the volume and voice channel can additionally be specified.
        </p>
        <p>
            If <code>PLAY "MB"</code> has been executed, <code>SOUND</code> plays in the background. If <code>PLAY "MF"</code>
            has been executed, sound plays in the foreground and the interpreter blocks
            until the sound is finished. Foreground mode is default. Unlike <code><a href="#PLAY">PLAY</a></code>, the
            sound played by the most recent <code>SOUND</code> statement always plays in the background,
            even if <code>PLAY "MF"</code> has been entered. In background mode, each <code>SOUND</code> statement
            counts as 1 toward the length of the queue reported by the <code><a href="#PLAY-function">PLAY</a></code> function.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>frequency</var></code> is a numeric expression in <code>[37&#8212;32767]</code> or <code>0</code> (for <code>syntax={advanced | pcjr}</code>)
                or in <code>[-32768&#8212;32767]</code> (for <code>syntax=tandy</code>).
            </li>
            <li>
                <code><var>duration</var></code> is a numeric expression in <code>[0&#8212;65535]</code>.
            </li>
            <li>
                <code><var>volume</var></code> is a numeric expression in <code>[-1&#8212;15]</code>. 0 is silent, 15 is full
                volume; every step less reduces the volume by 2 dB. -1 is also full volume.
                (For <code>syntax={pcjr | tandy}</code>).
            </li>
            <li>
                <code><var>voice</var></code> is a numeric expression in <code>[0&#8212;2]</code>, indicating which of the
                three tone voice channels is used for this sound. (For <code><a href="#--syntax">syntax</a>={pcjr | tandy}</code>)
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                On PCjr and Tandy, Frequencies below 110 Hz are played as 110 Hz.
            </li>
            <li>
                If <code><var>duration</var></code> is zero, any active background sound is stopped and
                the sound queue is emptied.
            </li>
            <li>
                If <code><var>duration</var></code> is zero, <code><var>volume</var></code> and <code><var>voice</var></code> must not be specified.
            </li>
            <li>
                If <code><var>duration</var></code> is less than <code>.022</code> but nonzero, the sound will be played in
                background and continue indefinitely until another sound statement is
                executed. This is also the behaviour for negative <code><var>duration</var></code>.
            </li>
            <li>
                If <code><var>frequency</var></code> equals <code>32767</code> or <code>0</code>, a silence of length <code><var>duration</var></code> is queued.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any argument has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>frequency</var></code> is not in its allowed range, and <code><var>duration</var></code> is not zero:
                <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>duration</var></code> is zero and more than two arguments are specified:
                <samp>Syntax error</samp>.
            </li>
            <li>
                <code><a href="#--syntax">syntax</a>={ pcjr | tandy }</code> is not set and more than two arguments are specified:
                <samp>Syntax error</samp>.
            </li>
            <li>
                <code><var>frequency</var></code> is not in <code>[-32768&#8212;32767]</code>:
                <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>duration</var></code> is not in <code>[-65535&#8212;65535]</code>:
                <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>volume</var></code> is not in <code>[0&#8212;15]</code>:
                <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>voice</var></code> is not in <code>[0&#8212;2]</code>:
                <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="SOUND-switch"><code>SOUND</code> (switch)</h4>
        <code class="flow">
            <b>SOUND</b> {<b>ON</b>|<b>OFF</b>}
        </code>
        <p>
            Switches the external speaker on or off and toggles the availability of advanced sound capabilities on PCjr and Tandy. This includes 3-voice
            sound, noise generation and volume control. Clears the background music queue.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                Only available with <code>syntax={pcjr | tandy}</code>.
            </li>
            <li>
                On PC-BASIC, both the
                internal and the external speaker are emulated through the same sound
                system.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                This statement is used and <code><a href="#--syntax">syntax</a>={ pcjr | tandy }</code> is not set:
                <samp>Syntax error</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="STOP"><code>STOP</code></h4>
        <code class="flow">
            <b>STOP</b>
        </code>
        <p>
            Breaks program execution, prints a <samp>Break</samp>
            message on the console and returns control to the user. Files are not closed.
            It is possible to resume program execution at the next statement using
            <code><a href="#CONT">CONT</a></code>.
        </p>
    </section>
    <hr />

    <section>
        <h4 id="STRIG-switch"><code>STRIG</code> (switch)</h4>
        <code class="flow">
            <b>STRIG</b> {<b>ON</b>|<b>OFF</b>}
        </code>
        <p>
            Has no effect.
        </p>
    </section>
<hr />

    <section>
        <h4 id="STRIG-events"><code>STRIG</code> (event switch)</h4>
        <code class="flow">
            <b>STRIG</b>[ ]<b>(</b><var>button</var><b>)</b> {<b>ON</b>|<b>OFF</b>|<b>STOP</b>}
        </code>
        <p>
            Switches event trapping of the joystick trigger <code><var>button</var></code>
            <code>ON</code> or <code>OFF</code>.
            <code>STRIG (<var>button</var>) STOP</code> suspends event trapping until
            <code>STRIG (<var>button</var>) ON</code> is executed. Up to one event can be triggered during
            suspension, provided that event handling was switched on prior to suspension.
            The event triggered during suspension is handled immediately after the next <code>STRIG (<var>button</var>) ON</code>
            statement.
        </p>
        <div class="scrollable">
            <table>
                <tr>
                    <th><code><var>button</var></code></th>
                    <th>return value</th>
                </tr>
                <tr>
                    <td>0</td>
                    <td>1st joystick 1st trigger</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>2nd joystick 1st trigger</td>
                </tr>
                <tr>
                    <td>4</td>
                    <td>1st joystick 2nd trigger</td>
                </tr>
                <tr>
                    <td>6</td>
                    <td>2nd joystick 2nd trigger</td>
                </tr>
            </table>
        </div>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>button</var></code> is a numeric expression in <code>[0, 2, 4, 6]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>button</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>button</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>button</var></code> is not in <code>[0, 2, 4, 6]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="SWAP"><code>SWAP</code></h4>
        <code class="flow">
            <b>SWAP</b> <var>var_0</var><b>,</b> <var>var_1</var>
        </code>
        <p>
            Exchanges variables <code><var>var_0</var></code> and <code><var>var_1</var></code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                The variables are exchanged by reference. If, for example,
                <code><var>var_0</var></code> is a <code><a href="#FIELD">FIELD</a></code>
                variable and <code><var>var_1</var></code> is not, then
                <code>SWAP</code> will reverse those roles.
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>var_0</var></code> and <code><var>var_1</var></code> are variables or array elements of
                the same type. <code><var>var_1</var></code>  must have been previously defined.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>var_1</var></code>is undefined: <samp>Illegal function call</samp>.
                Note that no error is raised if <code><var>var_0</var></code> is undefined, and that after this error both variables will be defined.
            </li>
            <li>
                The types of <code><var>var_0</var></code> and <code><var>var_1</var></code> are not the same: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="SYSTEM"><code>SYSTEM</code></h4>
        <code class="flow">
            <b>SYSTEM</b>
        </code>
        <p>
            Exits the interpreter.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                <code>SYSTEM</code> quits the PC-BASIC interpreter immediately without further interaction.
                Any unsaved program or data will be lost.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="TERM"><code>TERM</code></h4>
        <code class="flow">
            <b>TERM</b>
        </code>
        <p>
            Load and run the program defined by the <code><a href="#--term">term</a></code> option.
            By default, as on the IBM PCjr, this is a
            built-in serial terminal emulator application.
            This statement is only available with
            <code><a href="#--syntax">syntax</a>={pcjr|tandy}</code>.
        </p>
        <h5>Errors</h5>
        <ul>
            <li>
                If <code><a href="#--term">term</a></code> is not set,
                this statement raises <code>Internal error</code>.
            </li>
            <li>
                If <code><a href="#--syntax">syntax</a></code> is not set to
                <code>pcjr</code> or <code>tandy</code>, this keyword is not present.
                Calling <code>TERM</code> will raise <samp>Syntax error</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="TIME$-statement"><code>TIME$</code> (statement)</h4>
        <code class="flow">
            <b>TIME$ = </b><var>time</var>
        </code>
        <p>
            Sets the current BASIC time to <code><var>time</var></code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                Time is a string expression
                of the form <code><b>"</b><var>HH</var>{<b>:</b>|<b>.</b>}<var>mm</var>{<b>:</b>|<b>.</b>}<var>ss</var><b>"</b></code> where
                <code>0 &lt;= <var>HH</var> &lt; 24</code>, <code>0 &lt;= <var>mm</var> &lt; 60</code> and <code>0 &lt;= <var>ss</var> &lt; 60</code>.
                Each position may have one or two characters.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                PC-BASIC stores an offset to the system time and uses this for future
                calls to <code><a href="TIME$-function">TIME$</a></code> and
                <code><a href="DATE$-function">DATE$</a></code> functions in the same interpreter session.
                The system time is not changed, unlike GW-BASIC under MS-DOS.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>time</var></code> has a numeric value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>time</var></code> is not of the correct form: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="TIMER-event"><code>TIMER</code> (statement)</h4>
        <code class="flow">
            <b>TIMER</b> {<b>ON</b>|<b>OFF</b>|<b>STOP</b>}
        </code>
        <ul>
            <li>
                <code>ON</code>: enables <code><a href="#ON-event">ON TIMER</a></code> event
                trapping of the timer clock.
            </li>
            <li>
                <code>OFF</code>: disables trapping.
            </li>
            <li>
                <code>STOP</code>: halts trapping until <code>TIMER ON</code> is used.
                Events that occur while trapping is halted will trigger immediately when
                trapping is re-enabled.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="TRON"><code>TRON</code> and <code>TROFF</code></h4>
        <code class="flow">
            {<b>TRON</b>|<b>TROFF</b>}
        </code>
        <p>
            Turns line number tracing on or off. If line number tracing is on, BASIC prints
            a tag <samp>[100]</samp> to the console when program line <code>100</code> is executed, and so forth.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
               Tracing is turned off by the <code><a href="#NEW">NEW</a></code> and
               <code><a href="#LOAD">LOAD</a></code> statements.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="UNLOCK"><code>UNLOCK</code></h4>
        <code class="flow">
            <b>UNLOCK</b> [<b>#</b>] <var>file_number</var> [<b>,</b> <var>record_0</var>]
        </code>
        <code class="flow">
            <b>UNLOCK</b> [<b>#</b>] <var>file_number</var><b>,</b> [<var>record_0</var>] <b>TO</b> <var>record_1</var>
        </code>
        <p>
            Unlocks a file or part of it that has previously been locked with <code>LOCK</code>.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_number</var></code> is a numeric expression in <code>[0&#8212;255]</code>.
            </li>
            <li>
                <code><var>record_0</var></code> and <code><var>record_1</var></code> are numeric expressions in <code>[1&#8212;2^25-2]</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any parameter has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_number</var></code> is not an open file: <samp>Bad file number</samp>.
            </li>
            <li>
                If <code><var>file_number</var></code> is open for <code>RANDOM</code>,
                <code><a href="#LOCK">LOCK</a></code> and <code><a href="#UNLOCK">UNLOCK</a></code>
                statements must match in terms of <code><var>record_0</var></code> and
                <code><var>record_1</var></code>. An non-matching <code>UNLOCK</code> will raise
                <samp>Permission denied</samp>.
            </li>
            <li>
                <code><var>record_0</var></code> or <code><var>record_1</var></code> is not in <code>[1&#8212;2^25-2]</code>: <samp>Bad record number</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="VIEW"><code>VIEW</code></h4>
        <code class="flow">
            <b>VIEW</b> [[<b>SCREEN</b>] <b>(</b><var>x0</var><b>,</b> <var>y0</var><b>)-(</b><var>x1</var><b>,</b> <var>y1</var><b>)</b> [<b>,</b> [<var>fill</var>] [<b>,</b> <var>border</var>]]]
        </code>
        <p>
            Defines a graphics viewport. Graphics drawn outside the viewport will
            not be shown. <code>(<var>x0</var>, <var>y0</var>)</code>, <code>(<var>x1</var>, <var>y1</var>)</code> are absolute screen coordinates of two
            opposing corners of the area.
        </p>
        <p>
            Unless <code>SCREEN</code> is specified, after a <code>VIEW</code> statement the coordinate
            system is shifted such that <code>(0, 0)</code> becomes the top left coordinate of the viewport.
            If <code>VIEW</code> is called without arguments, the viewport is reset to the whole
            screen.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>fill</var></code> is an attribute. The viewport will be
                filled with this attribute.
            </li>
            <li>
                <code><var>border</var></code> is an attribute. A border will be drawn
                just outside the viewport with this attribute.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the parameters has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                Any of the coordinates is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                Any of the coordinate pairs is outside the physical screen: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="VIEW-PRINT"><code>VIEW PRINT</code></h4>
        <code class="flow">
            <b>VIEW PRINT</b> <var>top_row</var> <b>TO</b> <var>bottom_row</var>
        </code>
        <p>
            Defines the text scrolling area of the screen. <code><a href="#LOCATE">LOCATE</a></code> statements,
            cursor movement and scrolling will be limited to the scrolling area.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>top_row</var></code> and <code><var>bottom_row</var></code> are
                numeric expressions in  <code>[1&#8212;24]</code>.
            </li>
        </ul>
        <h5>Notes</h5>
        <ul>
            <li>
                If <code><a href="#--syntax">syntax</a>={pcjr | tandy}</code> and
                <code><a href="#KEY-list">KEY OFF</a></code> is set, <code><var>bottom_row</var></code> may be 25.
                Otherwise, screen row 25 cannot be part of the
                scrolling area.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>top_row</var></code> or <code><var>bottom_row</var></code> is not in <code>[1&#8212;24]</code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="WAIT"><code>WAIT</code></h4>
        <code class="flow">
            <b>WAIT</b> <var>port</var><b>,</b> <var>and_mask</var> [<b>,</b> <var>xor_mask</var>]
        </code>
        <p>
            Waits for the value of <code>(<a href="#INP">INP</a>(<var>port</var>)
            <a href="#boolean-operators">XOR</a> <var>xor_mask</var>) <a href="#boolean-operators">AND</a>
            <var>and_mask</var></code> to become nonzero.
            Event handling is suspended until <code>WAIT</code> returns.
            If <code><var>xor_mask</var></code> is not specified, it defaults to <code>0</code>.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                A limited number of machine ports are emulated in PC-BASIC.
                See <code><a href="#INP">INP</a></code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any parameter has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>port</var></code> is not in <code>[-32768&#8212;65535]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>and_mask</var></code> or <code><var>xor_mask</var></code> are not in <code>[0&#8212;255]</code>: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="WEND"><code>WEND</code></h4>
        <code class="flow">
            <b>WEND</b>
        </code>
        <p>
            Iterates a <code>WHILE&#8212;WEND</code> loop: jumps to the matching
            <code><a href="#WHILE">WHILE</a></code> statement, where its
            condition can be checked.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
               <code>WHILE&#8212;WEND</code> loops can be nested. <code>WEND</code> jumps to the most recent <code>WHILE</code>
                statement that has not been closed by another <code>WEND</code>.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                All previous <code>WHILE</code> statements have been closed by another
                <code>WEND</code> or no <code>WHILE</code> statement has been executed before:
                <samp>WEND without WHILE</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="WHILE"><code>WHILE</code></h4>
        <code class="flow">
            <b>WHILE</b> <var>expr</var>
        </code>
        <p>
            Initiates a <code>WHILE&#8212;WEND</code> loop.
            If <code><var>expr</var></code> evaluates to zero, <code>WHILE</code> jumps
            to the statement immediately after the matching
            <code><a href="#WEND">WEND</a></code>. If not, execution continues.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
            <code><var>expr</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                No matching <code>WEND</code> is found: <samp>WHILE without WEND</samp>.
            </li>
            <li>
                <code><var>expr</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="WIDTH"><code>WIDTH</code> (console)</h4>
        <code class="flow">
            <b>WIDTH</b> <var>num_columns</var> [<b>,</b> [<var>num_rows</var>] [<b>,</b>]]
        </code>
        <p>
            Sets the screen width to 20, 40 or 80 columns.
        </p>
        <h5>Notes</h5>
        <ul>
            <li>
                When changing screen width in graphics mode, the video mode is changed.
                The following changes occur:<br/>
                <code>SCREEN 1</code> (40)  &#8596;  <code>SCREEN 2</code> (80)<br/>
                <code>SCREEN 7</code> (40)  &#8596;  <code>SCREEN 8</code> (80)<br/>
                <code>SCREEN 7</code> (40)  &#8592;  <code>SCREEN 9</code> (80)<br/>
            </li>
            <li>
                Screen width value 20 is only allowed on Tandy and PCjr. Changing to this width
                changes to <code>SCREEN 3</code>. Additionally, the following changes occur:<br/>
                <code>SCREEN 3</code> (20)  &#8594;  <code>SCREEN 1</code> (40)<br/>
                <code>SCREEN 3</code> (20)  &#8594;  <code>SCREEN 2</code> (80)<br/>
                <code>SCREEN 4</code> (40)  &#8594;  <code>SCREEN 2</code> (80)<br/>
                <code>SCREEN 5</code> (40)  &#8596;  <code>SCREEN 6</code> (80)<br/>
            </li>
        </ul>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>num_columns</var></code> is either a literal <code>20</code>,
                <code>40</code> or <code>80</code> or a numeric expression in parentheses.
                The trailing comma is optional and has no effect.
            </li>
            <li>
                <code><var>num_rows</var></code> is optional and must equal 25. If
                <code><a href="#--syntax">syntax</a>={pcjr | tandy}</code> is set,
                <code><var>num_rows</var></code>
                may be in <code>[0&#8212;25]</code> but its value is ignored.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>num_columns</var></code> is a string expression: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>num_columns</var></code> is not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>num_columns</var></code> is not in <code>[0&#8212;255]</code>: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>num_columns</var></code> is not a literal and not bracketed: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>num_rows</var></code> is not in its accepted range: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="WIDTH-files"><code>WIDTH</code> (devices and files)</h4>
        <code class="flow">
            <b>WIDTH</b> {<b>#</b><var>file_num</var><b>,</b>|<var>device_name</var><b>,</b>|<b>LPRINT</b>} <var>num_columns</var>
        </code>
        <p>
            Sets the line width for a file or a device.
            When a write operation passes beyond the column width, a <code><i>CR LF</i></code> sequence is
            inserted.
        </p>
        <p>
            If a device is specified, it does not need to have a file open to it; the width setting will
            be the default width next time a file is opened to that device.
        </p>
        <p>
            If <code><var>device_name</var></code> is <code>"LPT1:"</code> or <code>LPRINT</code>
            is specified, the device width setting affects <code><a href="#LPRINT">LPRINT</a></code>
            and <code><a href="#LLIST">LLIST</a></code>.
        </p>
        <p>
            If <code><var>device_name</var></code> is <code>"SCRN:"</code>, <code>"KYBD:"</code>, or omitted, the screen width is changed.
            In this case, <code><var>num_columns</var></code> must be one of 20, 40 or 80.
            See the notes at <code><a href="#WIDTH">WIDTH</a></code> (console) for side effects.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> is a numeric expression which is the number of an open file.
            </li>
            <li>
                <code><var>device_name</var></code> is a string expression that is one of
                <code>"KYBD:"</code>, <code>"SCRN:"</code>, <code>"LPT1:"</code>, <code>"LPT2:"</code>,
                <code>"LPT3:"</code>, <code>"COM1:"</code>, <code>"COM2:"</code>, <code>"CAS1:"</code>
            </li>
            <li>
                <code><var>num_columns</var></code> is a numeric expression.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>device_name</var></code> is not one of the allowed devices: <samp>Bad file name</samp>.
            </li>
            <li>
                <code><var>device_name</var></code> is <code>"SCRN:"</code>, <code>"KYBD:"</code>
                and <code><var>num_columns</var></code> is not 20, 40 or
                80: <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> or <code><var>num_columns</var></code> are strings: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> or <code><var>num_columns</var></code> are not in <code>[-32768&#8212;32767]</code>: <samp>Overflow</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> or <code><var>num_columns</var></code> are not in <code>[0&#8212;255]</code>:    <samp>Illegal function call</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is not an open file: <samp>Bad file mode</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="WINDOW"><code>WINDOW</code></h4>
        <code class="flow">
            <b>WINDOW</b> [[<b>SCREEN</b>] <b>(</b><var>x0</var><b>,</b> <var>y0</var><b>)-(</b><var>x1</var><b>,</b> <var>y1</var><b>)</b>]
        </code>
        <p>
            Define logical coordinates for the viewport.
            If <code>SCREEN</code> is not specified,
            the bottom left of the screen is mapped to the lower coordinates;
            the top right of the screen is mapped to the higher coordinates.
            If <code>SCREEN</code> is specified,
            the top left of the screen is mapped to the lower coordinates;
            the bottom right of the screen is mapped to the higher coordinates.
        </p>
        <p>
            If <code>WINDOW</code> is called without arguments, the logical coordinates are
            reset to the viewport coordinates.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>x0</var></code>, <code><var>y0</var></code>, <code><var>x1</var></code>, <code><var>y1</var></code> are numeric expressions.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                Any of the coordinates have a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>x0</var> = <var>x1</var></code> or <code><var>y0</var> = <var>y1</var></code>: <samp>Illegal function call</samp>.
            </li>
        </ul>
    </section>
<hr />

    <section>
        <h4 id="WRITE"><code>WRITE</code></h4>
        <code class="flow">
            <b>WRITE</b> [<b>#</b> <var>file_num</var><b>,</b>] [<var>expr_0</var> [{<b>,</b>|<b>;</b>} <var>expr_1</var>] ... ]
        </code>
        <p>
            Writes values to a file or the screen in machine-readable form. Values are
            separated by commas and the line is ended with a <code><i>CR LF</i></code> sequence. Strings are
            delimited by double quotes <code>"</code>. No padding spaces are inserted.
        </p>
        <p>
            When writing to the screen, the same control characters are recognised as for the
            <code><a href="#PRINT">PRINT</a></code> statement.
        </p>
        <h5>Parameters</h5>
        <ul>
            <li>
                <code><var>expr_0</var>, <var>expr_1</var>, ...</code> are expressions whose value is to be printed.
            </li>
        </ul>
        <h5>Errors</h5>
        <ul>
            <li>
                <code><var>file_num</var></code> has a string value: <samp>Type mismatch</samp>.
            </li>
            <li>
                <code><var>file_num</var></code> is open for <code>INPUT</code>: <samp>Bad file mode</samp>.
            </li>
        </ul>
    </section>
<hr />

</section>
<hr />

<section>
    <h3 id="errors-messages">Errors and Messages</h3>
    <h4 id="errors">Errors</h4>
    <div class="scrollable">
        <table>
            <tr>
                <td><code>1</code></td>
                <td>
                    <samp><b>NEXT without FOR</b></samp>
                    <p>
                        A <a href="#NEXT"><code>NEXT</code></a> statement has been encountered
                        for which no matching <a href="#FOR"><code>FOR</code></a> can be found.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>2</code></td>
                <td>
                    <samp><b>Syntax error</b></samp>
                    <p>
                        The BASIC syntax is incorrect. A statement or expression
                        has been mistyped or called in one of many incorrect ways. This
                        error is also raised on a <a href="#DATA"><code>DATA</code></a>
                        line if a <a href="#READ"><code>READ</code></a>
                        statement encounters a data entry of an incorrect format.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>3</code></td>
                <td>
                    <samp><b>RETURN without GOSUB</b></samp>
                    <p>
                        A <a href="#RETURN"><code>RETURN</code></a> statement has been encountered
                        for which no <a href="#GOSUB"><code>GOSUB</code></a> call has been made.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>4</code></td>
                <td>
                    <samp><b>Out of DATA</b></samp>
                    <p>
                        A <a href="#READ"><code>READ</code></a> statement is attempting to read more data entries than can be found from the
                        current <a href="#DATA"><code>DATA</code></a> location onward.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>5</code></td>
                <td>
                    <samp><b>Illegal function call</b></samp>
                    <p>
                        A statement, function or operator has been called with parameters outside the accepted range. This error is also raised for a
                        large variety of other conditions &ndash; check the reference for the statement or function called.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>6</code></td>
                <td>
                    <samp><b>Overflow</b></samp>
                    <p>
                        A numeric expression result or intermediate value is too large for the required number format.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>7</code></td>
                <td>
                    <samp><b>Out of memory</b></samp>
                    <p>
                        There is not enough free BASIC memory to complete the operation.
                        Too much memory is consumed by the program; variables, arrays and strings,
                        or execution stacks for loops, subroutines or
                        user-defined functions.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>8</code></td>
                <td>
                    <samp><b>Undefined line number</b></samp>
                    <p>
                        A reference is made to a line number that does not exist in the program.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>9</code></td>
                <td>
                    <samp><b>Subscript out of range</b></samp>
                    <p>
                        An array index (subscript) is used that is outside the range
                        reserved for that array by the <a href="#DIM"><code>DIM</code></a>
                        statement.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>10</code></td>
                <td>
                    <samp><b>Duplicate Definition</b></samp>
                    <p>
                        A <a href="#DIM"><code>DIM</code></a> statement is
                        used on an array that has been dimensioned before (either implicitly or explicitly) or
                        <a href="#OPTION-BASE"><code>OPTION BASE</code></a> is called in a way that conflicts with
                        an earlier implicit or explicit definition of the starting index.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>11</code></td>
                <td>
                    <samp><b>Division by zero</b></samp>
                    <p>
                        An attempt is made to divide a number by zero or by a number that is
                        too small to distinguish from zero within the number format's precision.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>12</code></td>
                <td>
                    <samp><b>Illegal direct</b></samp>
                    <p>
                        A <a href="#DEF_FN"><code>DEF FN</code></a> statement is being used in direct
                        mode.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>13</code></td>
                <td>
                    <samp><b>Type mismatch</b></samp>
                    <p>
                        The expression used is of a type that cannot be converted to
                        the required type for the function or statement. Most commonly,
                        this is raised if a string argument is supplied to a statement or
                        function that expects a number, or vice versa.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>14</code></td>
                <td>
                    <samp><b>Out of string space</b></samp>
                    <p>
                        There is not enough free BASIC memory to store the
                        string variable.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>15</code></td>
                <td>
                    <samp><b>String too long</b></samp>
                    <p>
                        A string expression result or intermediate value is longer than 255
                        characters.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>16</code></td>
                <td>
                    <samp><b>String formula too complex</b></samp>
                </td>
            </tr>
            <tr>
                <td><code>17</code></td>
                <td>
                    <samp><b>Can't continue</b></samp>
                    <p>
                        The <a href="#CONT"><code>CONT</code></a> statement is used in
                        circumstances where continuing program execution is not possible.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>18</code></td>
                <td>
                    <samp><b>Undefined user function</b></samp>
                    <p>
                        The <a href="#FN"><code>FN</code></a> function is called
                        with a function name for which no definition was made by
                        a <a href="#DEF-FN"><code>DEF FN</code></a> statement.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>19</code></td>
                <td>
                    <samp><b>No RESUME</b></samp>
                    <p>
                        The program terminates inside an error trapping
                        routine that has not been closed with <a href="#RESUME"><code>RESUME</code></a> or
                        <a href="#END"><code>END</code></a>.
                    </p>
                </td>
                </tr>
            <tr>
                <td><code>20</code></td>
                <td>
                    <samp><b>RESUME without error</b></samp>
                    <p>
                        A <a href="#RESUME"><code>RESUME</code></a>
                        statement is encountered while the program is not executing
                        an error trapping routine.
                </td>
            </tr>
            <tr><td><code>21</code></td><td><i>unused</i></td></tr>
            <tr>
                <td><code>22</code></td>
                <td>
                    <samp><b>Missing operand</b></samp>
                    <p>
                        An operator expression misses an operand or a function or statement
                        is not supplied with sufficient parameters.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>23</code></td>
                <td>
                    <samp><b>Line buffer overflow</b></samp>
                    <p>
                        An <a href="#INPUT"><code>INPUT</code></a> or
                        <a href="#LINE-INPUT"><code>LINE INPUT</code></a> statement encountered
                        an input string longer than 255 characters or the plain-text program file
                        being loaded by <a href="#LOAD"><code>LOAD</code></a>, <a href="#CHAIN"><code>CHAIN</code></a> or <a href="#MERGE"><code>MERGE</code></a> contains a line with more than 255 characters.
                        Attempting to load a text file that has <code><i>LF</i></code> rather than <code><i>CR LF</i></code> line endings may cause this error.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>24</code></td>
                <td>
                    <samp><b>Device Timeout</b></samp>
                    <p>
                        The handshake has failed on a serial device or a tape device
                        has reached the end of tape.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>25</code></td>
                <td><samp><b>Device Fault</b></samp></td>
            </tr>
            <tr>
                <td><code>26</code></td>
                <td>
                    <samp><b>FOR without NEXT</b></samp>
                    <p>
                        A <a href="#FOR"><code>FOR</code></a> statement has been encountered for
                        which no matching <a href="#NEXT"><code>NEXT</code></a>
                        statement can be found.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>27</code></td>
                <td>
                    <samp><b>Out of paper</b></samp>
                    <p>
                        An attempt is made to write to a printer which
                        is out of paper or to another parallel device which has raised
                        an out-of-paper condition.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>28</code></td>
                <td><i>unused</i></td>
            </tr>
            <tr>
                <td><code>29</code></td>
                <td>
                    <samp><b>WHILE without WEND</b></samp>
                    <p>
                        A <a href="#WHILE"><code>WHILE</code></a> statement has been encountered for
                        which no matching <a href="#WEND"><code>WEND</code></a>
                        statement can be found.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>30</code></td>
                <td>
                    <samp><b>WEND without WHILE</b></samp>
                    <p>
                        A <a href="#WEND"><code>WEND</code></a> statement has been encountered for
                        which no matching <a href="#WHILE"><code>WHILE</code></a>
                        statement can be found.
                    </p>
                </td>
            </tr>
            <tr><td><code>31&#8212;49</code></td><td><i>unused</i></td></tr>
            <tr>
                <td><code>50</code></td>
                <td>
                    <samp><b>FIELD overflow</b></samp>
                    <p>
                        An attempt is made to read, write, or define a <a href="#FIELD"><code>FIELD</code></a>
                        variable beyond the length of the
                        random-access file buffer.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>51</code></td>
                <td>
                    <samp><b>Internal error</b></samp>
                    <p>
                        The <a href="#TERM"><code>TERM</code></a> statement is executed
                        but no terminal manager program has been defined.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>52</code></td>
                <td>
                    <samp><b>Bad file number</b></samp>
                    <p>
                        A file number is accessed to which no file is open, or the file number used in an <a href="#OPEN"><code>OPEN</code></a> statement
                        is outside the range of allowable file numbers, or (confusingly) the file specification is empty, malformed or contains illegal characters.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>53</code></td>
                <td>
                    <samp><b>File not found</b></samp>
                    <p>
                        A named file on a disk device cannot be found.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>54</code></td>
                <td>
                    <samp><b>Bad file mode</b></samp>
                    <p>
                        The requested file mode in an <a href="#OPEN"><code>OPEN</code></a> statement
                        does not exist or is unsupported for the given device, or the file function called is not
                        supported for this device, or the function or statement called requires a file opened for
                        <code>RANDOM</code> and the file is not.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>55</code></td>
                <td>
                    <samp><b>File already open</b></samp>
                    <p>
                        An attempt is made to open a file to a file number that is already in use;
                        or an attempt is made to open a file for <code>OUTPUT</code> or <code>APPEND</code>  on a serial, disk or cassette device
                        when a file (or, on a disk device, a file with the same name) is already open for <code>OUTPUT</code> or <code>APPEND</code> on that device;
                        or a <a href="#KILL"><code>KILL</code></a> or <a href="#NAME"><code>NAME</code></a> statement is executed on a disk file
                        when a file with the same name is open on the same device.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>56</code></td>
                <td><i>unused</i></td>
            </tr>
            <tr>
                <td><code>57</code></td>
                <td>
                    <samp><b>Device I/O error</b></samp>
                    <p>
                        An I/O error has occured during input/output to a device. This includes faming errors,
                        CRC check failures and unexpected end-of-tape on cassette devices.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>58</code></td>
                <td>
                    <samp><b>File already exists</b></samp>
                    <p>
                        The proposed new name of a disk file in a <a href="#NAME"><code>NAME</code></a> statement
                        is already in use.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>59&#8212;60</code></td>
                <td><i>unused</i></td>
            </tr>
            <tr>
                <td><code>61</code></td>
                <td>
                    <samp><b>Disk full</b></samp>
                    <p>
                        There is insufficient free space on the disk device to complete the operation.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>62</code></td>
                <td>
                    <samp><b>Input past end</b></samp>
                    <p>
                        An attempt is made to retrieve input from a file that
                        has passed its end of file.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>63</code></td>
                <td>
                    <samp><b>Bad record number</b></samp>
                    <p>
                        A random-access file record number is referenced that is outside
                        the permitted range.
                    </p>
                </td>
            </tr>
            <tr><td><code>64</code></td>
                <td>
                    <samp><b>Bad file name</b></samp>
                    <p>
                        The file name or other device parameter string in a file specification
                        is malformed or contains illegal characters.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>65</code></td>
                <td><i>unused</i></td>
            </tr>
            <tr>
                <td><code>66</code></td>
                <td>
                    <samp><b>Direct statement in file</b></samp>
                    <p>
                        A line with no line number is encountered in a plain-text program file.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>67</code></td>
                <td><samp><b>Too many files</b></samp></td>
            </tr>
            <tr>
                <td><code>68</code></td>
                <td>
                    <samp><b>Device Unavailable</b></samp>
                    <p>
                        An attempt is made to access a device that does not exist or is not enabled.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>69</code></td>
                <td>
                    <samp><b>Communication buffer overflow</b></samp>
                    <p>
                        A serial device is receiving more data than fits in its buffer.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>70</code></td>
                <td>
                    <samp><b>Permission Denied</b></samp>
                    <p>
                        The requested access to a file is not granted due to
                        <a href="#LOCK"><code>LOCK</code></a> restrictions,
                        operating system locking, or insufficient operating system file permissions.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>71</code></td>
                <td>
                    <samp><b>Disk not Ready</b></samp>
                    <p>
                        The disk device is not ready for access. For example, there is no diskette in
                        a floppy drive or the drive lock is open.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>72</code></td>
                <td><samp><b>Disk media error</b></samp></td>
            </tr>
            <tr>
                <td><code>73</code></td>
                <td><samp><b>Advanced Feature</b></samp></td>
            </tr>
            <tr>
                <td><code>74</code></td>
                <td>
                    <samp><b>Rename across disks</b></samp>
                    <p>
                        An attempt is made to use the <a href="#NAME"><code>NAME</code></a>
                        statement to move a file from one disk device to another.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>75</code></td>
                <td>
                    <samp><b>Path/File access error</b></samp>
                    <p>
                        An attempt is made to create a directory that already exists
                        or to remove a directory that is not empty.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>76</code></td>
                <td>
                    <samp><b>Path not found</b></samp>
                    <p>
                        An <a href="#OPEN"><code>OPEN</code></a>,
                         <a href="#MKDIR"><code>MKDIR</code></a>,
                        <a href="#RMDIR"><code>RMDIR</code></a>, or
                        <a href="#CHDIR"><code>CHDIR</code></a> statement is
                        executed referring to a (parent) path that does not exist
                        on the disk device.
                    </p>
                </td>
            </tr>
            <tr>
                <td><code>77</code></td>
                <td><samp><b>Deadlock</b></samp></td>
            </tr>
        </table>
    </div>
    <p>
        Any error code that does not have a message associated to it will generate
        the message <samp><b>Unprintable error</b></samp>.
    </p>
    <p>
        If an error occurs in direct mode, the error message is printed as above.
        If the error occurs in a program, the message is supplemented with the
        line number in which the error occurred. For example,
        <samp class="block">Illegal function call in 100</samp>
        indicates that the illegal function call took place in line number <code>100</code>.
    </p>
    <p>
        If a <samp>Syntax error</samp> occurs during program execution,
        the error message is followed by a listing of the program line
        in which the error occurred, wth the cursor positioned at the location
        where the error was raised.
    </p>
    <p>
        A <samp>Division by zero</samp> error or, in a floating point calculation, an <samp>Overflow</samp>,
        will not interrupt execution unless it occurs
        within an error handling routine. The error message will be printed on the console
        and the result of the offending calculation will be taken to be the maximum
        value that fits in the appropriate floating-point variable. <samp>Overflow</samp>
        in an integer calculation will always interrupt execution like other errors.
    </p>
    <h4 id="other-messages">Other messages</h4>
    <dl>
        <dt>
            <samp>Break</samp>
        </td>
        <dd>
            Execution of a compound statement or program has been interrupted by
            a <a href="#CONT"><code>CONT</code></a> statement or by a user
            keyboard interrupt (such as <kbd>Ctrl</kbd>+<kbd>Break</kbd>). If the
            interrupt happens in a program, the <samp>Break</samp> message will be
            supplemented with the line number in which the interrupt occurred.
        </dd>
        <dt>
            <samp>?Redo from start</samp>
        </dt>
        <dd>
            The input provided on the console for an <a href="#INPUT"><code>INPUT</code></a>
            statement does not match the expected format. The number or type of
            inputs is not correct. Re-enter all inputs.
        </dd>
        <dt>
            <samp>Undefined line <var>ref_num</var> in <var>line_num</var></samp>
        </dt>
        <dd>
            The <a href="#RENUM"><code>RENUM</code></a> statement encountered
            a reference to the line number <code><var>ref_num</var></code>
            which is not defined in the program. The reference occurs on line number
            <code><var>line_num</var></code>.
            The undefined line number reference will not be renumbered.
        </dd>
        <dt>
            <samp><var>filename</var> Found.</samp>
        </dt>
        <dd>
            A file matching the requested specification has been found on the
            cassette device. This message only occurs in direct mode.
        </dd>
        <dt>
            <samp><var>filename</var> Skipped.</samp>
        </dt>
        <dd>
            A file not matching the requested specification has been encountered on the
            cassette device. This message only occurs in direct mode.
        </dd>
    </dl>

</section>
<hr />

</article>