Subject: on help…
I haven’t been coding much in 8.5.1 because it sucks, but when I do I use the HTML help. From my point of view, it’s nearly the same as the db help because I never search or use the index. I always go to the contents, and with the HTML help it simply added another click when I start looking for something.
And there’s also the fact that I’m not coding in JavaScript or X-Pages (what’s that?
so I haven’t had the opportunity to experience the issues you’re having. The HTML help for LotusScript is exactly the same as the DB version, so I’m not missing anything (didn’t gain anything, though…)
As for Dim, look under…
Lotus Domino Designer Basic User Guide and Reference
LotusScript Language
Data Types, constants, and Variables
Declaring scalar variables explicitly
"It’s important to explicitly declare all variables. For example:
DIM X, Y AS INTEGER
results in Y being data-typed as INTEGER but X as Variant. The correct syntax is:
DIM X AS INTEGER, Y AS INTEGER"
Here’s another one that drives me nuts when I see it…
Set doc = db.GetDocumentByUNID( someunid )
If doc is nothing then…
But you’ll never get nothing. The help says that an error is raised instead.
“Not matching the UNID to a document in the database raises lsERR_NOTES_BAD_UNID (4091).”
And I also see…
returncode = agent.RunOnServer
If Not returncode then
execute-something-when-returncode-is-0
…thinking that the code will only execute when the result is 0 (no error.) But the code executes when returncode is non-zero as well, because “Not” is not a boolean reverser…it’s a negation operator. As explained in the help, It takes what you give it, changes the sign, and subtracts 1. So a returncode of 0 become -1 (taken as true) but a returncode of 23 becomes -24 (also taken as true.) I had to correct something along these lines just a few weeks ago, coded by hired help.
Both of these cases also raise another issue of people not testing every branch of their code…but that’s a different rant altogether!