Promotic

StringScan - method of the Pm object

Description:
Reading the data from the text string formatted in the C language convention.
This method is obsolete (but functional) and it is better to use the PmFormat.Scan method.
Syntax:
Array StringScan(String sFormat, String sSource)
Parameters:
sFormat(String) Formatting rule written in the C language convention. See C language formatting rule. For real numbers the number of decimal places mustn't be stated (instead of "%5.2f" must be only "%5f").
sSource(String) string from which data are read according to the format
Return value:
This data are returned by the method in the array of values (PmArray object for JavaScript or Array data type for VBScript).
Note:
This method is functional also in Macro expression $.expr and in the onDraw event of the PmgCanvas object.
This method is also functional in Web panels.
 
HexaString (a text string in hexadecimal) can be used in two ways:
1) Display numbers in hexadecimal, where the higher orders are on the left. It corresponds to the storage in memory of Big-endian. This is the conversion of a number value into a text string (and vice versa) using a formatting string. To use HexaString in this way, it is recommended to use the PmFormat object.
2) Encoding the contents of a memory section of a certain size (e.g. 1B, 2B, 4B, ...) in hexadecimal. Then it depends on how the number is stored in memory. On Intel and AMD processors (x86 or x64 architecture), the so-called Little-endian is used, where the lower orders are on the left. To use HexaString in this way, it is recommended to use the PmBuffer object, which can handle both Little-endian and Big-endian.
See also:
Example:
JavaScriptVBScriptSelect and copy to clipboard

var nTemperature, nPressure;
var sText = "Temperature=25.48, Pressure=112.8";
var aData = Pm.StringScan("Temperature=%5f, Pressure=%5f", sText);
nTemperature = aData.GetItem(0);
nPressure = aData.GetItem(1);
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Sin
- StringScan
 
 
- Tan
© MICROSYS, spol. s r.o.