"Case of" documentation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

"Case of" documentation

Howard Page-Clark
Describing the Case statement The FPLanguageReference.pdf 10.2.2 says:

The constants appearing in the various case parts must be known at
compile-time, and can be of the following types : enumeration types,
Ordinal types (except boolean), and chars.

Why the "except boolean"? I find the compiler happily accepts a boolean
expression as a case selector, as well as True and False as
corresponding labels, and the resulting compiled code performs as you
would expect.

Howard
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: "Case of" documentation

Michael Van Canneyt


On Sat, 24 Nov 2012, Howard Page-Clark wrote:

> Describing the Case statement The FPLanguageReference.pdf 10.2.2 says:
>
> The constants appearing in the various case parts must be known at
> compile-time, and can be of the following types : enumeration types, Ordinal
> types (except boolean), and chars.
>
> Why the "except boolean"? I find the compiler happily accepts a boolean
> expression as a case selector, as well as True and False as corresponding
> labels, and the resulting compiled code performs as you would expect.

probably it was so in the early days of the compiler, and the documentation never got corrected.

I will fix this.

I should probably also document that you can use strings.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: "Case of" documentation

babynancy543
This post has NOT been accepted by the mailing list yet.
In reply to this post by Howard Page-Clark
What are the consequences if I put a fake name on a job application or any other important documentation?







get facebook fans