Delphi XE4 - Octal constant is working like decimal constant -


Today I was reviewing my partner's code This is the plain old Delphi, version XE4. I searched the code like this:

  cWin_CountryIdsSet: array of array [0..243] = (499, 688, 040, ...)   

This is a list of decimal ids, but one of these - 040 - looks like octets, is not it? I immediately told him about the problem, but he replied: "No, it works like decimation, look at yourself". And he was right! I wrote a little example:

  Written (080); If 80 = 080 then righten ('they are the same'); Writeln (IntToStr (080));   

Displays this:

  80 equals 80   

So it means that it's the embroider's The wrong name is moment. In particular this sentence is incorrect:

All constants with initial zero are considered octal if an invalid number is continuously 8 or 9 in an octal, an error is reported. . 037777777777 more volatile constants are deducted.

I have not found any error in using Digitally 8 and Compiler. 0 Someone has explained to me, please, who is wrong here and how does it work now in the Delphi octaic constant?

Thanks in advance!

Updated: Delphi does not support the clear declaration of octal constants, it is a curse of multi-language development, I wrongly disturb my partner I am here. Thanks for all the replies!

Are you related to C ++ , any Delphi is not a reference Delphi does not support octal literals, only decimal and hex literal.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -