Script appendix
In this topic:
Routing conditions
In an Askia survey, a routing instruction has three parts:
- the "when" (determines when the routing instruction is executed),
- the
condition (context of the execution) and
- the
action (what happens if the condition is satisfied).
In AskiaDesign, the following considerations apply:
- The first IF statement is implicit (never required)
- The returned expression is treat as boolean, even if it's not a concrete true / false boolean expression
- The evaluation is done on the latest expression or on the expression return by the return statement
Truthy/Falsy
Askia defines truthy and falsy values, which indicate how the expression returned by the condition will be treated.
The following expressions are considered False:
False ' => Explicit false
0 ' => Zero
DK ' => DK value
All other values are considered True.
Examples
Return Age ' => 2 (True)
Return 0 ' => False
Return DK ' => DK (False)
Dim Text = "ABC"
Return Text ' => "ABC" (True)
Reserved keywords (Index of keywords)
Constructor
- Dim
- Range
- { ; }
- # #
- & &
- " "
Accessors
- [ ]
- ( , )
- ?? ??
- %% %%
- ^ ^
Operators
- *
- +
- -
- /
- =
- <>
- <
- >
- <=
- >=
- Mod
- Has
- HasAll
- HasNone
- HasAndNoOther
- HasAllAndNotOther
- In
- IsIncludedIn
- Intersection
- Union
- As
Predefined values
- True
- False
- ResPath
- Now
- CurrentQuestion
- CurrentADC
- CurrentADP
- CrLf (Carriage return Line Feed)
Predefined objects
Execution flow
- If
- Then
- Else
- ElseIf
- EndIf
- And
- Or
- Not
- Return
- For
- To
- Next
- Break
- GoTo
Inline script specific
Reserved but not implemented
- While
- EndWhile
- Do
- EndDo
- Sub
- EndSub
- Function
- EndFunction
- End
- Private
- Public
- Protected
- Continue
- Global
- Const
- New
- Set
- Redim
- Object
- Array
- Integer
- Double
- String
- Number
- Date
- RegExp
- Undefined
- Null
- Error
- Question
AskiaScript 1.0 specific keywords
- Abs
- Avg
- DK
- Int
- Min
- Max
- Pow
- Sum
- CvDKNA
- IndexOfMax
- IndexOfMin
- Size
- CI
- CurrentItem
- ResponseCount
- ResponseCode
- ResponseCodeN
- ResponseText
- CDate
- Day
- WeekDay
- WeekDayAsString
- Month
- MonthAsString
- Year
- Hour
- Minute
- Second
- StartInterview
- EndInterview
- InterviewTime
- AgentName
- Browser
- CallId
- CcaCallCount
- CcaLastCall
- IntvwId
- IPAddress
- Mode
- Password
- AvailableQuota
- IsQuotaFullFor
- IsQuotaReached
- QuotaToDo
- OrderOf
- Other
- PrctDone
- Format
- GetParameter
- InStr
- IsDate
- IsEmail
- LCase
- Len
- Mid
- ReadBinaryFile
- ReadTextFile
- Replace
- UCase
- Val
- ForMax
- ForMin
- ForSet
- ForSum
- IsUKPostCode
- On
- Random
- SelectRandom
- Shuffle