You shouldn’t really be using the do command, it can cause the code to run slower and will bypass the compiler so can let weird, unintended errors slip through.
I would use the “put” command:
put test()
This will run the function but then not do anything with the output. You will see the output in the log, but the return value will otherwise be ignored.
You can also change the function to a handler instead .
Thanks, this is interesting… what would be a ready reconer in the decision to use function over to?
I find the documentation doesn’t really come down on a hard preference or advisory “do it this way if…”
In our case we sue the functions to supply a return of success and additional info, but on some cases we are not worried about the return on that call the function
If you use a to handler, it can be called as either a command or as a function. The handler can return a value, which will be ignored if you call it as a command: test // any return value is ignored
Or you can call it as a function and use the return value: put test() into theAnswer
If you don’t want to change your function to a generic to handler, you can ignore the result in 3 different ways:
put test() – as Anne suggested, although this will display the value in the output
get test() – this will store the value in the variable it
put test() into void – store the value in the variable void (or any other dummy variable name you choose)