PMC websites shut down October 13th 2025 unless yearly web hosting fees are paid. Please Support PMC to help keep these websites online.

Enjoyed or found this pages content useful, please Support PMC to help me keep this web page online beyond october 13th 2025 when yearly web hosting fees are due.

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