Toppa80 Posted August 10, 2008 Report Share Posted August 10, 2008 Hi, I have a question about the Offset-Codes: In Visual Basic the offset code 0231 is written &H231 (0 = &H). Whats about , the other beginnings like 1, 2, 3, ....? I´ll thank you for your help. Greetings, Tobias Link to comment Share on other sites More sharing options...
Pete Dowson Posted August 10, 2008 Report Share Posted August 10, 2008 I have a question about the Offset-Codes: In Visual Basic the offset code 0231 is written &H231 (0 = &H). No, "0" isn't replaced by "&H". The "&H" part just says "the following number is in in hexadecimal" -- the same as the prefix "0x" in C/C++. Preceding 0's in a hexadecimal number mean EXACTLY the same as preceding 0's in a decimal number, or a number in any radix -- absolutely nothing, just zero! The offset 0231 is the same as 231 and 0000000000231. The number of 0's at the beginning are completely irrelevant. Same as decimal 0000001 is the same as .... 1, no larger, no smaller! Whats about , the other beginnings like 1, 2, 3, ....? They can begin with 1, 2, 3 or 000001, 000000002, 03, whatever you like. The only thing to be aware of is the peculiarity of Microsoft VB to change any hexadecimal number larger than 7FFF into one starting FFFF... ("sign extension"). For instance, it changes &H8100 into &HFFFF8100. Why? No idea -- it is bad programming or bad design or a bug. It even changes &H00008100 into &HFFFF8100 ! Apparently, to stop it doing such stupid things you should add another & at the end. Thus: &H8100& which does actually compile as &H00008100 ! Pete Link to comment Share on other sites More sharing options...
Toppa80 Posted August 10, 2008 Author Report Share Posted August 10, 2008 Thank you Pete for the informations. It´s great to read your explanation :) Have a nice day, Tobias Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now