HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

vJass: can I ExecuteFunc a static method that takes nothing? what's the funcname?

11-13-2007, 06:46 PM#1
Lordy
jo. title says it =)

Also, I'm having some trouble with the struct array size limit. Is there a not-too-hard way around it?
11-13-2007, 07:04 PM#2
Earth-Fury
err? why would you need to ExecuteFunc a static method? use .evaluate() or .execute()

as for the array limit, use more then 1 array... but 8191 is a high enogh limit for most things..
11-14-2007, 02:34 AM#3
Vexorian
Quote:
Originally Posted by Lordy
jo. title says it =)

Also, I'm having some trouble with the struct array size limit. Is there a not-too-hard way around it?
You could just stop needing so much instances, really.
12-03-2007, 02:24 PM#4
Lordy
Stop needing so much instances? I have a Unit struct that carries an array of Buff Structs and the Buff Struct on itself carries an array of Effect Structs, so I need many instances^^.
12-03-2007, 02:39 PM#5
Troll-Brain
what are the difference beetween .evaluate() , .execute() and ExecuteFunc ?
12-03-2007, 02:57 PM#6
HINDYhat
.evaluate returns a boolean, I believe.

.execute is like ExecuteFunc, but faster.
12-03-2007, 03:08 PM#7
Vexorian
.evaluate for methods does not exist, for functions it allows you to call a function that is declared bellow.

.execute just calls it in another thread.

Notice .execute is slower but allows waits while .evaluate allows you to use a return value.
12-03-2007, 03:26 PM#8
HINDYhat
=o, that I didn't know.
12-03-2007, 03:36 PM#9
Troll-Brain
ok Vexorian , but you didn't wrote it in the documentation or i read so badly ?
12-03-2007, 09:51 PM#10
Jazradel
You read it badly I think.
12-03-2007, 09:59 PM#11
Anitarf
Quote:
Originally Posted by Lordy
Stop needing so much instances? I have a Unit struct that carries an array of Buff Structs and the Buff Struct on itself carries an array of Effect Structs, so I need many instances^^.
Use linked lists instead of arrays.
12-03-2007, 10:06 PM#12
Vexorian
Quote:
Originally Posted by Lordy
Stop needing so much instances? I have a Unit struct that carries an array of Buff Structs and the Buff Struct on itself carries an array of Effect Structs, so I need many instances^^.
In a soon to come version of jasshelper you are gonna be able to get 8 times more instances at the cost of speed.
12-05-2007, 01:37 PM#13
Strilanc
You can use function_name.execute() to do the equivalent of ExecuteFunc. If you actually want to use ExecuteFunc directly I believe you use StructureName.FunctionName as the function name. Note that a bug in vJass stops you from using .execute on static methods if they have parameters.

Collapse JASS:
struct S
  public static method M takes integer i returns integer //<== weird syntax error
    return i
  endmethod
endstruct

//elsewhere

call S.m.execute(1) //no error without this

The work-around is to make the method not static and call it using an instance.

Collapse JASS:
struct S
  public method M takes integer i returns integer
    return i
  endmethod
endstruct

//elsewhere

Struct S s = 0
call s.m.execute(1)
12-05-2007, 02:00 PM#14
Vexorian
Thanks for reporting the bug using the jasshelper thread.
12-05-2007, 02:34 PM#15
Strilanc
Quote:
Originally Posted by Vexorian
Thanks for reporting the bug using the jasshelper thread.

I'll go do that now. I assumed you already knew about it because I made a thread trying to figure out what was going wrong before. You posted in it.