Sign in Join

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

Mailing lists / lazarus / 1999-08

[Re: RFC : Type separation]]]]]

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Peter Vreman
to Michal Bukovjan: I think I'll do this, after all. The only reason why I am reluctant to it, is the…
you wrote 7 lines
I think I'll do this, after all. The only reason why I am reluctant to it, is the question whether it is a viable solution in terms of multiplatformness, e.g. does the compiler resolve the following issues? 1. Enumerated types are (propably) 1 byte size, Integer 4 byte (even 8 bytes on 64-platforms)

Depends on the $PACKENUM switch, default is 4 bytes. 8 bytes is not allowed atm, it's still in development, even constants > $7fffffff are not allowed.

2. Byte endianity - is this typecasting still legal for different byte ordering when compiling for multiple platforms ?

The same rules as for ordinals, you can always convert to ordinal.

3. Range overflows checking - when this style of programming spreads too much, it could end up in rather a mess. Or is the range check performed during the cast, say Integer(TEnumeratedType) ?

Then no rangecheck is done, only for TEnumeratedType(Integer)

Reply by email

Michal Bukovjan

I think I'll do this, after all.
The only reason why I am reluctant to it, is the question whether it is a viable solution in terms of multiplatformness, e.g. does the compiler resolve the following issues?

1. Enumerated types are (propably) 1 byte size, Integer 4 byte (even 8 bytes on 64-platforms)
2. Byte endianity - is this typecasting still legal for different byte ordering when compiling for multiple platforms ?
3. Range overflows checking - when this style of programming spreads too much, it could end up in rather a mess. Or is the range check performed during the cast, say Integer(TEnumeratedType) ?

Anyway, since there is no other way I can think of at the moment, I'll use the typecasting to integer and pray :-(

Michal Bukovjan

"Shane Miller" wrote
Why not just put a Comboboxstyle : Integer inthe message instead of referring to is as a TComboBoxStyle. Then you

don't need the Controls.pp in the uses.

Shane

____________________________________________________________________ Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.

Reply by email

Shane Miller

OK< better idea then.
Create a entry in the lmMessage that you want to use to point to a pointer and then it'll simply store an address. Then in your code, send the ADDRESS of your variable you want to use. This way you need to typecast it in gtkint or whereever, but it'll work better than the integer.

Shane

>> Michal Bukovjan 08/09 9:59 AM >>>

I think I'll do this, after all.
The only reason why I am reluctant to it, is the question whether it is a viable solution in terms of multiplatformness, e.g. does the compiler resolve the following issues?

1. Enumerated types are (propably) 1 byte size, Integer 4 byte (even 8 bytes on 64-platforms)
2. Byte endianity - is this typecasting still legal for different byte ordering when compiling for multiple platforms ?
3. Range overflows checking - when this style of programming spreads too much, it could end up in rather a mess. Or is the range check performed during the cast, say Integer(TEnumeratedType) ?

Anyway, since there is no other way I can think of at the moment, I'll use the typecasting to integer and pray :-(

Michal Bukovjan

"Shane Miller" wrote
Why not just put a Comboboxstyle : Integer inthe message instead of referring to is as a TComboBoxStyle. Then you

don't need the Controls.pp in the uses.

Shane

____________________________________________________________________ Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email