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. |
---|
Example1:
JavaScriptVBScriptSelect and copy to clipboard
var oFmt = Pm.CreatePmFormat("Type:String;LTxt:N_48_;");
var val = oFmt.Scan("N_48_Test");
// val="Test"
Dim oFmt
Set oFmt = Pm.CreatePmFormat("Type:String;LTxt:N_48_;")
Dim val
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
Dim oFmt
Set oFmt = Pm.CreatePmFormat("Type:Int;Radix:16;LTxt:0x;")
Dim val
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
Dim oFmt
Set oFmt = Pm.CreatePmFormat("Type:Float;LTxt:Temperature ;RTxt:°C;DLen:0;")
Dim val
val = oFmt.Scan("Temperature 33.6°C")
' val=33.6