Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-12

char in [range]

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jonas Maebe
to ik
ik wrote 7 lines
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 ?

You made a mistake somewhere. *Always* post a source snippet that should be compilable when asking about compilation problems.

Jonas

Reply by email

ik
to Jonas Maebe

You are right, my bad.

I wrote it
if (not Key in ['a'..'z']) then
Rather then
if not (Key in ['a'..'z') then

In 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

http://ik.homelinux.org/

Jonas Maebe wrote 20 lines
On 07 Dec 2009, at 14:01, ik wrote: 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 ? > You made a mistake somewhere. *Always* post a source snippet that should be compilable when asking about compilation problems. Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Frank Peelo
to ik
ik wrote 12 lines
You are right, my bad. I wrote it if (not Key in ['a'..'z']) then Rather then if not (Key in ['a'..'z') then In 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.

"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

Reply by email

Jonas Maebe
to Frank Peelo
Frank Peelo wrote 6 lines
On 07/12/2009 13:40, ik wrote: > Now it works properly. However it seems like the not is for the > "in" rather then the key if it inside the pertness. "pertness"? I would love to know what that was before babelfish got it...

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

Reply by email

ik
to Jonas Maebe

http://ik.homelinux.org/

Jonas Maebe wrote 14 lines
On 07 Dec 2009, at 15:19, Frank Peelo wrote: On 07/12/2009 13:40, ik wrote: > >> Now it works properly. However it seems like the not is for the "in" >> rather then the key if it inside the pertness. >> > > "pertness"? I would love to know what that was before babelfish got it... > I put my money on an (auto-correcting) spell checker that changed a misspelled "parentheses" ("perentes" maybe) :)

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).

Show quoted text 11 lines
Key is a char, so what should > not Key > mean? > Indeed, unary operators (such as "not") have a higher precedence than binary operators.

Thanks, that explains it.

Show quoted text 5 lines
Jonas

Ido

Reply by email

Frank Peelo
to ik: http://ik.homelinux.org/ Yes :) My native language is non latin based, and you write what…
ik wrote 25 lines
http://ik.homelinux.org/ On Mon, Dec 7, 2009 at 4:43 PM, Jonas Maebe < > wrote: On 07 Dec 2009, at 15:19, Frank Peelo wrote: On 07/12/2009 13:40, ik wrote: Now it works properly. However it seems like the not is for the "in" rather then the key if it inside the pertness. "pertness"? I would love to know what that was before babelfish got it... I put my money on an (auto-correcting) spell checker that changed a misspelled "parentheses" ("perentes" maybe) :) Yes :)

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

Reply by email