Please enable JavaScript to view this site.

 

str = PeekTokenValue(nDate,sToken)

 

This macro function returns the value that the token sToken (or a string containing one or more tokens) will have on the date nDate.

 

The function PeekTokenValue does almost exactly what the function EvalToken does, except that it discards any side-effects encountered during the evaluation of tokens (thus avoiding spurious occurrences of message 108509).

 

This applies to formatting side effects generated while evaluating the supplied tokens. PeekTokenValue returns their replacement text without the formatting markers generated by those side effects. It does not remove formatting markers already present in the input string.

 

When token evaluation produces no formatting side effects, its result is the same as EvalToken.

 

•Use PeekTokenValue if you just want to see the result of evaluating the token string sToken is, and then plan not to use it further (as part of sResult).

•Use EvalToken if you plan to use the result of evaluating the token string sToken in sResult.

Finally, as is the case for the function EvalToken, you should not include any DayValue in sToken as explained here.

 

See also: EvalToken.

 


Topic 181675, last updated on 09-Oct-2026