HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

can vjass add new grammar "after call" ?!

07-03-2007, 11:54 AM#1
hackwaly
I really like the vjass grammar.it's very useful.
but I guess it's not enougth powerful.
I think vjass can add a new grammar——after call

eg.

after 2.0 call Func(a,b)
it means use an timer after 2.0 seconds call the function Func and pass the argus(a,b).
we know in jass there is no way to pass argus to a code when we use a timer for run it.
for solving this problem, we used the handle system in the past.

the code "after 2.0 call Func(a,b)" can be wrote as follow:
functiono acFunc takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer a = GetHandleInteger(t,"acp1")
local integer b = GetHandleInteger(t,"acp2")
call Func(a,b)
endfunction

timer t = CreateTimer()
setHandleInteger(t,"acp1",a)
setHandleInteger(t,"acp2",b)
call TimerStart(t,2.0,false,acFunc)

using gamecache is not good. we can use the array instead it.
I'v wrote an varsystem instead of the handleSys.

of cause, you can use any other better handlesystem without gamecache which it offer functions such as SetHandle_ GetHandle_ DelHandle_

easily find all of that is so complex.
if vjass offer this grammar(after call), we can do something more easily!
such as wait exact time then do something.
so, vjass will be much powerful!
07-03-2007, 01:04 PM#2
Vexorian
no, it can't.

That isn't reall needed, if anything it just adds more syntax. Making delayed function calls is not something that you require a new feature for.

Check timelib at : http://www.wc3campaigns.net/showthread.php?t=93785


And using 'handlesystems' for that is terrible.