Actions ModifyVar - thica/ORCA-Remote GitHub Wiki
Modifies an existing variable. This is an inplace modification, so the given variable will be changed: a=fkt(a). If you need something like a=fkt(b), you need to copy the variable using setvar prior using this functions. "Increase" and "decrease" works on numeric variables only. "Invert" works on numeric (0/1) or on string variables (True/False). "Lowercase","Uppercase","Trim" works on string variables "Concatenate" , "Getpart", "Format" works on all variable types "Getlen" and "Find" are the only sub action, that will not modify the var, it will return the result in a different var "Load" and "Save" are options to create persistant variables. You can sav a variable value and reload the value at the next application start. Some note on "Getpart", which is to extract a part of string from a string. It follows python rules (eg.: string[start:end]) where start or end could be empty Fromvar converts a variable name into its variable value
Attribute | Description |
---|---|
string | modifyvar |
varname | Variable to use/modify |
parameter1 | First parameter for operator |
parameter2 | Second parameter for operator |
Operator |
Operator for the command. Use one of the following keywords
|
Remarks on some operators
Operator | Parameter1 | Parameter2 |
---|---|---|
increase | The delta value (like a=a+x) | Optional: The upper limit |
decrease | The delta value (like a=a-x) | Optional: The lower limit |
multiply | The Multiplier (like a=a*x) | |
devide | The Devidor (like a=a/x) | |
power | The power (like a=a^x) | |
concatenate | The string / stringvar to add (like a=a+"mystring") | |
getpart | The start position | The end position |
fromvar (gets the variable content from a variable name given in a variable) | The context of the var | |
delete either deletes a single var or an array if the var name ends with [] | ||
tovar (assigns a variable name to a new variable without variable replacement) | newvarname: the new var name, where the var name should be assigned to | |
format | The format string, following the python string.format syntax e.g.: "(int)FFFF00{0:0>2x}" | |
round | The rounding position (eg 0=round to int) | |
getlen | the destination var for the length | |
save | A prefix for the cookie name | |
load | A prefix for the cookie name | The default value, if no save value is available |
loadfile | The filename, from which the content should be loaded into the var | The default value, if no save value is available |
addtoarray | The var value to be added | Boolean, if 1, than only add, if value is not already in array |
removefromarray | The var value to be removed | |
exist | The var name to return, if the var exists (0/1) |
A short example:
<action name="" string="modifyvar" varname="DIMVALUE" operator="divide" parameter1="6.25"/>