Functions
Functions can be invoked from script that have been registered with this engine in a host language.
$<function_name>(param_name1: value1, param_name2: value2, ...)
Function arguments can be written in any order. and if you omit an argument it takes a default value of that type. You can use your custom functions in Simpleflow script. Please refer to these sections of documentation to register and use custom functions. Register Custom Function | Custom Function - Example
Function | Syntax/Examples |
---|---|
Date | $Date(y: int, m: int, d: int, [h:int, mn: int, s: int]) let d1 = $Date(y: 2022, m: 7, d:11) let d2 = $Date(m: 10, d:25, y: 2022 ) let t1 = $Date(m: 10, d:25, y: 2022, h:13, mn:30 ) |
GetCurrentDate | $GetCurrentDate() |
GetCurrentTime | $GetCurrentTime() |
GetCurrentDateTime | GetCurrentDateTime(timeZone: string)Windows Timezones List Ubuntu Timezones List let today = $GetCurrentDateTime() let todayEst = $GetCurrentDateTime ( timezone: "Eastern Standard Time" ) |
Substring | $Substring(input: string, startIndex:int, length: int) |
IndexOf | $IndexOf(input: string, value:string, startIndex: int) |
Length | $Length(input: string) |
Contains | $Contains(input: string, value:string) |
StartsWith | $StartsWith(input: string, value:string) |
EndsWith | $EndsWith(input: string, value:string) |
Trim | $Trim(input: string, value:string) |
Match | $Match(input: string, pattern:string) |
Concat | Concat(value1: string, value2:string, value3:string, value4:string, value5:string) let value = $Concat ( value1: "I ", value2: "got it" ) |