-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.html
More file actions
2043 lines (1774 loc) · 158 KB
/
Copy pathfunctions.html
File metadata and controls
2043 lines (1774 loc) · 158 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Function Reference — macau</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
html { scroll-behavior: smooth; }
pre { font-size: 1rem; }
[id] { scroll-margin-top: 4rem; }
code { font-size: 1rem; }
.fn { margin-bottom: 2rem; border-bottom: 1px solid #f3f4f6; padding-bottom: 1.5rem; }
.fn:last-child { border-bottom: none; }
.fn h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; font-family: ui-monospace, monospace; color: #111827; }
.fn .desc { color: #6b7280; font-size: 1rem; margin-bottom: 0.75rem; }
.fn .sig { font-family: monospace; font-size: 1rem; background: #f3f4f6; display: inline-block; padding: 2px 8px; border-radius: 4px; margin-bottom: 0.5rem; color: #111827; }
</style>
</head>
<body class="bg-gray-50 text-gray-900">
<nav class="bg-gray-900 text-white sticky top-0 z-50 shadow-lg">
<div class="max-w-[72rem] mx-auto px-8 py-3 flex items-center justify-between">
<a href="index.html" class="text-2xl font-bold tracking-tight hover:text-gray-400">macau</a>
<div class="flex gap-6 text-base">
<a href="index.html" class="hover:text-gray-400 transition">Home</a>
<a href="language.html" class="hover:text-gray-400 transition">Language</a>
<a href="functions.html" class="text-gray-400 font-medium">Functions</a>
<a href="https://github.com/AdrianSimionov/macau" target="_blank" rel="noopener noreferrer" class="hover:text-gray-400 transition">GitHub</a>
</div>
</div>
</nav>
<div class="max-w-[72rem] mx-auto px-8 py-10 flex gap-8">
<!-- Sidebar toggle (mobile) -->
<button onclick="document.getElementById('sidebar').classList.toggle('hidden');document.getElementById('sidebar').classList.toggle('lg:block')" class="lg:hidden fixed bottom-4 right-4 z-50 bg-gray-800 text-white w-12 h-12 rounded-full shadow-lg flex items-center justify-center text-xl hover:bg-gray-900">☰</button>
<!-- Sidebar -->
<aside id="sidebar" class="hidden lg:block w-80 flex-shrink-0">
<div class="sticky top-16 text-sm space-y-1 bg-white rounded-lg border border-gray-200 p-2 shadow-sm max-h-[calc(100vh-5rem)] overflow-y-auto">
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 px-3 pt-1">String</div>
<a href="#StringLen" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringLen</a>
<a href="#StringMid" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringMid</a>
<a href="#StringLeft" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringLeft</a>
<a href="#StringRight" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringRight</a>
<a href="#StringUpper" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringUpper</a>
<a href="#StringLower" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringLower</a>
<a href="#StringReplace" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringReplace</a>
<a href="#StringInStr" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringInStr</a>
<a href="#StringSplit" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringSplit</a>
<a href="#StringStripWS" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringStripWS</a>
<a href="#StringTrimLeft" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringTrimLeft</a>
<a href="#StringTrimRight" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringTrimRight</a>
<a href="#StringCompare" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringCompare</a>
<a href="#StringReverse" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringReverse</a>
<a href="#StringFormat" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringFormat</a>
<a href="#StringRegExp" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringRegExp</a>
<a href="#StringRegExpReplace" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringRegExpReplace</a>
<a href="#StringIsInt" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringIs*</a>
<a href="#StringAddCR" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringAddCR</a>
<a href="#StringStripCR" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringStripCR</a>
<a href="#StringToASCIIArray" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringToASCIIArray</a>
<a href="#StringFromASCIIArray" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">StringFromASCIIArray</a>
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 mt-3 px-3 pt-1 border-t border-gray-100">Math</div>
<a href="#Abs" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Abs</a>
<a href="#Trig" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Cos</a>
<a href="#Sin" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Sin</a>
<a href="#Tan" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Tan</a>
<a href="#ATrig" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">ACos</a>
<a href="#ASin" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">ASin</a>
<a href="#ATan" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">ATan</a>
<a href="#Exp" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Exp</a>
<a href="#Log" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Log</a>
<a href="#Floor" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Floor</a>
<a href="#Ceiling" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Ceiling</a>
<a href="#Round" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Round</a>
<a href="#Int" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Int</a>
<a href="#Sqrt" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Sqrt</a>
<a href="#Random" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Random</a>
<a href="#SRandom" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">SRandom</a>
<a href="#Number" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Number</a>
<a href="#Mod" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Mod</a>
<a href="#Bitwise" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BitAND</a>
<a href="#BitOR" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BitOR</a>
<a href="#BitXOR" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BitXOR</a>
<a href="#BitNOT" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BitNOT</a>
<a href="#BitShift" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BitShift</a>
<a href="#BitRotate" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BitRotate</a>
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 mt-3 px-3 pt-1 border-t border-gray-100">Type</div>
<a href="#IsArray" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IsArray</a>
<a href="#IsInt" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IsInt</a>
<a href="#IsFloat" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IsFloat</a>
<a href="#IsString" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IsString</a>
<a href="#IsNumber" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IsNumber</a>
<a href="#IsBool" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IsBool</a>
<a href="#IsBinary" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IsBinary</a>
<a href="#IsMap" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IsMap</a>
<a href="#IsKeyword" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IsKeyword</a>
<a href="#IsDeclared" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IsDeclared</a>
<a href="#VarGetType" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">VarGetType</a>
<a href="#Asc" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Asc</a>
<a href="#AscW" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">AscW</a>
<a href="#Chr" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Chr</a>
<a href="#ChrW" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">ChrW</a>
<a href="#String" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">String</a>
<a href="#Hex" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Hex</a>
<a href="#Dec" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Dec</a>
<a href="#UBound" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">UBound</a>
<a href="#Eval" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Eval</a>
<a href="#Assign" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Assign</a>
<a href="#Execute" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Execute</a>
<a href="#Call" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Call</a>
<a href="#SetError" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">SetError</a>
<a href="#SetExtended" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">SetExtended</a>
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 mt-3 px-3 pt-1 border-t border-gray-100">Map</div>
<a href="#MapAppend" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MapAppend</a>
<a href="#MapExists" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MapExists</a>
<a href="#MapKeys" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MapKeys</a>
<a href="#MapRemove" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MapRemove</a>
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 mt-3 px-3 pt-1 border-t border-gray-100">File I/O</div>
<a href="#FileOpen" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileOpen</a>
<a href="#FileClose" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileClose</a>
<a href="#FileRead" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileRead</a>
<a href="#FileReadLine" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileReadLine</a>
<a href="#FileWrite" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileWrite</a>
<a href="#FileWriteLine" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileWriteLine</a>
<a href="#FileReadToArray" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileReadToArray</a>
<a href="#FileExists" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileExists</a>
<a href="#FileDelete" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileDelete</a>
<a href="#FileCopy" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileCopy</a>
<a href="#FileMove" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileMove</a>
<a href="#FileGetSize" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileGetSize</a>
<a href="#FileGetTime" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileGetTime</a>
<a href="#FileGetAttrib" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileGetAttrib</a>
<a href="#DirCreate" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">DirCreate</a>
<a href="#DirRemove" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">DirRemove</a>
<a href="#DirCopy" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">DirCopy</a>
<a href="#DirMove" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">DirMove</a>
<a href="#DirGetSize" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">DirGetSize</a>
<a href="#FileFindFirstFile" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileFindFirstFile</a>
<a href="#FileFindNextFile" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileFindNextFile</a>
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 mt-3 px-3 pt-1 border-t border-gray-100">INI</div>
<a href="#IniRead" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IniRead</a>
<a href="#IniWrite" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IniWrite</a>
<a href="#IniDelete" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IniDelete</a>
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 mt-3 px-3 pt-1 border-t border-gray-100">Process</div>
<a href="#Run" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Run</a>
<a href="#RunWait" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">RunWait</a>
<a href="#ProcessClose" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">ProcessClose</a>
<a href="#ProcessExists" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">ProcessExists</a>
<a href="#ProcessList" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">ProcessList</a>
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 mt-3 px-3 pt-1 border-t border-gray-100">Window</div>
<a href="#WinList" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">WinList</a>
<a href="#WinExists" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">WinExists</a>
<a href="#WinActive" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">WinActive</a>
<a href="#WinActivate" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">WinActivate</a>
<a href="#WinMove" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">WinMove</a>
<a href="#WinClose" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">WinClose</a>
<a href="#WinKill" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">WinKill</a>
<a href="#WinWait" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">WinWait</a>
<a href="#WinWaitActive" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">WinWaitActive</a>
<a href="#WinWaitClose" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">WinWaitClose</a>
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 mt-3 px-3 pt-1 border-t border-gray-100">Mouse</div>
<a href="#MouseGetPos" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MouseGetPos</a>
<a href="#MouseMove" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MouseMove</a>
<a href="#MouseClick" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MouseClick</a>
<a href="#MouseDown" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MouseDown</a>
<a href="#MouseUp" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MouseUp</a>
<a href="#MouseClickDrag" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MouseClickDrag</a>
<a href="#MouseWheel" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MouseWheel</a>
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 mt-3 px-3 pt-1 border-t border-gray-100">Keyboard</div>
<a href="#Send" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Send</a>
<a href="#HotKeySet" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">HotKeySet</a>
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 mt-3 px-3 pt-1 border-t border-gray-100">Pixel</div>
<a href="#PixelGetColor" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">PixelGetColor</a>
<a href="#PixelSearch" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">PixelSearch</a>
<a href="#PixelChecksum" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">PixelChecksum</a>
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 mt-3 px-3 pt-1 border-t border-gray-100">Binary</div>
<a href="#Binary" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Binary</a>
<a href="#BinaryToString" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BinaryToString</a>
<a href="#BinaryLen" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BinaryLen</a>
<a href="#BinaryMid" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BinaryMid</a>
<a href="#BinaryAND" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BinaryAND</a>
<a href="#BinaryOR" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BinaryOR</a>
<a href="#BinaryXOR" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BinaryXOR</a>
<a href="#BinaryNOT" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">BinaryNOT</a>
<div class="font-bold text-gray-900 text-sm uppercase tracking-wider mb-2 mt-3 px-3 pt-1 border-t border-gray-100">Other</div>
<a href="#ClipPut" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">ClipPut</a>
<a href="#ClipGet" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">ClipGet</a>
<a href="#ConsoleWrite" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">ConsoleWrite</a>
<a href="#AdlibRegister" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">AdlibRegister</a>
<a href="#AdlibUnRegister" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">AdlibUnRegister</a>
<a href="#OnScriptExitRegister" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">OnScriptExitRegister</a>
<a href="#MsgBox" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MsgBox</a>
<a href="#InputBox" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">InputBox</a>
<a href="#FileOpenDialog" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileOpenDialog</a>
<a href="#FileSaveDialog" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileSaveDialog</a>
<a href="#FileSelectFolder" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">FileSelectFolder</a>
<a href="#InetGet" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">InetGet</a>
<a href="#InetRead" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">InetRead</a>
<a href="#TCPNameToIP" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">TCPNameToIP</a>
<a href="#Ping" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Ping</a>
<a href="#Sleep" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Sleep</a>
<a href="#TimerInit" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">TimerInit</a>
<a href="#TimerDiff" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">TimerDiff</a>
<a href="#Beep" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Beep</a>
<a href="#SoundPlay" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">SoundPlay</a>
<a href="#EnvGet" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">EnvGet</a>
<a href="#EnvSet" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">EnvSet</a>
<a href="#IsAdmin" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">IsAdmin</a>
<a href="#ShellExecute" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">ShellExecute</a>
<a href="#Shutdown" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">Shutdown</a>
<a href="#MemGetStats" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">MemGetStats</a>
<a href="#DriveSpaceFree" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">DriveSpaceFree</a>
<a href="#DriveSpaceTotal" class="block py-1.5 px-3 rounded hover:bg-gray-100 text-gray-500 text-sm">DriveSpaceTotal</a>
</div>
</aside>
<!-- Content -->
<div class="flex-1 min-w-0">
<h1 class="text-3xl font-extrabold mb-8">Function Reference</h1>
<!-- ═══════════════════════════════════════════════════════════ -->
<!-- STRING FUNCTIONS -->
<!-- ═══════════════════════════════════════════════════════════ -->
<h2 id="string" class="text-xl font-bold mb-6 pb-2 border-b border-gray-200">String Functions (30)</h2>
<div class="fn">
<h3 id="StringLen">StringLen</h3>
<div class="sig">StringLen($string)</div>
<p class="desc">Returns the number of characters in a string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$len</span> = StringLen(<span class="text-green-400">"Hello"</span>)
ConsoleWrite(<span class="text-green-400">"Length: "</span> & $len & @CRLF) <span class="text-gray-500">; Length: 5</span>
<span class="text-gray-300">$len</span> = StringLen(<span class="text-green-400">""</span>)
ConsoleWrite($len & @CRLF) <span class="text-gray-500">; 0</span>
<span class="text-gray-300">$len</span> = StringLen(<span class="text-green-400">"Hello World"</span>)
ConsoleWrite($len & @CRLF) <span class="text-gray-500">; 11</span></pre></div>
</div>
<div class="fn">
<h3 id="StringMid">StringMid</h3>
<div class="sig">StringMid($string, $start [, $count])</div>
<p class="desc">Extracts characters from the middle of a string. Start is 1-based. If $count is omitted, extracts to the end.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-500">; Extract 5 characters starting at position 7</span>
<span class="text-gray-300">$s</span> = StringMid(<span class="text-green-400">"Hello World"</span>, <span class="text-orange-400">7</span>, <span class="text-orange-400">5</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "World"</span>
<span class="text-gray-500">; Extract from position 2 to end</span>
<span class="text-gray-300">$s</span> = StringMid(<span class="text-green-400">"Hello"</span>, <span class="text-orange-400">2</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "ello"</span>
<span class="text-gray-500">; Extract single character</span>
<span class="text-gray-300">$s</span> = StringMid(<span class="text-green-400">"Hello"</span>, <span class="text-orange-400">1</span>, <span class="text-orange-400">1</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "H"</span></pre></div>
</div>
<div class="fn">
<h3 id="StringLeft">StringLeft</h3>
<div class="sig">StringLeft($string, $count)</div>
<p class="desc">Returns the leftmost N characters of a string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$s</span> = StringLeft(<span class="text-green-400">"Hello World"</span>, <span class="text-orange-400">5</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "Hello"</span>
<span class="text-gray-300">$s</span> = StringLeft(<span class="text-green-400">"Hello"</span>, <span class="text-orange-400">3</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "Hel"</span></pre></div>
</div>
<div class="fn">
<h3>StringRight</h3>
<div class="sig">StringRight($string, $count)</div>
<p class="desc">Returns the rightmost N characters of a string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$s</span> = StringRight(<span class="text-green-400">"Hello World"</span>, <span class="text-orange-400">5</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "World"</span>
<span class="text-gray-300">$s</span> = StringRight(<span class="text-green-400">"Hello"</span>, <span class="text-orange-400">3</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "llo"</span></pre></div>
</div>
<div class="fn">
<h3 id="StringUpper">StringUpper</h3>
<div class="sig">StringUpper($string)</div>
<p class="desc">Converts a string to uppercase.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$s</span> = StringUpper(<span class="text-green-400">"Hello World"</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "HELLO WORLD"</span></pre></div>
</div>
<div class="fn">
<h3>StringLower</h3>
<div class="sig">StringLower($string)</div>
<p class="desc">Converts a string to lowercase.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$s</span> = StringLower(<span class="text-green-400">"Hello World"</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "hello world"</span></pre></div>
</div>
<div class="fn">
<h3 id="StringReplace">StringReplace</h3>
<div class="sig">StringReplace($string, $search, $replace [, $count [, $casesense]])</div>
<p class="desc">Replaces occurrences of a substring. The number of replacements is stored in @Extended.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-500">; Replace all occurrences</span>
<span class="text-gray-300">$s</span> = StringReplace(<span class="text-green-400">"Hello World World"</span>, <span class="text-green-400">"World"</span>, <span class="text-green-400">"Mac"</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "Hello Mac Mac"</span>
ConsoleWrite(@Extended & @CRLF) <span class="text-gray-500">; 2 (number of replacements)</span>
<span class="text-gray-500">; Replace only first occurrence</span>
<span class="text-gray-300">$s</span> = StringReplace(<span class="text-green-400">"Hello World World"</span>, <span class="text-green-400">"World"</span>, <span class="text-green-400">"Mac"</span>, <span class="text-orange-400">0</span>, <span class="text-orange-400">1</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "Hello Mac World"</span></pre></div>
</div>
<div class="fn">
<h3 id="StringInStr">StringInStr</h3>
<div class="sig">StringInStr($string, $substring [, $casesense [, $occurrence]])</div>
<p class="desc">Returns the position of a substring (1-based). Returns 0 if not found.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$pos</span> = StringInStr(<span class="text-green-400">"Hello World"</span>, <span class="text-green-400">"World"</span>)
ConsoleWrite($pos & @CRLF) <span class="text-gray-500">; 7</span>
<span class="text-gray-300">$pos</span> = StringInStr(<span class="text-green-400">"Hello World"</span>, <span class="text-green-400">"xyz"</span>)
ConsoleWrite($pos & @CRLF) <span class="text-gray-500">; 0 (not found)</span>
<span class="text-gray-500">; Find second occurrence</span>
<span class="text-gray-300">$pos</span> = StringInStr(<span class="text-green-400">"abc abc abc"</span>, <span class="text-green-400">"abc"</span>, <span class="text-orange-400">0</span>, <span class="text-orange-400">2</span>)
ConsoleWrite($pos & @CRLF) <span class="text-gray-500">; 5</span></pre></div>
</div>
<div class="fn">
<h3 id="StringSplit">StringSplit</h3>
<div class="sig">StringSplit($string, $delimiters)</div>
<p class="desc">Splits a string into an array by delimiters. Element [0] contains the count.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$parts</span> = StringSplit(<span class="text-green-400">"apple,banana,cherry"</span>, <span class="text-green-400">","</span>)
ConsoleWrite(<span class="text-green-400">"Count: "</span> & $parts[<span class="text-orange-400">0</span>] & @CRLF) <span class="text-gray-500">; Count: 3</span>
ConsoleWrite($parts[<span class="text-orange-400">1</span>] & @CRLF) <span class="text-gray-500">; "apple"</span>
ConsoleWrite($parts[<span class="text-orange-400">2</span>] & @CRLF) <span class="text-gray-500">; "banana"</span>
ConsoleWrite($parts[<span class="text-orange-400">3</span>] & @CRLF) <span class="text-gray-500">; "cherry"</span>
<span class="text-gray-500">; Iterate over all parts</span>
<span class="text-purple-400">For</span> <span class="text-gray-300">$i</span> = <span class="text-orange-400">1</span> <span class="text-purple-400">To</span> $parts[<span class="text-orange-400">0</span>]
ConsoleWrite($parts[$i] & @CRLF)
<span class="text-purple-400">Next</span></pre></div>
</div>
<div class="fn">
<h3 id="StringStripWS">StringStripWS</h3>
<div class="sig">StringStripWS($string, $flag)</div>
<p class="desc">Strips whitespace. Flag: 1=leading, 2=trailing, 3=both.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$s</span> = StringStripWS(<span class="text-green-400">" Hello "</span>, <span class="text-orange-400">1</span>)
ConsoleWrite(<span class="text-green-400">"["</span> & $s & <span class="text-green-400">"]"</span> & @CRLF) <span class="text-gray-500">; "[Hello ]"</span>
<span class="text-gray-300">$s</span> = StringStripWS(<span class="text-green-400">" Hello "</span>, <span class="text-orange-400">2</span>)
ConsoleWrite(<span class="text-green-400">"["</span> & $s & <span class="text-green-400">"]"</span> & @CRLF) <span class="text-gray-500">; "[ Hello]"</span>
<span class="text-gray-300">$s</span> = StringStripWS(<span class="text-green-400">" Hello "</span>, <span class="text-orange-400">3</span>)
ConsoleWrite(<span class="text-green-400">"["</span> & $s & <span class="text-green-400">"]"</span> & @CRLF) <span class="text-gray-500">; "[Hello]"</span></pre></div>
</div>
<div class="fn">
<h3 id="StringTrimLeft">StringTrimLeft</h3>
<div class="sig">StringTrimLeft($string, $count)</div>
<p class="desc">Removes N characters from the left side of a string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$s</span> = StringTrimLeft(<span class="text-green-400">"Hello World"</span>, <span class="text-orange-400">6</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "World"</span></pre></div>
</div>
<div class="fn">
<h3>StringTrimRight</h3>
<div class="sig">StringTrimRight($string, $count)</div>
<p class="desc">Removes N characters from the right side of a string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$s</span> = StringTrimRight(<span class="text-green-400">"Hello World"</span>, <span class="text-orange-400">6</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "Hello"</span></pre></div>
</div>
<div class="fn">
<h3 id="StringCompare">StringCompare</h3>
<div class="sig">StringCompare($string1, $string2 [, $casesense])</div>
<p class="desc">Compares two strings. Returns 0 if equal, -1 if first < second, 1 if first > second. Case-insensitive by default.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$r</span> = StringCompare(<span class="text-green-400">"abc"</span>, <span class="text-green-400">"abc"</span>)
ConsoleWrite($r & @CRLF) <span class="text-gray-500">; 0 (equal)</span>
<span class="text-gray-300">$r</span> = StringCompare(<span class="text-green-400">"abc"</span>, <span class="text-green-400">"ABC"</span>)
ConsoleWrite($r & @CRLF) <span class="text-gray-500">; 0 (case-insensitive by default)</span>
<span class="text-gray-300">$r</span> = StringCompare(<span class="text-green-400">"abc"</span>, <span class="text-green-400">"def"</span>)
ConsoleWrite($r & @CRLF) <span class="text-gray-500">; -1 (abc < def)</span></pre></div>
</div>
<div class="fn">
<h3 id="StringReverse">StringReverse</h3>
<div class="sig">StringReverse($string)</div>
<p class="desc">Reverses the characters in a string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$s</span> = StringReverse(<span class="text-green-400">"Hello"</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "olleH"</span></pre></div>
</div>
<div class="fn">
<h3 id="StringFormat">StringFormat</h3>
<div class="sig">StringFormat($format, ...)</div>
<p class="desc">Returns a formatted string using printf-style format specifiers.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$s</span> = StringFormat(<span class="text-green-400">"Name: %s, Age: %d"</span>, <span class="text-green-400">"Alice"</span>, <span class="text-orange-400">30</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "Name: Alice, Age: 30"</span>
<span class="text-gray-300">$s</span> = StringFormat(<span class="text-green-400">"%05d"</span>, <span class="text-orange-400">42</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "00042"</span>
<span class="text-gray-300">$s</span> = StringFormat(<span class="text-green-400">"%.2f"</span>, <span class="text-orange-400">3.14159</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "3.14"</span>
<span class="text-gray-300">$s</span> = StringFormat(<span class="text-green-400">"0x%04X"</span>, <span class="text-orange-400">255</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "0x00FF"</span></pre></div>
</div>
<div class="fn">
<h3 id="StringRegExp">StringRegExp</h3>
<div class="sig">StringRegExp($string, $pattern [, $flag])</div>
<p class="desc">Tests if a string matches a regular expression pattern. Returns 1 if matched, 0 if not.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$r</span> = StringRegExp(<span class="text-green-400">"Hello 123"</span>, <span class="text-green-400">"\\d+"</span>)
ConsoleWrite($r & @CRLF) <span class="text-gray-500">; 1 (contains digits)</span>
<span class="text-gray-300">$r</span> = StringRegExp(<span class="text-green-400">"Hello"</span>, <span class="text-green-400">"\\d+"</span>)
ConsoleWrite($r & @CRLF) <span class="text-gray-500">; 0 (no digits)</span>
<span class="text-gray-300">$r</span> = StringRegExp(<span class="text-green-400">"test@example.com"</span>, <span class="text-green-400">"^[\\w.]+@[\\w.]+$"</span>)
ConsoleWrite($r & @CRLF) <span class="text-gray-500">; 1 (looks like email)</span></pre></div>
</div>
<div class="fn">
<h3 id="StringRegExpReplace">StringRegExpReplace</h3>
<div class="sig">StringRegExpReplace($string, $pattern, $replace)</div>
<p class="desc">Replaces text matching a regular expression pattern.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$s</span> = StringRegExpReplace(<span class="text-green-400">"Hello 123 World 456"</span>, <span class="text-green-400">"\\d+"</span>, <span class="text-green-400">"NUM"</span>)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "Hello NUM World NUM"</span>
<span class="text-gray-300">$s</span> = StringRegExpReplace(<span class="text-green-400">" spaces "</span>, <span class="text-green-400">"^\\s+|\\s+$"</span>, <span class="text-green-400">""</span>)
ConsoleWrite(<span class="text-green-400">"["</span> & $s & <span class="text-green-400">"]"</span> & @CRLF) <span class="text-gray-500">; "[spaces]"</span></pre></div>
</div>
<div class="fn">
<h3 id="StringIsInt">StringIsInt</h3>
<div class="sig">StringIsInt($string)</div>
<p class="desc">Returns 1 if the string represents an integer, 0 otherwise.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(StringIsInt(<span class="text-green-400">"42"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(StringIsInt(<span class="text-green-400">"-5"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(StringIsInt(<span class="text-green-400">"3.14"</span>) & @CRLF) <span class="text-gray-500">; 0 (has decimal)</span>
ConsoleWrite(StringIsInt(<span class="text-green-400">"hello"</span>) & @CRLF) <span class="text-gray-500">; 0</span>
ConsoleWrite(StringIsInt(<span class="text-green-400">"0"</span>) & @CRLF) <span class="text-gray-500">; 1</span></pre></div>
</div>
<div class="fn">
<h3>StringIsFloat</h3>
<div class="sig">StringIsFloat($string)</div>
<p class="desc">Returns 1 if the string represents a floating-point number.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(StringIsFloat(<span class="text-green-400">"3.14"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(StringIsFloat(<span class="text-green-400">"42"</span>) & @CRLF) <span class="text-gray-500">; 0 (integer)</span>
ConsoleWrite(StringIsFloat(<span class="text-green-400">"-1.5"</span>) & @CRLF) <span class="text-gray-500">; 1</span></pre></div>
</div>
<div class="fn">
<h3>StringIsAlpha</h3>
<div class="sig">StringIsAlpha($string)</div>
<p class="desc">Returns 1 if the string contains only alphabetic characters.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(StringIsAlpha(<span class="text-green-400">"Hello"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(StringIsAlpha(<span class="text-green-400">"Hello1"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3>StringIsDigit</h3>
<div class="sig">StringIsDigit($string)</div>
<p class="desc">Returns 1 if the string contains only digit characters (0-9).</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(StringIsDigit(<span class="text-green-400">"12345"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(StringIsDigit(<span class="text-green-400">"12.34"</span>) & @CRLF) <span class="text-gray-500">; 0 (has dot)</span></pre></div>
</div>
<div class="fn">
<h3>StringIsLower</h3>
<div class="sig">StringIsLower($string)</div>
<p class="desc">Returns 1 if all alphabetic characters are lowercase.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(StringIsLower(<span class="text-green-400">"hello"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(StringIsLower(<span class="text-green-400">"Hello"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3>StringIsUpper</h3>
<div class="sig">StringIsUpper($string)</div>
<p class="desc">Returns 1 if all alphabetic characters are uppercase.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(StringIsUpper(<span class="text-green-400">"HELLO"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(StringIsUpper(<span class="text-green-400">"Hello"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3>StringIsSpace</h3>
<div class="sig">StringIsSpace($string)</div>
<p class="desc">Returns 1 if the string contains only whitespace characters.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(StringIsSpace(<span class="text-green-400">" "</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(StringIsSpace(<span class="text-green-400">" a "</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3>StringIsAlNum</h3>
<div class="sig">StringIsAlNum($string)</div>
<p class="desc">Returns 1 if the string contains only alphanumeric characters.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(StringIsAlNum(<span class="text-green-400">"Hello123"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(StringIsAlNum(<span class="text-green-400">"Hello!"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3>StringIsASCII</h3>
<div class="sig">StringIsASCII($string)</div>
<p class="desc">Returns 1 if all characters are in the ASCII range (0-127).</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(StringIsASCII(<span class="text-green-400">"Hello"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(StringIsASCII(<span class="text-green-400">"Héllo"</span>) & @CRLF) <span class="text-gray-500">; 0 (é is not ASCII)</span></pre></div>
</div>
<div class="fn">
<h3>StringIsXDigit</h3>
<div class="sig">StringIsXDigit($string)</div>
<p class="desc">Returns 1 if the string contains only hexadecimal characters (0-9, A-F).</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(StringIsXDigit(<span class="text-green-400">"FF00AA"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(StringIsXDigit(<span class="text-green-400">"GG00"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3 id="StringAddCR">StringAddCR</h3>
<div class="sig">StringAddCR($string)</div>
<p class="desc">Adds a carriage return character before each linefeed.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$s</span> = StringAddCR(<span class="text-green-400">"Hello\nWorld"</span>)
<span class="text-gray-500">; Now contains "Hello\r\nWorld"</span></pre></div>
</div>
<div class="fn">
<h3>StringStripCR</h3>
<div class="sig">StringStripCR($string)</div>
<p class="desc">Removes all carriage return characters from a string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$s</span> = StringStripCR(<span class="text-green-400">"Hello\r\nWorld"</span>)
<span class="text-gray-500">; Now contains "Hello\nWorld"</span></pre></div>
</div>
<div class="fn">
<h3 id="StringToASCIIArray">StringToASCIIArray</h3>
<div class="sig">StringToASCIIArray($string [, $start [, $end]])</div>
<p class="desc">Converts a string to an array of character codes. Start/end are 0-based.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$codes</span> = StringToASCIIArray(<span class="text-green-400">"ABC"</span>)
<span class="text-gray-500">; $codes = [65, 66, 67]</span>
<span class="text-gray-300">$codes</span> = StringToASCIIArray(<span class="text-green-400">"Hello"</span>, <span class="text-orange-400">1</span>, <span class="text-orange-400">3</span>)
<span class="text-gray-500">; $codes = [101, 108, 108] (ell)</span></pre></div>
</div>
<div class="fn">
<h3 id="StringFromASCIIArray">StringFromASCIIArray</h3>
<div class="sig">StringFromASCIIArray($array [, $start [, $end]])</div>
<p class="desc">Converts an array of character codes to a string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-purple-400">Local</span> <span class="text-gray-300">$codes</span>[<span class="text-orange-400">3</span>]
$codes[<span class="text-orange-400">0</span>] = <span class="text-orange-400">72</span> <span class="text-gray-500">; H</span>
$codes[<span class="text-orange-400">1</span>] = <span class="text-orange-400">105</span> <span class="text-gray-500">; i</span>
$codes[<span class="text-orange-400">2</span>] = <span class="text-orange-400">33</span> <span class="text-gray-500">; !</span>
<span class="text-gray-300">$s</span> = StringFromASCIIArray($codes)
ConsoleWrite($s & @CRLF) <span class="text-gray-500">; "Hi!"</span></pre></div>
</div>
<!-- ═══════════════════════════════════════════════════════════ -->
<!-- MATH FUNCTIONS -->
<!-- ═══════════════════════════════════════════════════════════ -->
<h2 id="math" class="text-xl font-bold mb-6 mt-10 pb-2 border-b border-gray-200">Math Functions (24)</h2>
<div class="fn">
<h3 id="Abs">Abs</h3>
<div class="sig">Abs($number)</div>
<p class="desc">Returns the absolute (positive) value of a number.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Abs(<span class="text-orange-400">-5</span>) & @CRLF) <span class="text-gray-500">; 5</span>
ConsoleWrite(Abs(<span class="text-orange-400">3.14</span>) & @CRLF) <span class="text-gray-500">; 3.14</span>
ConsoleWrite(Abs(<span class="text-orange-400">0</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3 id="Trig">Cos</h3>
<div class="sig">Cos($radians)</div>
<p class="desc">Returns the cosine of a number in radians.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Cos(<span class="text-orange-400">0</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(Cos(<span class="text-orange-400">3.14159</span>) & @CRLF) <span class="text-gray-500">; -1 (π)</span>
ConsoleWrite(Cos(<span class="text-orange-400">1.5708</span>) & @CRLF) <span class="text-gray-500">; ~0 (π/2)</span></pre></div>
</div>
<div class="fn">
<h3 id="Sin">Sin</h3>
<div class="sig">Sin($radians)</div>
<p class="desc">Returns the sine of a number in radians.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Sin(<span class="text-orange-400">0</span>) & @CRLF) <span class="text-gray-500">; 0</span>
ConsoleWrite(Sin(<span class="text-orange-400">1.5708</span>) & @CRLF) <span class="text-gray-500">; ~1 (π/2)</span>
ConsoleWrite(Sin(<span class="text-orange-400">3.14159</span>) & @CRLF) <span class="text-gray-500">; ~0 (π)</span></pre></div>
</div>
<div class="fn">
<h3 id="Tan">Tan</h3>
<div class="sig">Tan($radians)</div>
<p class="desc">Returns the tangent of a number in radians.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Tan(<span class="text-orange-400">0</span>) & @CRLF) <span class="text-gray-500">; 0</span>
ConsoleWrite(Tan(<span class="text-orange-400">0.785398</span>) & @CRLF) <span class="text-gray-500">; ~1 (π/4)</span>
ConsoleWrite(Tan(<span class="text-orange-400">1</span>) & @CRLF) <span class="text-gray-500">; 1.5574...</span></pre></div>
</div>
<div class="fn">
<h3 id="ATrig">ACos</h3>
<div class="sig">ACos($value)</div>
<p class="desc">Returns the arc cosine (inverse cosine) in radians.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(ACos(<span class="text-orange-400">1</span>) & @CRLF) <span class="text-gray-500">; 0</span>
ConsoleWrite(ACos(<span class="text-orange-400">0</span>) & @CRLF) <span class="text-gray-500">; 1.5708 (π/2)</span>
ConsoleWrite(ACos(<span class="text-orange-400">-1</span>) & @CRLF) <span class="text-gray-500">; 3.14159 (π)</span></pre></div>
</div>
<div class="fn">
<h3 id="ASin">ASin</h3>
<div class="sig">ASin($value)</div>
<p class="desc">Returns the arc sine (inverse sine) in radians.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(ASin(<span class="text-orange-400">0</span>) & @CRLF) <span class="text-gray-500">; 0</span>
ConsoleWrite(ASin(<span class="text-orange-400">1</span>) & @CRLF) <span class="text-gray-500">; 1.5708 (π/2)</span>
ConsoleWrite(ASin(<span class="text-orange-400">-1</span>) & @CRLF) <span class="text-gray-500">; -1.5708 (-π/2)</span></pre></div>
</div>
<div class="fn">
<h3 id="ATan">ATan</h3>
<div class="sig">ATan($value)</div>
<p class="desc">Returns the arc tangent (inverse tangent) in radians.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(ATan(<span class="text-orange-400">0</span>) & @CRLF) <span class="text-gray-500">; 0</span>
ConsoleWrite(ATan(<span class="text-orange-400">1</span>) & @CRLF) <span class="text-gray-500">; 0.785398... (π/4)</span>
ConsoleWrite(ATan(<span class="text-orange-400">-1</span>) & @CRLF) <span class="text-gray-500">; -0.785398... (-π/4)</span></pre></div>
</div>
<div class="fn">
<h3 id="Exp">Exp</h3>
<div class="sig">Exp($number)</div>
<p class="desc">Returns e raised to the power of the given number.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Exp(<span class="text-orange-400">0</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(Exp(<span class="text-orange-400">1</span>) & @CRLF) <span class="text-gray-500">; 2.71828... (e)</span></pre></div>
</div>
<div class="fn">
<h3>Log</h3>
<div class="sig">Log($number)</div>
<p class="desc">Returns the natural logarithm (base e) of a number.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Log(<span class="text-orange-400">1</span>) & @CRLF) <span class="text-gray-500">; 0</span>
ConsoleWrite(Log(<span class="text-orange-400">2.71828</span>) & @CRLF) <span class="text-gray-500">; ~1</span></pre></div>
</div>
<div class="fn">
<h3 id="Floor">Floor</h3>
<div class="sig">Floor($number)</div>
<p class="desc">Rounds a number down to the nearest integer.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Floor(<span class="text-orange-400">3.7</span>) & @CRLF) <span class="text-gray-500">; 3</span>
ConsoleWrite(Floor(<span class="text-orange-400">-3.7</span>) & @CRLF) <span class="text-gray-500">; -4</span>
ConsoleWrite(Floor(<span class="text-orange-400">5.0</span>) & @CRLF) <span class="text-gray-500">; 5</span></pre></div>
</div>
<div class="fn">
<h3>Ceiling</h3>
<div class="sig">Ceiling($number)</div>
<p class="desc">Rounds a number up to the nearest integer.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Ceiling(<span class="text-orange-400">3.2</span>) & @CRLF) <span class="text-gray-500">; 4</span>
ConsoleWrite(Ceiling(<span class="text-orange-400">-3.2</span>) & @CRLF) <span class="text-gray-500">; -3</span></pre></div>
</div>
<div class="fn">
<h3 id="Round">Round</h3>
<div class="sig">Round($number [, $decimalplaces])</div>
<p class="desc">Rounds a number to the specified number of decimal places.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Round(<span class="text-orange-400">3.14159</span>, <span class="text-orange-400">2</span>) & @CRLF) <span class="text-gray-500">; 3.14</span>
ConsoleWrite(Round(<span class="text-orange-400">3.14159</span>, <span class="text-orange-400">0</span>) & @CRLF) <span class="text-gray-500">; 3</span>
ConsoleWrite(Round(<span class="text-orange-400">3.5</span>) & @CRLF) <span class="text-gray-500">; 4</span></pre></div>
</div>
<div class="fn">
<h3>Int</h3>
<div class="sig">Int($number)</div>
<p class="desc">Returns the integer part of a number (truncates toward zero).</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Int(<span class="text-orange-400">3.7</span>) & @CRLF) <span class="text-gray-500">; 3</span>
ConsoleWrite(Int(<span class="text-orange-400">-3.7</span>) & @CRLF) <span class="text-gray-500">; -3</span></pre></div>
</div>
<div class="fn">
<h3 id="Sqrt">Sqrt</h3>
<div class="sig">Sqrt($number)</div>
<p class="desc">Returns the square root of a number.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Sqrt(<span class="text-orange-400">9</span>) & @CRLF) <span class="text-gray-500">; 3</span>
ConsoleWrite(Sqrt(<span class="text-orange-400">2</span>) & @CRLF) <span class="text-gray-500">; 1.41421...</span>
ConsoleWrite(Sqrt(<span class="text-orange-400">100</span>) & @CRLF) <span class="text-gray-500">; 10</span></pre></div>
</div>
<div class="fn">
<h3 id="Random">Random</h3>
<div class="sig">Random([$min [, $max]])</div>
<p class="desc">Generates a random number. Without arguments, returns 0.0 to 1.0.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$r</span> = Random()
ConsoleWrite($r & @CRLF) <span class="text-gray-500">; 0.0 to 1.0</span>
<span class="text-gray-300">$r</span> = Random(<span class="text-orange-400">1</span>, <span class="text-orange-400">100</span>)
ConsoleWrite($r & @CRLF) <span class="text-gray-500">; 1 to 100</span>
<span class="text-gray-300">$r</span> = Random(<span class="text-orange-400">0</span>, <span class="text-orange-400">100</span>, <span class="text-orange-400">1</span>)
ConsoleWrite($r & @CRLF) <span class="text-gray-500">; 0 to 100, integer only</span></pre></div>
</div>
<div class="fn">
<h3 id="SRandom">SRandom</h3>
<div class="sig">SRandom($seed)</div>
<p class="desc">Sets the seed for the random number generator for reproducible results.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">SRandom(<span class="text-orange-400">42</span>)
ConsoleWrite(Random(<span class="text-orange-400">1</span>, <span class="text-orange-400">100</span>) & @CRLF) <span class="text-gray-500">; always the same number</span></pre></div>
</div>
<div class="fn">
<h3 id="Number">Number</h3>
<div class="sig">Number($expression)</div>
<p class="desc">Converts an expression to a numeric value.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Number(<span class="text-green-400">"42"</span>) & @CRLF) <span class="text-gray-500">; 42</span>
ConsoleWrite(Number(<span class="text-green-400">"3.14"</span>) & @CRLF) <span class="text-gray-500">; 3.14</span>
ConsoleWrite(Number(<span class="text-green-400">"hello"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3>Mod</h3>
<div class="sig">Mod($dividend, $divisor)</div>
<p class="desc">Returns the remainder of division. Also available as infix operator: <code>$a Mod $b</code>.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Mod(<span class="text-orange-400">10</span>, <span class="text-orange-400">3</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(Mod(<span class="text-orange-400">7</span>, <span class="text-orange-400">2</span>) & @CRLF) <span class="text-gray-500">; 1</span>
<span class="text-gray-500">; Infix form</span>
<span class="text-gray-300">$r</span> = <span class="text-orange-400">10</span> <span class="text-purple-400">Mod</span> <span class="text-orange-400">3</span>
ConsoleWrite($r & @CRLF) <span class="text-gray-500">; 1</span></pre></div>
</div>
<div class="fn">
<h3 id="Bitwise">BitAND</h3>
<div class="sig">BitAND($a, $b)</div>
<p class="desc">Returns the bitwise AND of two integers.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(BitAND(<span class="text-orange-400">0xFF</span>, <span class="text-orange-400">0x0F</span>) & @CRLF) <span class="text-gray-500">; 15 (0x0F)</span>
ConsoleWrite(BitAND(<span class="text-orange-400">0xF0</span>, <span class="text-orange-400">0x0F</span>) & @CRLF) <span class="text-gray-500">; 0</span>
ConsoleWrite(BitAND(<span class="text-orange-400">6</span>, <span class="text-orange-400">3</span>) & @CRLF) <span class="text-gray-500">; 2 (0110 & 0011 = 0010)</span></pre></div>
</div>
<div class="fn">
<h3 id="BitOR">BitOR</h3>
<div class="sig">BitOR($a, $b)</div>
<p class="desc">Returns the bitwise OR of two integers.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(BitOR(<span class="text-orange-400">0xF0</span>, <span class="text-orange-400">0x0F</span>) & @CRLF) <span class="text-gray-500">; 255 (0xFF)</span>
ConsoleWrite(BitOR(<span class="text-orange-400">4</span>, <span class="text-orange-400">3</span>) & @CRLF) <span class="text-gray-500">; 7 (0100 | 0011 = 0111)</span></pre></div>
</div>
<div class="fn">
<h3 id="BitXOR">BitXOR</h3>
<div class="sig">BitXOR($a, $b)</div>
<p class="desc">Returns the bitwise XOR (exclusive or) of two integers.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(BitXOR(<span class="text-orange-400">0xFF</span>, <span class="text-orange-400">0x0F</span>) & @CRLF) <span class="text-gray-500">; 240 (0xF0)</span>
ConsoleWrite(BitXOR(<span class="text-orange-400">5</span>, <span class="text-orange-400">3</span>) & @CRLF) <span class="text-gray-500">; 6 (0101 ^ 0011 = 0110)</span></pre></div>
</div>
<div class="fn">
<h3 id="BitNOT">BitNOT</h3>
<div class="sig">BitNOT($a)</div>
<p class="desc">Returns the bitwise NOT (complement) of an integer.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(BitNOT(<span class="text-orange-400">0</span>) & @CRLF) <span class="text-gray-500">; -1 (all bits set)</span>
ConsoleWrite(BitNOT(<span class="text-orange-400">-1</span>) & @CRLF) <span class="text-gray-500">; 0</span>
ConsoleWrite(BitNOT(<span class="text-orange-400">0xFF</span>) & @CRLF) <span class="text-gray-500">; -256</span></pre></div>
</div>
<div class="fn">
<h3 id="BitShift">BitShift</h3>
<div class="sig">BitShift($value, $shift)</div>
<p class="desc">Shifts bits. Positive = right shift, negative = left shift.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(BitShift(<span class="text-orange-400">8</span>, <span class="text-orange-400">2</span>) & @CRLF) <span class="text-gray-500">; 2 (right shift by 2: 8/4)</span>
ConsoleWrite(BitShift(<span class="text-orange-400">2</span>, <span class="text-orange-400">-3</span>) & @CRLF) <span class="text-gray-500">; 16 (left shift by 3: 2*8)</span></pre></div>
</div>
<div class="fn">
<h3>BitRotate</h3>
<div class="sig">BitRotate($value, $shift, $bits)</div>
<p class="desc">Rotates bits within the specified bit width.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-500">; Rotate 1 left by 1 bit in 8-bit: 00000001 → 00000010</span>
ConsoleWrite(BitRotate(<span class="text-orange-400">1</span>, <span class="text-orange-400">1</span>, <span class="text-orange-400">8</span>) & @CRLF) <span class="text-gray-500">; 2</span></pre></div>
</div>
<!-- ═══════════════════════════════════════════════════════════ -->
<!-- TYPE & CONVERSION FUNCTIONS -->
<!-- ═══════════════════════════════════════════════════════════ -->
<h2 id="type" class="text-xl font-bold mb-6 mt-10 pb-2 border-b border-gray-200">Type & Conversion Functions (24)</h2>
<div class="fn">
<h3 id="IsArray">IsArray</h3>
<div class="sig">IsArray($variable)</div>
<p class="desc">Returns 1 if the variable contains an array, 0 otherwise.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-purple-400">Local</span> <span class="text-gray-300">$arr</span>[<span class="text-orange-400">3</span>]
ConsoleWrite(IsArray($arr) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsArray(<span class="text-green-400">"hello"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3>IsInt</h3>
<div class="sig">IsInt($expression)</div>
<p class="desc">Returns 1 if the value is an integer (no fractional component).</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(IsInt(<span class="text-orange-400">42</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsInt(<span class="text-orange-400">0</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsInt(<span class="text-orange-400">3.14</span>) & @CRLF) <span class="text-gray-500">; 0</span>
ConsoleWrite(IsInt(<span class="text-green-400">"-5"</span>) & @CRLF) <span class="text-gray-500">; 1</span></pre></div>
</div>
<div class="fn">
<h3>IsFloat</h3>
<div class="sig">IsFloat($expression)</div>
<p class="desc">Returns 1 if the value has a fractional component.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(IsFloat(<span class="text-orange-400">3.14</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsFloat(<span class="text-orange-400">42</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3>IsString</h3>
<div class="sig">IsString($expression)</div>
<p class="desc">Returns 1 if the value is a non-numeric string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(IsString(<span class="text-green-400">"hello"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsString(<span class="text-green-400">"42"</span>) & @CRLF) <span class="text-gray-500">; 0 (numeric)</span></pre></div>
</div>
<div class="fn">
<h3>IsNumber</h3>
<div class="sig">IsNumber($expression)</div>
<p class="desc">Returns 1 if the value can be interpreted as a number.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(IsNumber(<span class="text-green-400">"42"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsNumber(<span class="text-green-400">"3.14"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsNumber(<span class="text-green-400">"hello"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3>IsBool</h3>
<div class="sig">IsBool($expression)</div>
<p class="desc">Returns 1 if the value is "True" or "False" (case-insensitive).</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(IsBool(<span class="text-green-400">"True"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsBool(<span class="text-green-400">"FALSE"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsBool(<span class="text-green-400">"1"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3 id="IsBinary">IsBinary</h3>
<div class="sig">IsBinary($variable)</div>
<p class="desc">Returns 1 if the variable contains binary data.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$bin</span> = Binary(<span class="text-green-400">"Hello"</span>)
ConsoleWrite(IsBinary($bin) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsBinary(<span class="text-green-400">"hello"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3 id="IsMap">IsMap</h3>
<div class="sig">IsMap($variable)</div>
<p class="desc">Returns 1 if the variable contains a map (dictionary).</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-purple-400">Local</span> <span class="text-gray-300">$m</span>[]
ConsoleWrite(IsMap($m) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsMap(<span class="text-green-400">"not a map"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3 id="IsKeyword">IsKeyword</h3>
<div class="sig">IsKeyword($expression)</div>
<p class="desc">Returns 1 if the expression is a keyword value (Default, Null, True, or False).</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(IsKeyword(Default) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsKeyword(Null) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsKeyword(True) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsKeyword(<span class="text-green-400">"hello"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3 id="IsDeclared">IsDeclared</h3>
<div class="sig">IsDeclared($variablename)</div>
<p class="desc">Returns 1 if a variable with the given name has been declared.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$myVar</span> = <span class="text-orange-400">42</span>
ConsoleWrite(IsDeclared(<span class="text-green-400">"myVar"</span>) & @CRLF) <span class="text-gray-500">; 1</span>
ConsoleWrite(IsDeclared(<span class="text-green-400">"otherVar"</span>) & @CRLF) <span class="text-gray-500">; 0</span></pre></div>
</div>
<div class="fn">
<h3 id="VarGetType">VarGetType</h3>
<div class="sig">VarGetType($variable)</div>
<p class="desc">Returns the internal type name as a string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(VarGetType(<span class="text-orange-400">42</span>) & @CRLF) <span class="text-gray-500">; "Int32"</span>
ConsoleWrite(VarGetType(<span class="text-green-400">"hello"</span>) & @CRLF) <span class="text-gray-500">; "String"</span>
ConsoleWrite(VarGetType(<span class="text-orange-400">3.14</span>) & @CRLF) <span class="text-gray-500">; "Double"</span></pre></div>
</div>
<div class="fn">
<h3 id="Asc">Asc</h3>
<div class="sig">Asc($char)</div>
<p class="desc">Returns the ASCII code of the first character of a string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Asc(<span class="text-green-400">"A"</span>) & @CRLF) <span class="text-gray-500">; 65</span>
ConsoleWrite(Asc(<span class="text-green-400">"Hello"</span>) & @CRLF) <span class="text-gray-500">; 72 (H)</span>
ConsoleWrite(Asc(<span class="text-green-400">"a"</span>) & @CRLF) <span class="text-gray-500">; 97</span></pre></div>
</div>
<div class="fn">
<h3 id="AscW">AscW</h3>
<div class="sig">AscW($char)</div>
<p class="desc">Returns the Unicode code point of the first character of a string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(AscW(<span class="text-green-400">"A"</span>) & @CRLF) <span class="text-gray-500">; 65</span>
ConsoleWrite(AscW(<span class="text-green-400">"€"</span>) & @CRLF) <span class="text-gray-500">; 8364</span>
ConsoleWrite(AscW(<span class="text-green-400">"中"</span>) & @CRLF) <span class="text-gray-500">; 20013</span></pre></div>
</div>
<div class="fn">
<h3 id="Chr">Chr</h3>
<div class="sig">Chr($code)</div>
<p class="desc">Returns a character from an ASCII code (0-255).</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Chr(<span class="text-orange-400">65</span>) & @CRLF) <span class="text-gray-500">; "A"</span>
ConsoleWrite(Chr(<span class="text-orange-400">97</span>) & @CRLF) <span class="text-gray-500">; "a"</span>
ConsoleWrite(Chr(<span class="text-orange-400">33</span>) & @CRLF) <span class="text-gray-500">; "!"</span></pre></div>
</div>
<div class="fn">
<h3 id="ChrW">ChrW</h3>
<div class="sig">ChrW($code)</div>
<p class="desc">Returns a character from a Unicode code point.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(ChrW(<span class="text-orange-400">8364</span>) & @CRLF) <span class="text-gray-500">; "€"</span>
ConsoleWrite(ChrW(<span class="text-orange-400">20013</span>) & @CRLF) <span class="text-gray-500">; "中"</span>
ConsoleWrite(ChrW(<span class="text-orange-400">65</span>) & @CRLF) <span class="text-gray-500">; "A"</span></pre></div>
</div>
<div class="fn">
<h3 id="String">String</h3>
<div class="sig">String($expression)</div>
<p class="desc">Converts an expression to its string representation.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(String(<span class="text-orange-400">42</span>) & @CRLF) <span class="text-gray-500">; "42"</span>
ConsoleWrite(String(<span class="text-orange-400">3.14</span>) & @CRLF) <span class="text-gray-500">; "3.14"</span>
ConsoleWrite(String(True) & @CRLF) <span class="text-gray-500">; "True"</span></pre></div>
</div>
<div class="fn">
<h3>Hex</h3>
<div class="sig">Hex($number [, $length])</div>
<p class="desc">Converts a number to a hexadecimal string.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Hex(<span class="text-orange-400">255</span>) & @CRLF) <span class="text-gray-500">; "FF"</span>
ConsoleWrite(Hex(<span class="text-orange-400">255</span>, <span class="text-orange-400">4</span>) & @CRLF) <span class="text-gray-500">; "00FF"</span>
ConsoleWrite(Hex(<span class="text-orange-400">0</span>, <span class="text-orange-400">8</span>) & @CRLF) <span class="text-gray-500">; "00000000"</span>
ConsoleWrite(Hex(<span class="text-orange-400">-1</span>) & @CRLF) <span class="text-gray-500">; "FFFFFFFF"</span></pre></div>
</div>
<div class="fn">
<h3>Dec</h3>
<div class="sig">Dec($hexstring)</div>
<p class="desc">Converts a hexadecimal string to a decimal number.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Dec(<span class="text-green-400">"FF"</span>) & @CRLF) <span class="text-gray-500">; 255</span>
ConsoleWrite(Dec(<span class="text-green-400">"0xFF"</span>) & @CRLF) <span class="text-gray-500">; 255</span>
ConsoleWrite(Dec(<span class="text-green-400">"10"</span>) & @CRLF) <span class="text-gray-500">; 16 (hex "10" = 16)</span>
ConsoleWrite(Dec(<span class="text-green-400">"ZZZ"</span>) & @CRLF) <span class="text-gray-500">; 0 (invalid)</span></pre></div>
</div>
<div class="fn">
<h3 id="UBound">UBound</h3>
<div class="sig">UBound($array [, $dimension])</div>
<p class="desc">Returns the size of an array. Dimension 1=rows, 2=columns (for 2D).</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-purple-400">Local</span> <span class="text-gray-300">$arr</span>[<span class="text-orange-400">5</span>]
ConsoleWrite(UBound($arr) & @CRLF) <span class="text-gray-500">; 5</span>
<span class="text-purple-400">Local</span> <span class="text-gray-300">$m</span>[<span class="text-orange-400">3</span>][<span class="text-orange-400">4</span>]
ConsoleWrite(UBound($m, <span class="text-orange-400">1</span>) & @CRLF) <span class="text-gray-500">; 3 (rows)</span>
ConsoleWrite(UBound($m, <span class="text-orange-400">2</span>) & @CRLF) <span class="text-gray-500">; 4 (columns)</span></pre></div>
</div>
<div class="fn">
<h3 id="Eval">Eval</h3>
<div class="sig">Eval($name)</div>
<p class="desc">Returns the value of a variable by name at runtime.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300"><span class="text-gray-300">$myVar</span> = <span class="text-orange-400">42</span>
ConsoleWrite(Eval(<span class="text-green-400">"myVar"</span>) & @CRLF) <span class="text-gray-500">; 42</span>
<span class="text-gray-300">$name</span> = <span class="text-green-400">"hello"</span>
ConsoleWrite(Eval(<span class="text-green-400">"name"</span>) & @CRLF) <span class="text-gray-500">; "hello"</span></pre></div>
</div>
<div class="fn">
<h3 id="Assign">Assign</h3>
<div class="sig">Assign($name, $value)</div>
<p class="desc">Assigns a value to a variable by name at runtime.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">Assign(<span class="text-green-400">"newVar"</span>, <span class="text-orange-400">100</span>)
ConsoleWrite($newVar & @CRLF) <span class="text-gray-500">; 100</span>
Assign(<span class="text-green-400">"greeting"</span>, <span class="text-green-400">"Hello"</span>)
ConsoleWrite($greeting & @CRLF) <span class="text-gray-500">; "Hello"</span></pre></div>
</div>
<div class="fn">
<h3 id="Execute">Execute</h3>
<div class="sig">Execute($expression)</div>
<p class="desc">Executes a string as code and returns the result.</p>
<div class="bg-gray-900 rounded-lg p-4 mb-3"><pre class="text-gray-300">ConsoleWrite(Execute(<span class="text-green-400">"2 + 3"</span>) & @CRLF) <span class="text-gray-500">; 5</span>
ConsoleWrite(Execute(<span class="text-green-400">"StringLen('Hello')"</span>) & @CRLF) <span class="text-gray-500">; 5</span>