Hello,
I'm using FPC 2.5.1 and I'm trying to do the following:
if not (Char in ['a'..'z'])
however fpc gives me an error of type mismatch for the "in" directive. Why can't I use the in directive on a char ?
Thanks,
Ido

Mailing lists / fpc-pascal / 2009-12
8 messages · 4 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hello,
I'm using FPC 2.5.1 and I'm trying to do the following:
if not (Char in ['a'..'z'])
however fpc gives me an error of type mismatch for the "in" directive. Why can't I use the in directive on a char ?
Thanks,
Ido
You made a mistake somewhere. *Always* post a source snippet that should be compilable when asking about compilation problems.
Jonas
You are right, my bad.
I wrote it
if (not Key in ['a'..'z']) then
Rather then
if not (Key in ['a'..'z') thenIn lazarus under OnKeyPress.
Now it works properly. However it seems like the not is for the "in" rather then the key if it inside the pertness.
Ido
"pertness"? I would love to know what that was before babelfish got it...
(Key in ['a'..'z']) is a boolean expression. So
not (Key in ['a'..'z'])
makes sense.
Key is a char, so what should
not Key
mean? And when would that be in ['a'..'z']?
Hope that helps make it clearer
FP
I put my money on an (auto-correcting) spell checker that changed a misspelled "parentheses" ("perentes" maybe) :)
Key is a char, so what should not Key mean?
Indeed, unary operators (such as "not") have a higher precedence than binary operators.
Jonas
Yes :)
My native language is non latin based, and you write what you hear (unlike latin based languages). English is my 3rd language (more or less), so I do not know always the meaning of the suggested word in the speller (regarding the way it is written).
Thanks, that explains it.
Ido
ik wroteYes :)
OT:
My native language is non latin based, and you write what you hear (unlike latin based languages).
Reading http://en.wikipedia.org/wiki/Orthographic_depth, I would expect that in Hebrew, one cannot just write what one hears, unlike some (but not all) Latin based languages like Italian.
Vincent
http://ik.homelinux.org/ Yes :) My native language is non latin based, and you write what…
Fair enough. "Pert" is a word I hardly ever see, except occasionally in connection with breasts. I thought "set" was intended, rather than brackets. Couldn't think what word, similar to "set", could translate as forward, presumptuous, beautiful, lively, fresh or any other meaning to do with "pert".
Frank