ADX Property type object

Available from version 5.3.3.

In AskiaScript, the ADX property type object represents a property exposed by the ADX. This object is accessible through the CurrentADC.Properties[ index ] / CurrentADP.Properties[ index ] properties or CurrentADC.GetProperty( propertyId ) / CurrentADP.GetProperty( propertyId ) methods.

See also:

 
In this topic:
 

Properties

Id

Returns the ID of the property.

Returns a String.

Example
CurrentADC.Properties[1].Id  ' => "tickColor"

↑ Top of page ↑

Type

Returns the property type. The possible types are:

Returns a String.

Examples
CurrentADC.Properties[1].Type  ' => "color"
CurrentADP.Properties[1].Type  ' => "string"
CurrentADC.Properties[2].Type '  => "question"

↑ Top of page ↑

Value

Updated in version 5.4.2.
Warning: backwards compatibility.

Prior to the version 5.4.2, this property returned a string.

Returns the value of the property. If the value of the property is an object (like a question), the system calls its ToString() method. If you want to access the question object associated with the property, use the property Question instead.

Returns a Variant.

See also: the methods PropValue or Var of the ADX.

Examples
CurrentADC.Properties[1].Value ' => "FlashEnable"
CurrentADC.Properties[2].Value ' => "0,255,0"
CurrentADP.Properties[3].Value ' => 1 (boolean)
CurrentADC.Variables[3].Value ' => "{
"shortcut":"q1", 
"shortCaption":"Q1", 
"longCaption":"Q1", 
"type":"single" 
}"

↑ Top of page ↑

Question

Returns the question associated with the property.

Returns a Question.

Warning: If the property has no question type, attempting to read the question will cause an exception (error). Be sure to validate the type of the property with a condition, as follows:

If CurrentADC.Properties[1].Type = "question" Then

 

See also: the method PropQuestion of the ADX

Examples
CurrentADC.Properties[1].Question 
' => <Question::Q1_Other>
CurrentADC.Properties[1].Question.Shortcut ' => "Q1_Other"

↑ Top of page ↑

Methods

ToString()

Returns a string which represents the ADX Property object in JSON notation.

Returns a String.

Examples
CurrentADC.Properties[1].ToString() ' => {
       "id"     : "tickColor",
       "type" : "color",
       "value" : "0,255,0" 
   }
CurrentADC.Properties[2].ToString() ' => {
      "id"     : "radioButtonImage",
      "type" : "image",
      "value" : "../Resources/[SurveyName]/MyImage.png" 
   }
CurrentADC.Properties[3].ToString() ' => {
      "id"    : "tickAlign",
      "type" : "string",
      "value" : "right" 
   }
CurrentADC.Properties[1].ToString() ' => {
      "id"    : "maxValue",
      "type" : "number",
      "value" : 12
   }
CurrentADC.Properties[1].ToString() ' => {
      "id"    : "useImage",
      "type" : "boolean",
      "value"  : true
   }
CurrentADC.Properties[1].ToString() ' => {
      "id"    : "questionOther",
      "type" : "question",
      "value" : {
            "shortcut" : "other", 
            "shortCaption" : "Other brand", 
            "longCaption"  : "Please specify:", 
            "type"       :  "open" 
      }
  }

↑ Top of page ↑

TypeOf()

Always returns "adx-property".

Returns a String.

Examples
CurrentADC.Properties[i].TypeOf() ' => "adx-property"
CurrentADP.Properties[i].TypeOf() ' => "adx-property"

↑ Top of page ↑

Create your own Knowledge Base