Re: [fpc-pascal] Records as properties and Delphi compiler error

2009-06-08 Thread fpclist
Excellent explanation. Thanks Martin. Regards, Nino //*** On Monday 08 June 2009 20:33:48 Martin Friebe wrote: > fpcl...@silvermono.co.za ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/

Re: [fpc-pascal] Records as properties and Delphi compiler error

2009-06-08 Thread Doug Chamberlin
fpcl...@silvermono.co.za wrote: Graeme Geldenhuys wrote: Can you please refrain from quoting the *whole* previous message... Okay. Point taken. Thank you, Nino! Everyone, please trim your quotes! ___ fpc-pascal maillist - fpc-pascal@lists.freepa

Re: [fpc-pascal] Records as properties and Delphi compiler error

2009-06-08 Thread Martin Friebe
fpcl...@silvermono.co.za wrote: On Sunday 07 June 2009 22:19:47 Jonas Maebe wrote: On 07 Jun 2009, at 10:35, fpcl...@silvermono.co.za wrote: A high level, a class is like a record that has been modified to include functions and procedures. I know that I'm over simplifying thing here, pl

Re: [fpc-pascal] Records as properties and Delphi compiler error

2009-06-08 Thread fpclist
On Monday 08 June 2009 19:55:00 Graeme Geldenhuys wrote: > Hi Nino, > > Can you please refrain from quoting the *whole* previous message, when your > reply only relates to one or two lines. If other developers want to read > the whole context of the message thread they can look in their email > hi

Re: [fpc-pascal] Records as properties and Delphi compiler error

2009-06-08 Thread Graeme Geldenhuys
Hi Nino, Can you please refrain from quoting the *whole* previous message, when your reply only relates to one or two lines. If other developers want to read the whole context of the message thread they can look in their email history or the mailing list archive. It is REALLY annoying seeing

Re: [fpc-pascal] Records as properties and Delphi compiler error

2009-06-08 Thread fpclist
On Sunday 07 June 2009 22:19:47 Jonas Maebe wrote: > On 07 Jun 2009, at 10:35, fpcl...@silvermono.co.za wrote: > > A high level, a class is like a record that has been modified to > > include > > functions and procedures. I know that I'm over simplifying thing > > here, please > > bare with me. > >

Re: [fpc-pascal] Records as properties and Delphi compiler error

2009-06-07 Thread Jonas Maebe
On 07 Jun 2009, at 10:35, fpcl...@silvermono.co.za wrote: A high level, a class is like a record that has been modified to include functions and procedures. I know that I'm over simplifying thing here, please bare with me. The difference you skip over is the fundamental reason why one wor

Re: [fpc-pascal] Records as properties and Delphi compiler error

2009-06-07 Thread fpclist
Hi Jonas Thanks for the reply. A high level, a class is like a record that has been modified to include functions and procedures. I know that I'm over simplifying thing here, please bare with me. I'm trying to understand the logic employed by the creators of Delphi where they don't allow to w

Re: [fpc-pascal] Records as properties and Delphi compiler error

2009-06-06 Thread Jonas Maebe
On 06 Jun 2009, at 17:36, fpcl...@silvermono.co.za wrote: Is there a reason why the following code fails to compile in Delphi but compile in FPC? Could the reason be that FPC allows the use of global properties? No, it's an error in FPC which has been fixed in 2.3.1: http://wiki.freepascal

Re: [fpc-pascal] Records

2005-10-26 Thread Vinzent Hoefler
On Wednesday 26 October 2005 10:06, Micha Nelissen wrote: > Vinzent Hoefler wrote: > >>Oh right! Something like a masked compare or so...probably not > >>implementable in an efficient way indeed I guess. > > > > Whatever you call efficient. A simple memory compare won't do, as > > others already po

Re: [fpc-pascal] Records

2005-10-26 Thread Micha Nelissen
Vinzent Hoefler wrote: Oh right! Something like a masked compare or so...probably not implementable in an efficient way indeed I guess. Whatever you call efficient. A simple memory compare won't do, as others already pointed out, and everything else depends on the actual layout of the struct

Re: [fpc-pascal] Records

2005-10-26 Thread Vinzent Hoefler
On Wednesday 26 October 2005 09:26, Micha Nelissen wrote: > Jonas Maebe wrote: > > Yes, but two different variables of the same type could have > > different values for those pad bytes. So you have to compare > > everything but the pad bytes. > > Oh right! Something like a masked compare or so...

Re: [fpc-pascal] Records

2005-10-26 Thread Adriaan van Os
Jonas Maebe wrote: Micha Nelissen wrote: Because you can't simply compare the memory ranges occupied by records A and B. They could have different pad bytes (and bits) but still be the same. Isn't the number of pad bytes a property of a type ? So when two vars are of the same type, they al

Re: [fpc-pascal] Records

2005-10-26 Thread Micha Nelissen
Jonas Maebe wrote: Yes, but two different variables of the same type could have different values for those pad bytes. So you have to compare everything but the pad bytes. Oh right! Something like a masked compare or so...probably not implementable in an efficient way indeed I guess. Mic

Re: [fpc-pascal] Records

2005-10-26 Thread Jonas Maebe
On 26 okt 2005, at 10:11, Micha Nelissen wrote: Because you can't simply compare the memory ranges occupied by records A and B. They could have different pad bytes (and bits) but still be the same. Isn't the number of pad bytes a property of a type ? So when two vars are of the same type

Re: [fpc-pascal] Records

2005-10-26 Thread Micha Nelissen
Adriaan van Os wrote: I have never could understand when this is allowed A1:=A2; Why this is not allowed If A1=A2 then in most Pascal compilers. Because you can't simply compare the memory ranges occupied by records A and B. They could have different pad bytes (and bits) but still be the s

Re: [fpc-pascal] Records

2005-10-26 Thread Carsten Bager
> Adriaan van Os wrote: > > > Carsten Bager wrote: > > > >> We are moving a lot of code from an old platform where it is > >> allowed to compare 2 records like this. > >> > >> Type > >> A_typ=array[0..3] of integer; > >> Var > >> A1,A2:A_typ; > >> > >> Begin > >> If A1=A2 then > >> End; > >>

Re: [fpc-pascal] Records

2005-10-26 Thread Florian Klaempfl
Adriaan van Os wrote: > Carsten Bager wrote: > >> We are moving a lot of code from an old platform where it is >> allowed to compare 2 records like this. >> >> Type >> A_typ=array[0..3] of integer; >> Var >> A1,A2:A_typ; >> >> Begin >> If A1=A2 then >> End; >> >> I know that I can typecast t

Re: [fpc-pascal] Records

2005-10-25 Thread Adriaan van Os
Carsten Bager wrote: We are moving a lot of code from an old platform where it is allowed to compare 2 records like this. Type A_typ=array[0..3] of integer; Var A1,A2:A_typ; Begin If A1=A2 then End; I know that I can typecast to an array of char to compare but is there an easier way. --

Re: [fpc-pascal] records - really a bug?

2005-05-25 Thread chromdildo
Thanks for the quick reply. ...I see, stupid me. :) But when the position of "amtsbelegung : Tchange_bool;" is changed, no AV occurs ..? Reproducable? Something about Memory Acces I think I got it. Best regards ./chrom Florian Klaempfl wrote: >chromdildo wrote: > >Well, in your program :

Re: [fpc-pascal] records - really a bug?

2005-05-25 Thread Jonas Maebe
On 25 mei 2005, at 12:06, chromdildo wrote: msn : array [0..9] of Tchange_string; port : array [0..9] of Tchange_string; This array goes from 0 till 9 for ic:= 1 to 10 do begin Eumex1.Memory.msn[ic].value := ''; Eumex1.Memory.msn[ic].changed := false

Re: [fpc-pascal] records - really a bug?

2005-05-25 Thread Florian Klaempfl
chromdildo wrote: Well, in your program :) Compile with range checking ot see it. > Hello everybody. > > I discovered a very strange bug/issue and I don't know how to describe > it best as a bug-report. > (or am I doing something wrong?) > I try: a variable declared within a record, AccessViolat