If Type – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 19: Line 19:


:[[User:Planck|Planck]] 12:55, 24 March 2007 (CET)
:[[User:Planck|Planck]] 12:55, 24 March 2007 (CET)
----
::The if type is quite understandable by both you and I since we're used to programming and scripting. Getting back to the actual question, the term is indeed in need of a better definition. The reason for that is how it's used on the reference pages where it occurs ([[then]],[[exitWith]]). It is potentially confusing to newcomers to use the ''reserved word'' "'''if'''" to represent an "if type condition". The reserved word '''if''' and an ''if type condition'' are different things. A similar confusing use of reserved words is seen on the [[then]] page, where the reserved word '''else''' is used to represent the [[Code]] or [[Array]] that ends an if..then construct. In the end, I'm looking for two things:
::* A clear definition of the term '''if type'''.
::* Doing away with the misuse of reserved words in presenting the syntax of [[else]] and [[exitWith]].
::Perhaps we can solve the first one right here? It seems that the terms ''if type'' and ''if type condition'' are equivalent and refer to a language construct of the following form:
::: ''IfTypeCondition:''
:::: <tt>'''if''' ( expression )</tt>
::If that can serve as a definition of the term ''if type'', the article can be improved.
::[[User:Killswitch|Killswitch]] 14:44, 24 March 2007 (CET)

Revision as of 15:44, 24 March 2007

The article states that the so-called if type is a "helper type". I need a stricter definition of both the "if type" and the concept of "helper type" in general. To help you understand what I'm asking, look at the following:

if ( expression )

As you can see, that is an incomplete if statement. Is the term "if type" meant to refer to the part of an if statement consisting of the reserved word if followed by a boolean expression enclosed in parentheses, as exemplified above? If not, clarify in good, unambiguous english. Killswitch 02:01, 24 March 2007 (CET)


In the BI comref that I have the If Type is defined exactly the same way as the Wiki defines it.
If Type to my way of seeing it is perfectly understandable:
if exitWith code
The if in the syntax definition represents the fact that a conditional is the first parameter.
if is the condition, which can be the condition you write that determines when to exit, in this example.
if: If Type ... in the parameter section says what sort of conditional statement it is.
I agree that the If Type could probably do with a better definition, but the present definition does point to :the if and then commands to aid in determining what type of condition to use.
Planck 12:55, 24 March 2007 (CET)

The if type is quite understandable by both you and I since we're used to programming and scripting. Getting back to the actual question, the term is indeed in need of a better definition. The reason for that is how it's used on the reference pages where it occurs (then,exitWith). It is potentially confusing to newcomers to use the reserved word "if" to represent an "if type condition". The reserved word if and an if type condition are different things. A similar confusing use of reserved words is seen on the then page, where the reserved word else is used to represent the Code or Array that ends an if..then construct. In the end, I'm looking for two things:
  • A clear definition of the term if type.
  • Doing away with the misuse of reserved words in presenting the syntax of else and exitWith.
Perhaps we can solve the first one right here? It seems that the terms if type and if type condition are equivalent and refer to a language construct of the following form:
IfTypeCondition:
if ( expression )
If that can serve as a definition of the term if type, the article can be improved.
Killswitch 14:44, 24 March 2007 (CET)