Bug? SOLVED : RandomAccessFile Read or Write Bytes CurrentPosition update

Discussion in 'Bugs & wishlist' started by kiki78, Feb 25, 2015.

  1. kiki78

    kiki78 Active Member Licensed User

    I think I found bug in CurrentPosition update when using ReadBytes or WritesBytes in RandomAccessFile.

    Before 4.30 (lib version 1.65), you set CurrentPosition by adding buffer length to Position parameter, that is correct.

    In 4.30 (lib version 2.00), you add buffer length to previous value of CurrentPosition, that is not expected.

    Regards
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Can you post some code that reproduces this issue?
     
  3. kiki78

    kiki78 Active Member Licensed User

    Code:
    Dim B(100As Byte
    Dim R As RandomAccessFile
    R.Initialize3(B, 
    False)
    Dim T(8As Byte
    R.WriteBytes(T, 
    0, T.Length, 45)
    Log(R.CurrentPosition) 'You obtain 8 in place of 53
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You are correct. Thank you. Will be fixed.
     
    kiki78 likes this.
  5. Erel

    Erel Administrator Staff Member Licensed User

    The B4A and B4J libraries were fixed and will be included in the next update of the IDEs.

    You can also download the attached libraries.
     

    Attached Files:

    kiki78 likes this.
  6. kiki78

    kiki78 Active Member Licensed User

    Thank you Erel :)

    I change title to Solved.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice