Hello,
I load 100 bytes from binary file to an array, then split it into fields, the problem is i always get wrong last element, in this case i get 0xB2 instead of 0x00, any ideas?
Thanks
I load 100 bytes from binary file to an array, then split it into fields, the problem is i always get wrong last element, in this case i get 0xB2 instead of 0x00, any ideas?
Thanks
B4X:
Sd.Position = 0
If Sd.OpenRead(filename) = True Then
Sd.Stream.ReadBytes(cb,0,100) 'read 100 bytes
Sd.close
Dim IDCardInFile(10) As Byte = BC.SubString2(cb,0,10)
Dim UserID(16) As Byte = BC.SubString2(cb,11,27)
Dim Description1 (20) As Byte = BC.SubString2(cb,28,48)
Dim Description2 (20) As Byte = BC.SubString2(cb,49,67)
Dim IssueDate (12) As Byte = BC.SubString2(cb,70,82)
Dim ExpiryDate (12) As Byte = BC.SubString2(cb,83,95)
Dim CheckExpiry (1) As Byte = BC.SubString2(cb,96,97)
Dim IsExpiredorDisabled (1) As Byte = BC.SubString2(cb,98,99)
Dim DoorOpen (1) As Byte= BC.SubString2(cb,100,101)
Log( IDCardInFile)
Log( UserID)
Log( Description1)
Log( Description2 )
Log( IssueDate)
Log( ExpiryDate)
Log( BC.HexFromBytes(CheckExpiry))
Log( BC.HexFromBytes(IsExpiredorDisabled) )
Log( BC.HexFromBytes(DoorOpen ))