clarification of 'IF' - solved

Forum for discussion about the documentation project.
caseih
Posts: 1612
Joined: Feb 26, 2007 5:32

Re: clarification of 'IF'

Postby caseih » Jan 20, 2021 2:37

The best you can do is edit the post and change it to say something like, "deleted."
fxm
Posts: 10193
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: clarification of 'IF'

Postby fxm » Jan 20, 2021 6:03

Documentation updated:
KeyPgIfthen → fxm [added example]
(not to complicate, the 2 examples work whatever the dialect used)
robert
Posts: 145
Joined: Aug 06, 2019 18:45

Re: clarification of 'IF'

Postby robert » Jan 20, 2021 7:26

caseih wrote:The best you can do is edit the post and change it to say something like, "deleted."


Thanks caseih.

Done.
speedfixer
Posts: 457
Joined: Nov 28, 2012 1:27
Location: California

Re: clarification of 'IF'

Postby speedfixer » Jan 20, 2021 7:52

Thank you, fxm

david
fxm
Posts: 10193
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: clarification of 'IF'

Postby fxm » Jan 20, 2021 9:50

In yet another previous topic (viewtopic.php?f=9&t=24977), Tourist Trap had proposed a more generic definition of syntax at the top of the documentation page:
Tourist Trap wrote:...
I think I've found the trick then:
If expression Then statement [ : statement(s)]
or
If expression Then [statement(s)] Else [statement(s)] [End If]
or
If expression Then [ : [ [statement(s)] [ {[ ElseIf expression Then : ]} Else [statement(s)] :]] ] End If
or
multiline


Who has said that the most frequent keywords are the simplest ;-)
but I didn't used it for the documentation page because the 3rd syntax is a little too complex to dissect for a user, and moreover the use of elseif in a single-line syntax is not supported by the 'qb' dialect.
(in addition, I didn't check it !)
speedfixer
Posts: 457
Joined: Nov 28, 2012 1:27
Location: California

Re: clarification of 'IF' - solved

Postby speedfixer » Jan 20, 2021 19:50

For most purposes, I think simpler is better, and examples can display what the imperfect text cannot. This isn't an ISO language, after all.
I suggest you not change anything else on that page. I wouldn't have started this thread if I knew a fight would start over a single word.

Many of the keywords could have pages and pages of explanation. Valuable for some, but a waste of time for most. Every language has 'trick syntax' that seem to break the rules. The 'trick' is usually the poor published explanation, not the actual use rules. Sometimes, there is no simple way to explain some usage, and verbose explanations make it seem too complex. Simple is better. Apologize and explain later.

Someone could collect weird, unusual, seemingly rule-breaking code examples on a tutorial page and explain how they work and why they work.
Away from the official docs, but available. At least the hunt for some of these difficult to define, or difficult to list items would have a home.

I remember the time I spent trying to find the reference on the bitfield assignment (in TYPE). It was very frustrating.
That is still true. I just looked: there is no reference to the TYPE page from any 'bit' related page or reference, anywhere.
Not in Assignment operators or Indexing operators, Bitwise operators, UDT, etc. Nowhere. A 'Using Bits' topic page would be best, maybe.

david
fxm
Posts: 10193
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: clarification of 'IF' - solved

Postby fxm » Jan 20, 2021 20:12

And yet, 109 pages of documentation refer to this 'TYPE' page !

But if we search for the term 'bitfield[s]' in the documentation, we get reference to only 5 pages (obviously including the 'TYPE' page).
So easy !

Return to “Documentation”

Who is online

Users browsing this forum: No registered users and 5 guests