Promotic
WikipediaLinkedInYoutubeTwitterFacebook

StringFormat - method of object Pm

Description:
Writing an array of values into the string according to the formatting rule
Syntax:
StringFormat(sFormat As String, vParams As Variant) As String
Calling:
s = Pm.StringFormat(sFormat, vParams)
Parameters:
sFormat(String) Formatting string written in the C language convention. See C language string format specification.
vParams(Variant) The parameter can be:
- Elementar data type (Integer, Double, String) if the sFormat contains single value format or
- Array of values (Array) if the sFormat contains multi value format.
Note:
The method can also be called in the graphic item events for Web Panels.

The method is functional also in Macro expression $.expr.

Example1:
Formatting a single Integer type value for hexadecimal view
Example for VBScript language:
Dim nVal, sVal
nVal = 1024
sVal = Pm.StringFormat("%05x", nVal)
Example for JavaScript language:
var nVal = 1024;
var sVal = Pm.StringFormat("%05x", nVal);
Example2:
Formatting multiple values simultaneously
Example for VBScript language:
Dim aData, n1, n2, sVal
n1 = 11.2
n2 = 1002.4
aData = Array(n1, n2)
sVal = Pm.StringFormat("Temperature=%3.2f, Pressure=%5.1f", aData)
Example for JavaScript language:
var n1 = 11.2;
var n2 = 1002.4;
var aData = Pm.CreatePmArray().Array1(n1, n2);
var sVal = Pm.StringFormat("Temperature=%3.2f, Pressure=%5.1f", aData);
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Sin
- StringFormat
 
 
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice