Please enable JavaScript to view this site.

 

The result variable sRESULT is used to pass a string, as the result of a macro, to the current script's macros resulting actions.

 

Suppose you wanted a macro token which displayed the number of days until the next Christmas, you would write code like this.

nDateXmas = EncodeDate(YearOf(n_TokenDate),12,25)
if nDateXmas < n_TokenDate
   // if n_TokenDate is after December 25, look for next year's Christmas
   nDateXmas = EncodeDate(YearOf(n_TokenDate)+1,12,25)
endif
nDaysToXmas = nDateXmas - n_TokenDate
sRESULT = IntToStr(nDaysToXmas)

And then, in the script's macros options resulting actions dialog, you would set the text replacement actions to Replace token with sRESULT, as shown below.

 

 

If you do not set a value for sRESULT, it is assumed to be the empty string ('').

 

See also: macros resulting actions.

 


Topic 105118, last updated on 17-Oct-2026