Difference between revisions of "Template:OBSE Format Specifiers"

→‎Added as of v0014a: Fixed %{} and added example
imported>Haama
(→‎EX Formatting Functions: Updated to v0014a)
imported>Haama
(→‎Added as of v0014a: Fixed %{} and added example)
Line 44: Line 44:




'''%(...%)
'''%{...%}


Conditionally omits a portion of the format string based on a boolean value. The left bracket accepts a variable; if the value of the variable is zero, all text up to the right bracket will be ignored, and any parameters supplied to format specifiers within the omitted substring will be skipped.
Conditionally displays/omits the bracketed portion of the format string based on a boolean value. Accepts a variable - if the value of the variable is zero, all text and parameters up to the right bracket will be ignored.
*Example
MBoxEX "Doom comes%{ for you%}. What will you do?|Dig a hole, hide%{|Find someone, offer sacrifice|Find someone, use as shield%}|Enjoy your final 15 minutes" bDisplay bDisplay
If bDisplay is 0 this will print out
    Doom comes. What will you do?
    [Dig a hole, hide]
    [Enjoy your final 15 minutes]
If bDisplay is 1 this will print out
    Print this Omit this
    [Dig a hole, hide]
    [Find someone, offer as sacrifice]
    [Find someone, use as shield]
    [Enjoy your final 15 minutes]
Anonymous user