Results 1 to 4 of 4

Thread: Function: DFRecnumToRowId

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2009
    Posts
    1,291

    Default Re: Function: DFRecnumToRowId

    Code:
    Use UI
    External_Function wvsprintf "wvsprintfA" USER32.DLL Pointer pResult String sTemplate Pointer pParam Returns Integer
    External_Function htonl "htonl" Ws2_32.dll Uinteger u Returns UInteger
    Function DFRecnumToRowId Global UInteger uDec Returns RowId
        Integer iVoid
        String sResult
        Move (htonl(uDec)) to uDec
        Move (Repeat(" ",9)) to sResult
        Move (wvsprintf(AddressOf(sResult), "%.8lx", AddressOf(uDec))) to iVoid
      Function_Return  (DeserializeRowID(Left(sResult,8))) 
    End_Function
    Used APIs to help out with the byte swap and int-to-hex conversion.

    Frank Cheng
    Last edited by Frank Cheng; 8-Jan-2021 at 10:41 PM. Reason: Wrong return type

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •