This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ==== strformat ==== Formats a string with placehoders === Description === <code>strformat( dest[], size, bool:pack, const format[], {Fixed,Float,_}:... )</code> Formats a string with C-style //printf// placeholders. Possible placeholders are: * %d : integer number * %c : character * %f : floating point number * %x : hexadecimal number * %s : string Insert a number between the % and the letter to pad the field with spaces to a specific length.\\ Example: ''%4d'' === Parameters === | ''dest'' | Destination buffer | | ''size'' | Size of the destination buffer in 'cells'. | | ''pack'' | Creates a packed string if set to true | | ''format'' | String with placeholders | | ''...'' | Variable number of parameters | === Return value === Returns 1 if successful.\\ Returns 0 on error. === Example usage === <code javascript> new s{40}; new a = 5; new b{20} = "cats"; strformat(s, sizeof s, true, "The dog likes %d %s.", a, b); // returns 1 // s now contains "The dog chased 5 cats." </code> ezeio2/scriptref/strformat.txt Last modified: 2019-09-02 21:43by andreh Log In