• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] textmacro error - Not a valid identifier name

Status
Not open for further replies.
Level 17
Joined
Sep 8, 2007
Messages
994
Hello folks,

as stated in the thread's name I keep getting the error "Not a valid identifier name". Can't figure out what's wrong here, but since this is my first time using textmacros, I guess I maybe just did a common mistake. Here's the code:

JASS:
//!textmacro SpecList takes NAME, KEY
        public method $NAME$ takes integer $KEY$ returns thistype
           local Element temp = .head
           local Element copy
           local thistype newLL = thistype.create()
           
           if .head == 0 then
                return newLL
           endif
           
           while temp.getNext() != 0 
                if temp.get$KEY$() == $KEY$ then
                    call newLL.addElement(temp.copyElement())
                endif
                set temp = temp.getNext()
           endwhile
           
           return newLL
        endmethod
        //!endtextmacro
        
        //!runtextmacro SpecList("createSpecParentList", "ParentID")
        //!runtextmacro SpecList("createSpecAbilityList", "AbilityID")

I know, I just easily could copy-paste the method and change the values manually, but hey, why not making use of something advanced if you could!
Help's appreciated.
 
Last edited by a moderator:
Status
Not open for further replies.
Top