We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8c47e2 commit ba5a39aCopy full SHA for ba5a39a
1 file changed
modules/std/types/bools.xw
@@ -21,6 +21,23 @@ Alias BoolArray:Bool[] 'Added iDkP 2025-07-09!
21
22
'---------------------- Utils: Old Bool type
23
24
+#rem wonkeydoc Bool to Ternary.
25
+@author iDkP from GaragePixel
26
+@since 2025-07-21
27
+Implicite conversion from bool to int is possible. In this case:
28
+- if v=True return 1
29
+- if v=False return 0
30
+But this function is special:
31
32
+- if v=False return -1
33
+... as it's intented to be used to cast a binary compare functions, sometimes with a sort.
34
+#end
35
+Function BoolToTernary:Int( v:Bool )
36
+ 'if v=true return 1
37
+ 'if v=false return -1
38
+ Return v=False ? -1 Else v
39
+End
40
+
41
Function Is:Bool(a:Bool)
42
'Deprecated int32 boolean version, for the reciprocal
43
Return a=True
0 commit comments