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 fillchar to

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

2009-06-26 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 spirit. As

[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: code program Project1; const MyVar : UInt64 = $; // 4 x 2 Bytes or 4 Words begin end. /code In Delphi this compiles

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: code program Project1; const MyVar : UInt64 = $; // 4 x 2 Bytes or 4 Words

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 jonas.ma...@elis.ugent.be: 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

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

2009-06-25 Thread Inoussa OUEDRAOGO
2009/6/25 Jonas Maebe jonas.ma...@elis.ugent.be: On 25 Jun 2009, at 20:14, Inoussa OUEDRAOGO wrote: 2009/6/25 Jonas Maebe jonas.ma...@elis.ugent.be: 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

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 jonas.ma...@elis.ugent.be: 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

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: code program Project1; const MyVar : UInt64 = $; // 4 x 2

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: code MyConst : UInt64 = UInt64($); /code 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 Inoussa OUEDRAOGO
2009/6/25 Jonas Maebe jonas.ma...@elis.ugent.be: On 25 Jun 2009, at 20:33, Inoussa OUEDRAOGO wrote: 2009/6/25 Jonas Maebe jonas.ma...@elis.ugent.be: 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

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

2009-06-25 Thread Inoussa OUEDRAOGO
2009/6/25 Jonas Maebe jonas.ma...@elis.ugent.be: 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: code MyConst : UInt64 = UInt64($); /code Am I right? Yes, indeed. That will always work and is

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 jonas.ma...@elis.ugent.be: 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)

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

2009-06-25 Thread Inoussa OUEDRAOGO
2009/6/25 Jonas Maebe jonas.ma...@elis.ugent.be: On 25 Jun 2009, at 20:58, Inoussa OUEDRAOGO wrote: 2009/6/25 Jonas Maebe jonas.ma...@elis.ugent.be: It's equally accurate. A hex number does not contain any sign information, so both interpretations are valid. so it could be parsed as