You are here: Core Reference > Coding > Scripting > Form.AddQuery

Form.AddQuery

The Form.AddQuery function allows you to add a Queries List control to the Form. You will need to have a good understanding of the SQL language when using this function.

Syntax

Form.AddQuery(X, Y, Width, Lines, SQL Query)

Description

Adds a list control to a Mimic. The list control contains the results of the SQL Query that is defined in the script.

Arguments

X {integer}

Represents the horizontal position of the Date/Time field on the Form—the position on the 'X-Axis'.

 

Y {integer}

Represents the vertical position of the Date/Time field on the Form—the position on the 'Y-Axis'.

 

Width {integer}

Defines the width of the field.

 

Lines {integer}

Defines the approximate number of rows. Enter 1 for a single line row, or enter a number higher than 1 for a multiple rows.

 

SQL Query {string}

An SQL Query that defines which data is to be retrieved from the database and displayed in the Queries List control.

Returns

Query Control Object

Query Control Objects have common Control Object Properties as well as their own specific functions and properties that can be used in the script see Query Functions and see Query Properties.

Example:

Set QueryList = Form.AddQuery( 1, 3, 150, 20, "SELECT Name, TypeDesc FROM CMimic" )

This creates a 150 pixel wide, 20 line Queries List box that is positioned at 1 on the X-Axis and 3 on the Y-Axis. It contains the names and types of items in the CMimic class.

See also:

Query Functions

Query Properties.


ClearSCADA 2015 R2