June 24th, 2012, 10:24 PM
Conversion from Delphi to VB.net
I am new to this Forum and I am not sure if this is where I need to post this, so here goes.
I have a client that is looking to convert from Delphi to VB.net. I am not that familiar with Delphi, so I have come across some code that I am not sure how to handle. If you can enlighten me on this, I would be greatly appreciative.
Here is the code:
I am not sure what to do with the these sentences and the $00FF, $FF00 and the shr8
acc:= qPFTACCEPTIBILITY_CODE.AsInteger and $00FF;
overide:= (qPFTACCEPTIBILITY_CODE.AsInteger and $FF00) shr 8;
acc:= acc and (not overide); // V4.04.5 change $00FF to $FF00
if (qPFTCRV_DELETED.AsBoolean) or ((acc and UMain.SPC.ACCExc) <> 0) then
else Par:= 1;
Result := True;
Thanks for your help in advance!!
June 25th, 2012, 01:58 PM
These are integer values expressed in hex.
This is performing a bitwise AND on the two values.
This "shifting" the bits in the value 8 places to the right.
Equivalent to dividing by 2^8.
June 25th, 2012, 07:12 PM
for the shr, if i had a binary value of 1010101011111111, then once it is shifted, it would be 0000000010101010?
June 26th, 2012, 01:25 PM
That would be my understanding.