The C object is available in script code to expose the Questionnaire Controls in there raw/object format.
It is referenced directly by name.

"C" is an advanced construct that returns a GUI control or another kind of object such as a table.
It is used for only specific advanced manipulations of the questionnaire beyond the capabilities of the Q or V accessor.

"C" is Readonly, you cannot assign a value directly to it, however properties of the objects that are returned may accept a value written to them.
Example: Assigning a backcolor dynamically to a Textbox name "txt1"
       C("txt1").backcolor = color.yellow      ' color is a class in .NET that provides named colors and color methods.


This is the top level object, it is always present in script code and doesn't need to be crerated or assigned directly

It is always used to execute a contained method or access a child object inside the Questionnaire

Accessing Controls is the Default Property of the V object, but it can contain additional features

Note: The primary usage of "C" is to call subroutines and access methods of objects.


See the specific sub topics for functional code examples with this top level object

Create a reference to a Table object for later usage

Dim T as Table = C("Table Name")          ' assigns the table object to the variable
Dim rows() as integer = T.StartQuery()        ' do some kind of manipulation.

The below is the exposed object name in script which is always followed by something else that is valid

C("Control").Text = "56"       ' Assign the value "56" to the text property of the control named "Control"