Property

In AskiaScript, a property of an object is like a field: it contains information within the object. For example, a question has a caption, so the member caption is a property of the object question.

To access the property of an object, we use a dot (.) after the variable name and then use the name of the property, as in most modern programming languages. For example, let's imagine that we have a question with the shortcut gender and we want to obtain its caption, we can do that by using the following syntax:

gender.Caption

In this example, we using the name of the variable gender and we access its caption by using the dot (.) separator.

In most programming languages, a property of an object can be read-and-write, write-only or read-only. To keep  AskiaScript simple, almost all its properties are read-only, meaning that if you try to assign a value to a property, you will, in most cases, obtain an exception (error), as in the following example:

gender.Caption = "abc"

The property 'name_of_property' is read-only; you cannot assign a value to it.

Create your own Knowledge Base