Warcraft III resources & community, 2003–2006 · archived

Newbie Question - How to get the returned result?!

2 posts
#1

Newbie Question - How to get the returned result?!

I'm very new to JASS so go easy on me.
I want to set a variable to the returned result.
function swap takes boolean a returns boolean
	if a==true then
		set a = false
	else
		set a = true
	endif
	return a
endfunction

I have a global boolean (booltest) and I want to set it to the local boolean "a".
How do I turn from simple words "set booltest to returned result of swap(booltest)" into JASS?
#2
Very simple...

set udg_a=swap(a)

Change the a in front of the udg_ to the name of your global. Read my tutorial if you need more info. Look in tutorial sections for a JASS tutorial.

~Daelin