Difference between revisions of "MessageBox"

Jump to navigation Jump to search
1,352 bytes added ,  17:02, 7 May 2006
Added syntax for formating variable-output
imported>Stryfe
m (Stupid spelling mistake. Previous version specified number of buttons to 10.)
imported>JOG
(Added syntax for formating variable-output)
Line 1: Line 1:
== Description ==
'''Syntax:'''
'''Syntax:'''
  MessageBox "Message", [var1], ..., [var9], ["button01"], ..., ["button10"]
  MessageBox "Message", [var1], ..., [var9], ["button01"], ..., ["button10"]
Line 15: Line 16:
This function sends the value -1 to the GetButtonPressed function while the window is still open, until the player selects a button.
This function sends the value -1 to the GetButtonPressed function while the window is still open, until the player selects a button.


Formatting notation:


%.2f  
 
== Displaying Variables ==
 
===Formatting notation===
 
'''%.2f'''


This means format the variable with 2 decimal places.  
This means format the variable with 2 decimal places.  


%.0f  
 
'''%.0f'''


This will format the variable with 0 decimal places, so is the normal choice for integers.  
This will format the variable with 0 decimal places, so is the normal choice for integers.  
'''%5.0f'''
The number in front of the point specifies the minimum width of the number. In this case, there will always be enough space in front of the number for 5 digits:
Number    12 wins
Number  1234 wins
===Formating switches===
The following formatting switches can be used in Oblivion. Put them in any sequence right after the '%'
{|border="1" cellpadding="5" cellspacing="0"
|-
! style="background:#efefef;" | Switch
! style="background:#efefef;" | Function
|-
|<nowiki>+</nowiki>
|Display + in front of positive numbers
|-
|<nowiki><Space></nowiki>
|Leave a leading space in front of positive numbers
|-
|<nowiki>-</nowiki>
|Use left-aligned formation instead of right alligned.
|-
|<nowiki>0</nowiki>
|The filling-char used for formatting is '0' instead of ' '
|}
===Other Functions===
'''%d'''
This one works just like "%.0f", displaying 0 decimal places.
'''%.3e'''
Shows numbers in scientific formation (123000 = 1.23E+5)
===Examples===
'''Messagebox "Var1:% 5.2f / Var2:% 5.2f"'''
"Var1:  123.45 / Var1:  -123.45"
'''Messagebox "Var1:%05.2f / Var2:%05.2f"'''
"Var1: 00123.45 / Var1:-00123.45"
'''Messagebox "Var1:%+-5.0f / Var2:%+-5.0f"'''
"Var1:+123  / Var1:-123  "
'''Messagebox "Var1:% .3e / Var2:% .3e'''
"Var1: 1.234E+2 / Var2:-1.234E+2"


==See Also==  
==See Also==  
Anonymous user

Navigation menu