clarification of 'IF' - solved

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

Re: clarification of 'IF'

Post by caseih »

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

Re: clarification of 'IF'

Post by fxm »

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

Re: clarification of 'IF'

Post by robert »

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

Done.
speedfixer
Posts: 606
Joined: Nov 28, 2012 1:27
Location: CA, USA moving to WA, USA
Contact:

Re: clarification of 'IF'

Post by speedfixer »

Thank you, fxm

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

Re: clarification of 'IF'

Post by fxm »

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: 606
Joined: Nov 28, 2012 1:27
Location: CA, USA moving to WA, USA
Contact:

Re: clarification of 'IF' - solved

Post by speedfixer »

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
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: clarification of 'IF' - solved

Post by fxm »

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

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