- Joined
- Aug 11, 2014
- Messages
- 4
If I recall from vJASS macros, they are used to define a variable that will be substituted when the macro is run. I did use them >4 years ago so I could be wrong...Lol you can't use '$' symbol in JASS , nor in GUI , y'know...
Give me spell's map file I will correct it
//!textmacro ALLOCATE takes NAME
globals
integer $NAME$I = 0
private integer $NAME$FreeAm = 0
private integer $NAME$MaxId = 0
private integer array $NAME$FreeAr
private boolean array $NAME$IsUsed
endglobals
function $NAME$alloc takes nothing returns nothing
if $NAME$FreeAm == 0 then
set $NAME$MaxId = $NAME$MaxId + 1
set $NAME$I = $NAME$MaxId
else
set $NAME$I = $NAME$FreeAr[$NAME$FreeAm]
set $NAME$FreeAm = $NAME$FreeAm - 1
endif
set $NAME$IsUsed[$NAME$I] = true
endfunction
function $NAME$clean takes integer index returns nothing
set $NAME$IsUsed[index] = false
set $NAME$FreeAm = $NAME$FreeAm + 1
set $NAME$FreeAr[$NAME$FreeAm] = index
endfunction
//!endtextmacro
//!runtextmacro ALLOCATE ("te_")
//!runtextmacro ALLOCATE ("sh_")
//! textmacro ALLOCATE takes NAME
globals
integer $NAME$I = 0
private integer $NAME$FreeAm = 0
private integer $NAME$MaxId = 0
private integer array $NAME$FreeAr
private boolean array $NAME$IsUsed
endglobals
function $NAME$alloc takes nothing returns nothing
if $NAME$FreeAm == 0 then
set $NAME$MaxId = $NAME$MaxId + 1
set $NAME$I = $NAME$MaxId
else
set $NAME$I = $NAME$FreeAr[$NAME$FreeAm]
set $NAME$FreeAm = $NAME$FreeAm - 1
endif
set $NAME$IsUsed[$NAME$I] = true
endfunction
function $NAME$clean takes integer index returns nothing
set $NAME$IsUsed[index] = false
set $NAME$FreeAm = $NAME$FreeAm + 1
set $NAME$FreeAr[$NAME$FreeAm] = index
endfunction
//! endtextmacro
//! runtextmacro ALLOCATE ("te_")
//! runtextmacro ALLOCATE ("sh_")
//!textmacro ALLOCATE takes NAME
//!endtextmacro
//!runtextmacro ALLOCATE ("te_")
//!runtextmacro ALLOCATE ("sh_")
You could have just told him it instead of trying to act all smart and all knowing. Which reminds me...Give me spell's map file I will correct it
That was not helpful at all.Lol you can't use '$' symbol in JASS , nor in GUI , y'know...
The macro was incorrectly declared and used (syntax error).
It was given as...
JASS://!textmacro ALLOCATE takes NAME globals integer $NAME$I = 0 private integer $NAME$FreeAm = 0 private integer $NAME$MaxId = 0 private integer array $NAME$FreeAr private boolean array $NAME$IsUsed endglobals function $NAME$alloc takes nothing returns nothing if $NAME$FreeAm == 0 then set $NAME$MaxId = $NAME$MaxId + 1 set $NAME$I = $NAME$MaxId else set $NAME$I = $NAME$FreeAr[$NAME$FreeAm] set $NAME$FreeAm = $NAME$FreeAm - 1 endif set $NAME$IsUsed[$NAME$I] = true endfunction function $NAME$clean takes integer index returns nothing set $NAME$IsUsed[index] = false set $NAME$FreeAm = $NAME$FreeAm + 1 set $NAME$FreeAr[$NAME$FreeAm] = index endfunction //!endtextmacro //!runtextmacro ALLOCATE ("te_") //!runtextmacro ALLOCATE ("sh_")
But should have been...
JASS://! textmacro ALLOCATE takes NAME globals integer $NAME$I = 0 private integer $NAME$FreeAm = 0 private integer $NAME$MaxId = 0 private integer array $NAME$FreeAr private boolean array $NAME$IsUsed endglobals function $NAME$alloc takes nothing returns nothing if $NAME$FreeAm == 0 then set $NAME$MaxId = $NAME$MaxId + 1 set $NAME$I = $NAME$MaxId else set $NAME$I = $NAME$FreeAr[$NAME$FreeAm] set $NAME$FreeAm = $NAME$FreeAm - 1 endif set $NAME$IsUsed[$NAME$I] = true endfunction function $NAME$clean takes integer index returns nothing set $NAME$IsUsed[index] = false set $NAME$FreeAm = $NAME$FreeAm + 1 set $NAME$FreeAr[$NAME$FreeAm] = index endfunction //! endtextmacro //! runtextmacro ALLOCATE ("te_") //! runtextmacro ALLOCATE ("sh_")
Basically...
Are all interpreted as comments unless there is a space after the '!'. It is possible that a custom vjass compiler was used or an old/alternative version which had less strict syntax. It clearly is explained in the vjass manual that there must be a space for it to register as a macro correctly.JASS://!textmacro ALLOCATE takes NAME //!endtextmacro //!runtextmacro ALLOCATE ("te_") //!runtextmacro ALLOCATE ("sh_")
You could have just told him it instead of trying to act all smart and all knowing. Which reminds me...
That was not helpful at all.