Go to documentation repository
Page History
The StringToParams method transforms converts a String variable into the list of parameters and overwrites the existing parameter list of parameters of the MsgObject object.
Method call syntaxSyntax for method invocation:
Code Block | ||
---|---|---|
| ||
StringToParams(String params function StringToParams(params: String) |
Method arguments:
- params
...
- is a required argument.
...
- It specifies a variable of the String type
...
- that you want to convert into a list of parameters
...
- of the MsgObject object.
...
- Possible values:
...
- variables of the String type that match the syntax
...
- of the MsgObject objects parameter list representation:
“param1<value1>,param2<value2>…”, where
param1<value1>,param2<value2> - is a list of parameters and with their values. Elements of the list are separated by commas with no white spacewithout spaces. If no parameters need to be specified, an empty string is used after the vertical line (|), for example:“CAM “CAM|1|MD_START|”Usage examples
Example. Upon registration the connection (“Attach”) When registering an Attach event for any camera, of the cameras, re-initiate the Attach event in the system retrigger the “Attach” event with modified with changed values of the Number of the PTZ device (telemetry_id) and Number of the microphone for synchronous recoedingsynchronous recording (audio_id) parameters. The values should must be equal to the corresponding camera camera numbers plus 1.
Code Block | ||
---|---|---|
| ||
if (Event.SourceType == "CAM" && Event.Action == "ATTACH") { var i; for (i=1,i<=4;i=i+1) { var msg = Event.Clone(); var str = "telemetry_id<" + (i+1) +">,audio_id<" + (i+1) + ">"; msg.StringToParams(str); NotifyEvent(msg); } } |