• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] calling functions

Status
Not open for further replies.
Level 6
Joined
Feb 18, 2005
Messages
263
most likley you do not have a function calle InitMultiboards, or if you have one, it does not stand above the part, where you call it.

-> in jass a function can only call functiones that have been defined before the function that wants to call.
 
Level 4
Joined
Sep 15, 2005
Messages
42
Lord Raszul said:
most likley you do not have a function calle InitMultiboards, or if you have one, it does not stand above the part, where you call it.

-> in jass a function can only call functiones that have been defined before the function that wants to call.

what do you mean?
 
Level 6
Joined
Feb 18, 2005
Messages
263
if you have some custom code like this
Code:
function foo takes unit returns nothing
   call kill(unit)
endfunction

function bar takes nothing returns nothing
   call foo(GetTriggerUnit())
endfunction

everything will work proberly
but if you would have writen it like this:
Code:
function bar takes nothing returns nothing
   call foo(GetTriggerUnit())
endfunction

function foo takes unit returns nothing
   call kill(unit)
endfunction

it woul give an error like "function name excpected" or something like that.
That is, becouse the function bar() does not 'know' the function foo(). A function knows only functions that have been created above itself.

therefore if you create two triggers in GUI, the one below does know the one above, but not vice versa (the editor fixes this if you use the GUI-Version of calling triggers)
 
Status
Not open for further replies.
Top