[vJass] TextMacro

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Is there a way such as:
JASS:
//! textmacro tt takes t1
function SomeFunc$t1$ takes nothing returns nothing
endfunction
//! endtextmacro

function SomeFuncFunc takes nothing returns nothing
local integer start = 1
    loop
    exitwhen start>10
        //! runtextmacro tt(I2S(start))
    set start = start +1
    endloop
endfunction
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
No, for two reasons.

A) You'll nest functions here.
B) You must give a string between "" it's not like WE strings.
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Textmacros are not dynamic. They are created first; even before the parser does its magic and converts the vJASS to normal JASS.
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Some times I saw something like //! library SomeLib and //!endlibrary.
Then, what it is?
 
Reaction score
456
It's some old way.. which shouldn't be used anymore.. dunno exactly:

Using //! prefix for library commands has no sense.
It is a compatibility leftover from ages ago, just remove it or it might add unnecessary confusion.

~Cohadar
 
Reaction score
456
If the latest Jass Helper is in NewGen v1.4b.. it doesn't give syntax error for me :p..
 

The_Kingpin

Member (Who are you and why should I care?)
Reaction score
41
Textmacros are basically automatic copy-and-pastes with different values.

Exampel:

JASS:
//! textmacro mynameis takes name
function MyNameIs$name$ takes nothing returns nothing
     return "Hello, my name is $name$!"
endfunction
//! endtextmacro

//! runtextmacro mynameis("Peter")
//! runtextmacro mynameis("Lois")

call MyNameIsPeter() // Hello, my name is Peter!
call MyNameIsLois() // Hello, my name is Lois!
call MyNameIsChris() // Syntax error.


If textmacros were dynamic, we'd all be in heaven now wouldn't we? :p
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
I am just getting lazy for copying 12 times of the //! runtextmacro only. :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top