On Sun, 21 Nov 1999 [EMAIL PROTECTED] wrote:

>      if [ a = 0 ] [ 
>            print [ "this is true "]
>              return true
>              ]; end if
> 

My bad I had my head in C for the moment. remove the braces around if [ a
= 0] so it looks like if a = 0 [ print "this is true" ]

If you need to make it clearer for yourself then group items like this

if (a = 0) [

that will work properly because otherwise if [ a = 0] just creates a block
a = 0

And since it is successful at creating a block it will automaticly return
true.

or you could also technicly do if do [a = 0] [ print "this is true"] but
thats a bit excessive.

and a cleaner way of writing your function would be.

arbit: func [] [
    print :a
    either :a = 0 [
        print ["This is true"]
        return true ; Although not needed because either will return true
    ][
        print ["False"]
        return false
    ]
]

Reply via email to