On "some" cpp printf() web pages there can be positional specifiers in the format string. You can pass the parameters in a certain order, then they will be be evaluated in a different order.
Code: Select all
on testFormat
local tFormat, tPosFormat, tA, tB, tC
put "%s,%s,%s" into tFormat -- standard format string
put "%3$s,%2$s,%1$s" into tPosFormat -- format string with 3$,2$,1$ positional specifiers
put "A" into tA -- some test params
put "B" into tB
put "C" into tC
answer format(tFormat,tA,tB, tC) -- msg box with "A,B,C"
answer format(tPosFormat, tA, tB, tC) -- throws error (I was expecting a msg box with "C,B,A")
end testFormat