Navigation:  Macros > Macro Language > System Variables >


Previous pageReturn to chapter overviewNext page

The system variable sRESULT is not always used. However, whenever you want to pass a string as the result of a Macro, you will use sRESULT as it is the only variable that can be used.


For example, suppose you wanted a Macro token which displayed the number of days until Christmas (somewhat like the [t-] token), you would write code like this.


nDateXmas = EncodeDate(YearOf(n_TokenDate),12,25)

nDaysToXmas = nDateXmas - n_TokenDate

sRESULT = IntToStr(nDaysToXmas)


And then set the text replacement actions to "use sRESULT".


If you do not set a value for sRESULT, Q++ will assume it is blank.

Topic 105118 updated on 23-Jun-05.
Topic URL: