Me again.
In the matter of the very useful DOpus.Output method I want to understand the Argument syntax and options.
As you can see in the screenshot the manual gives the arguments as follows:
<string:text>
[<bool:error>]
[<bool:timestamp>]
I am often doing these kinds of output so I know they work:
DOpus.Output("Blah fixed String")
DOpus.Output("Variable Var_Str is :" + Var_Str)
Q1 Single Argument with Options?
I presume the square brackets in the argument syntax mean those arguments are optional?
If so should there be commas separating the 3 entities?
So on one line then would this be (more) accurate? See below:
<string:text>, [<bool:error>], [<bool:timestamp>]
Q2 How does this work
In this script Command.Select.ByDate I find the code fragment below which apprears to work.
How does it fit into either of the syntax formats set out above?
Or have I not understood things?
Yes sorry for confusion, this is some javascript magic
As already stated above, it evaluates to the value of e, if e is not specified (passed as an argument) to false.
So you can call the Log function from my code by
Log("no error")
Log("no error, same as above", false)
Log("error", true)
this comes close to the "default value" of parameters you might now from other languages, in this case i use a C# example
void Log(string msg, bool e = false) { ...
Not sure if you are on the right way here, but a more accurate notation would be
because if you are using the timestamp param you would need to pass error also, because otherwise the value you wanted for timestamp it would be used for error. It wouldnt end in a syntax/type error but in a semantic error since error and timestamp are both boolean values.