You are here: Core Reference > Coding > Scripting > Query.SetParamControl

Query.SetParamControl

The Query.SetParamControl function allows the script to define the values for the query parameters (where applicable).

Syntax

Query.SetParamControl (<Parameter Number>, <Parameter Value Source>)

Description

Defines the value for any required parameters.

Arguments

<Parameter Number> {integer}

The Parameter Number is the Index number of the parameter. 0 is the first parameter, 1 is the second parameter, 2 is the third parameter and so on. Do not enter the angle brackets <>.

 

<Parameter Value Source> {Control}

The Parameter Value Source references the control on the Form that is the source of the value for the parameter.

Returns

None

Example:

In the following excerpt from a script, the SetParamControl function is used to set the first parameter (parameter 0) to the value provided by the E variable (the entry entered into the edit box that is represented by E in the script).

  • Dim E
  • Set E = Form.AddEditBox( 1, 1, 150 )
  • Dim Query
  • Set Query = Form.AddQuery( 1, 3, 150, 20, "SELECT Name, TypeDesc FROM CDBObject WHERE Name LIKE ? || '%'" )
  • Query.SetParamControl 0, E

NOTE: If the parameter is a boolean, the control for the parameter has to be a check box control. Similarly, if the parameter is a date/time value, the control for the parameter has to be a date/time control.


ClearSCADA 2015 R2