"pass" statement

Share your ideas as to how the documentation can be improved.
iseahound
Posts: 1451
Joined: 13 Aug 2016, 21:04
Contact:

"pass" statement

02 Jul 2023, 14:13

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.
lexikos
Posts: 9629
Joined: 30 Sep 2013, 04:07
Contact:

Re: "pass" statement

08 Jul 2023, 22:05

Use an empty block.
iseahound
Posts: 1451
Joined: 13 Aug 2016, 21:04
Contact:

Re: "pass" statement

13 Jul 2023, 16:27

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.

Return to “Suggestions on Documentation Improvements”

Who is online

Users browsing this forum: No registered users and 3 guests