User Tools

Site Tools


format

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

format [2008/05/05 23:54] – created format initial page snakemanformat [2017/01/21 19:15] (current) – deleted unused page. snakeman
Line 1: Line 1:
-====== Format ====== 
  
-Composes a string containing other variables or other variable types.  
- 
-Converts any variable type to a string.  
- 
-If you want to convert a string back to a number, use call.  
- 
-The array used with this command has to contain at least two items. 
- 
-**Syntax**:\\ 
-<code> 
-String = format ["FormatString", var1, var2 ...] 
-</code> 
- 
-**Parameters**:\\ 
-FormatString: String - a string containing references to the variables listed below in the array. The references appear in form of %1, %2 etc.\\ 
-var1: Any Value - variable referenced by %1\\ 
-var2: Any Value - variable referenced by %2, and so on 
- 
-**Return Value**:\\ 
-String - The full string is returned. 
- 
-**Example**:\\ 
-<code> 
-format ["Player side: %1 - Human players on that side: %2", side player, playersNumber side player] 
-</code> 
- 
-The format command is very strong in combination with call. Dynamic code can be created using format and then executed with call. It is not advisable to use this command with string arguments only. Better use + for string concatenation then. If variables don't exist, their value as string is generally "scalar bool array string 0xfcffffef". 
- 
-Object array parameters work very nicely. Eg:\\ 
-<code> 
-_MyArray = [Obj1, Obj2, Obj3]; 
-Hint Format["MyArray=%1", _MyArray]; 
-</code> 
format.1210031684.txt.gz · Last modified: 2008/05/05 23:54 by snakeman

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

All PMC web site download services are temporarily suspended until web site yearly fees have been recovered, want to download addons/mods? Then Support PMC.

If you are grateful for all the work PMC has done in the past 25 years, use Support PMC page.