What is the main usage of
I have a few examples.
Test A:
Result:
Test B:
Result:
Test C:
Result:
Test D:
Result:
Syntax Error
//! textmacro_once
? and Why we need this?I have a few examples.
Test A:
vJASS:
//! textmacro_once Sample
call BJDebugMsg("textmacro_once Sample")
//! endtextmacro
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
//! runtextmacro Sample()
//! runtextmacro Sample()
//! runtextmacro Sample()
endfunction
Result:
Code:
textmacro_once Sample
textmacro_once Sample
textmacro_once Sample
Test B:
vJASS:
//! textmacro Sample
call BJDebugMsg("textmacro Sample")
//! endtextmacro
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
//! runtextmacro Sample()
//! runtextmacro Sample()
//! runtextmacro Sample()
endfunction
Result:
Code:
textmacro Sample
textmacro Sample
textmacro Sample
Test C:
vJASS:
//! textmacro Sample
call BJDebugMsg("textmacro Sample")
//! endtextmacro
//! textmacro_once Sample
call BJDebugMsg("textmacro_once Sample")
//! endtextmacro
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
//! runtextmacro Sample()
//! runtextmacro Sample()
//! runtextmacro Sample()
endfunction
Result:
Code:
textmacro Sample
textmacro Sample
textmacro Sample
Test D:
vJASS:
//! textmacro_once Sample
call BJDebugMsg("textmacro_once Sample")
//! endtextmacro
//! textmacro Sample
call BJDebugMsg("textmacro Sample")
//! endtextmacro
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
//! runtextmacro Sample()
//! runtextmacro Sample()
//! runtextmacro Sample()
endfunction
Result:
Syntax Error
//! textmacro_once
and //! textmacro
are have a same result in Test A and Test B, but in Test C and Test D are different.