Difference between revisions of "Format"

From SDU
Jump to: navigation, search
m
m
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
[[Category:Customizations]]
 
[[Category:Customizations]]
<div align='center'><font color="green">To make corrections or additions to this article, select the ''edit'' tab above.<br>
+
{{Global Header}}
To discuss or ask questions about this article, select the ''discussion'' tab above.</font></div>
+
{{Global Announcement}}
  
 
== Syntax ==
 
== Syntax ==

Revision as of 03:23, 27 July 2008

To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Syntax

string format(string expression, ... variables);

Escape Characters
Character Description
 %% percent sign
 %d int
 %s string

Example <source lang="text">format("Change number is %s", chg_ref_num); format("Change number is %s and description is %s", chg_ref_num, description);</source>

Formatting a UUID as a string

r11.x introduced a new data type known as the UUID which replaced the old integer ID in many areas, most notably with regards to Contacts. This change complicated the printing of the id which previously required only a %d. But since the UUID is not an integer, the %s is now the best solution.

Examples<source lang="text">string MyResult; MyResult = format( "The uuid of %s is : %s), assignee.userid, (string)assignee.id);

MyResult = format("&{U'%s'=cnt.id->combo_name}", (string)assignee.id);

MyResult = format("&{0x%s=cnt.id->combo_name}", (string)assignee.id);</source>