RE : [fpc-pascal] FPC Advanced Records

2012-03-10 Thread Ludo Brands
> > > > where by the time ThisSize is accessed any disparity has been > > corrected? > > > > Not sure if this will be of any use. > > but you can always define an assignment incompatible type > WordLE = record data: Word; end; > > and define all required overloaded operators Or an endian

Re: [fpc-pascal] FPC Advanced Records

2012-03-10 Thread Mark Morgan Lloyd
Sven Barth wrote: Am 09.03.2012 23:26, schrieb Mark Morgan Lloyd: Martin wrote: On 09/03/2012 21:26, Mark Morgan Lloyd wrote: but is there any way to define something like an endianness-correcting type, i.e.: Type TAWSHeader=Record ThisSize: WordLE; .. where by the time ThisSize is accessed

Re: [fpc-pascal] FPC Advanced Records

2012-03-10 Thread Sven Barth
Am 09.03.2012 23:26, schrieb Mark Morgan Lloyd: Martin wrote: On 09/03/2012 21:26, Mark Morgan Lloyd wrote: but is there any way to define something like an endianness-correcting type, i.e.: Type TAWSHeader=Record ThisSize: WordLE; .. where by the time ThisSize is accessed any disparity has

Re: [fpc-pascal] FPC Advanced Records

2012-03-09 Thread Mark Morgan Lloyd
Martin wrote: On 09/03/2012 21:26, Mark Morgan Lloyd wrote: but is there any way to define something like an endianness-correcting type, i.e.: Type TAWSHeader=Record ThisSize: WordLE; .. where by the time ThisSize is accessed any disparity has been corrected? Not sure if this will

Re: [fpc-pascal] FPC Advanced Records

2012-03-09 Thread Mark Morgan Lloyd
Jonas Maebe wrote: On 09 Mar 2012, at 22:26, Mark Morgan Lloyd wrote: Thanks Jonas, I don't think I need to do it but I thought it was a fair question: better safe than sorry. OK, so hopefully I can get away with another. I'm looking at a program written in Delphi, which reads a file contain

Re: [fpc-pascal] FPC Advanced Records

2012-03-09 Thread Martin
On 09/03/2012 21:26, Mark Morgan Lloyd wrote: but is there any way to define something like an endianness-correcting type, i.e.: Type TAWSHeader=Record ThisSize: WordLE; .. where by the time ThisSize is accessed any disparity has been corrected? Not sure if this will be of any use.

Re: [fpc-pascal] FPC Advanced Records

2012-03-09 Thread Jonas Maebe
On 09 Mar 2012, at 22:26, Mark Morgan Lloyd wrote: > Thanks Jonas, I don't think I need to do it but I thought it was a fair > question: better safe than sorry. > > OK, so hopefully I can get away with another. I'm looking at a program > written in Delphi, which reads a file containing the ima

Re: [fpc-pascal] FPC Advanced Records

2012-03-09 Thread Mark Morgan Lloyd
Jonas Maebe wrote: On 09 Mar 2012, at 21:38, Mark Morgan Lloyd wrote: Can an Advanced Record, i.e. a record which as well as having fields has at least one embedded function, be safely used as a cast or type transfer overlaying unstructured bytes? Yes. Thanks Jonas, I don't think I need t

Re: [fpc-pascal] FPC Advanced Records

2012-03-09 Thread Jonas Maebe
On 09 Mar 2012, at 21:38, Mark Morgan Lloyd wrote: > Can an Advanced Record, i.e. a record which as well as having fields has at > least one embedded function, be safely used as a cast or type transfer > overlaying unstructured bytes? Yes. Jonas___