Discussing the article: "StringFormat(). Review and ready-made examples"

 

Check out the new article: StringFormat(). Review and ready-made examples.

The article continues the review of the PrintFormat() function. We will briefly look at formatting strings using StringFormat() and their further use in the program. We will also write templates to display symbol data in the terminal journal. The article will be useful for both beginners and experienced developers.

The StringFormat() function formats the received parameters and returns the formatted string. The string formatting rules are exactly the same as for the PrintFormat() function. They were considered in detail in the article "Studying PrintFormat() and applying ready-made examples". A string with text and format specifiers is passed first followed by the comma-separated necessary data that should replace the specifiers in the string. Each specifier must have its own data set in strict order.

The function allows a once formatted string to be reused in a program. We will use this feature here when creating templates for displaying symbol properties to the journal. We will create two functions for each property: the first will format and return a string, while the second one will print the resulting string in the journal.

Author: Artyom Trishkin

Reason: