Methods are functions that are used to perform operations on an object.
You access a method of an object by combining the object's name and the name of a method:
objectName.methodName(arguments)Just like in functions, arguments in method calls are optional.
We have already used the basic variable objects of Forsta Plus returned from the f function. We have seen some methods that can be applied on these objects to retrieve information about the questions in a Forsta Plus survey. For example will
f(qID).label()return the title of the question with ID qID, and
f(qID).get()the code or answer stored in the database for that question.
We have also seen a method that can be used to set the answer of a question:
f(qID).set(code)