Hi,
I just discovered you can do type safe constants... pretty sweet :)
I just discovered you can do type safe constants... pretty sweet :)
Strict Type bob Const IS_HAPPY:Int = 1 Const IS_HUNGRY:Int = 2 Field mood:Int Method New() mood = Rand(0,3) EndMethod Method PrintMood() If mood | IS_HAPPY Print "I'm happy" EndIf If mood | IS_HUNGRY Print "I'm hungry" EndIf EndMethod EndType ' Won't work :) ' Print IS_HAPPY ' Will work :) ' Print bob.IS_HAPPY Local b:bob = New bob Print "Bob says:" b.PrintMood()