Promotic

Scan - method of the PmFormat object

Description:
Conversion of a text string to a value according to the specified format.
Syntax:
Variant Scan(String sString)
Parameters:
sString(String) Text string that will be converted to a value according to the specified format.
Note:
This method is also functional in Web panels.
Example1:
JavaScriptVBScriptSelect and copy to clipboard

var oFmt = Pm.CreatePmFormat("Type:String;LTxt:N_48_;");
var val = oFmt.Scan("N_48_Test");   // val="Test"
Example2:
JavaScriptVBScriptSelect and copy to clipboard

var oFmt = Pm.CreatePmFormat("Type:Int;Radix:16;LTxt:0x;");
var val = oFmt.Scan("0xB");   // val=11
Example3:
JavaScriptVBScriptSelect and copy to clipboard

var oFmt = Pm.CreatePmFormat("Type:Float;LTxt:Temperature ;RTxt:°C;DLen:0;");
var val = oFmt.Scan("Temperature 33.6°C");   // val=33.6

History:
Pm9.00.17: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.