#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2009
    Posts
    6
    Rep Power
    0

    Conversion from Delphi to VB.net


    Hello,
    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:


    Code:
    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
        Par[17]:= 0
      else Par[17]:= 1;
      Result := True;
    I am not sure what to do with the these sentences and the $00FF, $FF00 and the shr8

    Thanks for your help in advance!!
    Eddi Rae
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    $00FF, $FF00
    These are integer values expressed in hex.
    qPFTACCEPTIBILITY_CODE.AsInteger and $00FF
    This is performing a bitwise AND on the two values.
    shr 8
    This "shifting" the bits in the value 8 places to the right.
    Equivalent to dividing by 2^8.

    HTH

    Clive
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2009
    Posts
    6
    Rep Power
    0
    for the shr, if i had a binary value of 1010101011111111, then once it is shifted, it would be 0000000010101010?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    That would be my understanding.

IMN logo majestic logo threadwatch logo seochat tools logo