StringFormat - method of object Pm

Writing an array of values into the string according to the formatting rule
StringFormat(sFormat As String, vParams As Variant) As String
s = Pm.StringFormat(sFormat, vParams)
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.
The method can also be called in the graphic item events for Web panels.

The method is functional also in Macro expression $.expr and in the onDraw event of the PmiCanvas graphic item.

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);
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);
PROMOTIC 8.3.21 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
- 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