| 08-21-2005, 08:09 PM | #1 |
If i have a function that returns a boolean how do i use htis in a if statement. What i mean by this is what does a return return as i can't really explain what i mean but i know it is simple and none of the jass guides seem to explain it. For example if i have a function called my_trigger and it takes integer i and unit u and returns boolean how do i use the return in an if statement |
| 08-22-2005, 01:48 PM | #2 |
by returning it? It is untrue that it isn't explained on any JASS guide- if statements are like this: if (boolean) then [elseif (boolean) then] [else] endif Just use the function on the boolean part of the if statement function Afun takes nothing returns boolean return false endfunction if (Afun()) then //do stuff endif |
