Page 1 of 1

"pass" statement

Posted: 02 Jul 2023, 14:13
by iseahound
On the page for try, there is a try-catch-else construct.

If you don't need the catch to do anything, and you can't use return (as that would end the auto-execute section) a ("pass") string in parenthesis should be recommended:

Code: Select all

try Run "file.txt"
catch
   ("pass") ; or ("Do nothing")
else ; Runs only if opening the file succeded
   MsgBox "file opened"
In other words, this is only if you need try-else without catch. It would be unintuitive for new users to figure this out themselves.

Re: "pass" statement

Posted: 08 Jul 2023, 22:05
by lexikos
Use an empty block.

Re: "pass" statement

Posted: 13 Jul 2023, 16:27
by iseahound
block is defined as {} in the documentation but really is:

Code: Select all

{
}
which makes it visually unappealing:

Code: Select all

try Run "file.txt"
catch {
} else ; Runs only if opening the file succeded
   MsgBox "file opened"
but I concede the point.