View Single Post
Return from Boolean function
Posts: n/a
Default Return from Boolean function - 03-13-2007, 12:19 AM

Here is a start on the answer. (This explaination could really use some more rigor in defining terms and elsewhere - I'd appreciate any help there.)

Your basic problem is that you are trying to use "Return" - which is a reserved word for the value returned from a function - as an ordinary variable in the body of the function itself. This actually will work (which surprises me a bit ) if you declare a local Boolean variable named "Return" and then "Return 'Return' " (see attached) - but it's a very bad idea.

A much better appoach is to declare some other local variable name in the function and set up your tests to set its value - then return it using the "Return" line in the function template.

As far as the "Return '<None>' " statement - that is only an allowed option for a function type, such as a texture (again see attached), for which <none> is an allowed value to return for the variable. For a Boolean function, you must (and will be forced by Alice to) ultimately return either a true or false.
Attached Files
File Type: a2w Return Demo.a2w (171.3 KB, 325 views)
Reply With Quote