Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-27 Thread Jürgen Hestermann
The fact that Borland regarded "$FF..FF" as a 2's complement representation and not as a base-16 representation of an integer is not really what I would call "Pascal spirit". As a matter of fact, "Borland mess" would be more appropriate. :-) I always avoid such imponderabilities by using fillcha

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Marco van de Voort
In our previous episode, m2 said: > > instead, it is not possible (without violating the spirit of the Pascal > > language > > The fact that Borland regarded "$FF..FF" as a 2's complement > representation and not as a base-16 representation of an integer is > not really what I would call "Pascal s

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread m2
Jonas Maebe a écrit : > > On 25 Jun 2009, at 20:58, Inoussa OUEDRAOGO wrote: > >> 2009/6/25 Jonas Maebe : >>> >>> It's equally accurate. A hex number does not contain any sign >>> information, >>> so both interpretations are valid. >> >> so it could be parsed as QWord accurately and assigned to a

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Inoussa OUEDRAOGO
2009/6/25 Jonas Maebe : > > On 25 Jun 2009, at 20:58, Inoussa OUEDRAOGO wrote: > >> 2009/6/25 Jonas Maebe : >>> >>> It's equally accurate. A hex number does not contain any sign >>> information, >>> so both interpretations are valid. >> >> so it could be parsed as QWord accurately and assigned to a

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Jonas Maebe
On 25 Jun 2009, at 20:58, Inoussa OUEDRAOGO wrote: 2009/6/25 Jonas Maebe : It's equally accurate. A hex number does not contain any sign information, so both interpretations are valid. so it could be parsed as QWord accurately and assigned to a QWord (typed) variable without warning, as

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Inoussa OUEDRAOGO
2009/6/25 Jonas Maebe : > > On 25 Jun 2009, at 20:52, Ruediger Hahn wrote: > >> So what do I have to do then? It seems that a cast is the best solution: >> >> MyConst : UInt64 = UInt64($); >> >> Am I right? > > Yes, indeed. That will always work and is completely safe. Agreed.

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Inoussa OUEDRAOGO
2009/6/25 Jonas Maebe : > > On 25 Jun 2009, at 20:33, Inoussa OUEDRAOGO wrote: > >> 2009/6/25 Jonas Maebe : >>> >>> On 25 Jun 2009, at 20:14, Inoussa OUEDRAOGO wrote: >>> as it makes one doubtfull about the correctness of the program( In my case I debugged the program to be sure that

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Jonas Maebe
On 25 Jun 2009, at 20:52, Ruediger Hahn wrote: So what do I have to do then? It seems that a cast is the best solution: MyConst : UInt64 = UInt64($); Am I right? Yes, indeed. That will always work and is completely safe. Jonas

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Ruediger Hahn
Jonas Maebe wrote: On 25 Jun 2009, at 19:58, Ruediger Hahn wrote: I am just wondering if this is a bug: Can anyone tell me why I get a "range check error while evaluating constants" with the following simple program: program Project1; const MyVar : UInt64 = $; // 4 x 2 Byt

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Jonas Maebe
On 25 Jun 2009, at 20:33, Inoussa OUEDRAOGO wrote: 2009/6/25 Jonas Maebe : On 25 Jun 2009, at 20:14, Inoussa OUEDRAOGO wrote: as it makes one doubtfull about the correctness of the program( In my case I debugged the program to be sure that the "good" value was assigned). When it's changed

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Inoussa OUEDRAOGO
2009/6/25 Jonas Maebe : > > On 25 Jun 2009, at 20:14, Inoussa OUEDRAOGO wrote: > >> 2009/6/25 Jonas Maebe : >>> >>> On 25 Jun 2009, at 19:58, Ruediger Hahn wrote: >>> I am just wondering if this is a bug: Can anyone tell me why I get a "range check error while evaluating constants" with t

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Jonas Maebe
On 25 Jun 2009, at 20:14, Inoussa OUEDRAOGO wrote: 2009/6/25 Jonas Maebe : On 25 Jun 2009, at 19:58, Ruediger Hahn wrote: I am just wondering if this is a bug: Can anyone tell me why I get a "range check error while evaluating constants" with the following simple program: program Proje

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Inoussa OUEDRAOGO
2009/6/25 Jonas Maebe : > > On 25 Jun 2009, at 19:58, Ruediger Hahn wrote: > >> I am just wondering if this is a bug: Can anyone tell me why I get a >> "range check error while evaluating constants" with the following simple >> program: >> >> >> program Project1; >> >> const >> MyVar : UInt64 = $F

Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Jonas Maebe
On 25 Jun 2009, at 19:58, Ruediger Hahn wrote: I am just wondering if this is a bug: Can anyone tell me why I get a "range check error while evaluating constants" with the following simple program: program Project1; const MyVar : UInt64 = $; // 4 x 2 Bytes or 4 Words beg

[fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-25 Thread Ruediger Hahn
Hi all, I am just wondering if this is a bug: Can anyone tell me why I get a "range check error while evaluating constants" with the following simple program: program Project1; const MyVar : UInt64 = $; // 4 x 2 Bytes or 4 Words begin end. In Delphi this compiles without