Hi All, this is my first post.
First off, I'm absolutely loving this development platform!! Major kudos to the development team, and all the library creators!!
I'm coming from a heavy VB6 background here, and I'm attempting to wrap my head around a few things. Any advice, support you can offer is much appreciated!
I'm a huge UDT user, and all my database work has been with Types, my first order of business was getting a fixed length string to work in the B4A type object, and so I went with char arrays:
Using the ByteConverter Library, data stored can be converted using the ToChars and FromChars functions.
so far so good (I'm thinking) but when it comes time to write the Type to file, I can't easily ascertain the length of the Type Object so that I can use that information to sequentially perform actions I would normally be used to doing in VB6. Looping through records, getting record counts, locating a single record in the midst of other records.
Not knowing how to easily get this info, I just created a simple enum or constant (of sorts) to store them PRE-CALCULATED for when I need the values later on, but the values are not adding up properly, and the records are not being read/written correctly in my attempts..
Extra data that I'm not EXPECTING to have been written to file is being written, and it's not allowing me to get a proper handle on the quantity of records that exist within the database file. I'm missing something... or perhaps I'm doing it improperly..
Yes, there is SQL, but I really want to try maintain the same UDT reading/writing for compatibility between older VB6 databases.
Does anyone have any good RandomAccessFile examples showing Types being used to create a sequential based database?
First off, I'm absolutely loving this development platform!! Major kudos to the development team, and all the library creators!!
I'm coming from a heavy VB6 background here, and I'm attempting to wrap my head around a few things. Any advice, support you can offer is much appreciated!
I'm a huge UDT user, and all my database work has been with Types, my first order of business was getting a fixed length string to work in the B4A type object, and so I went with char arrays:
B4X:
Type PersonData( _
Name(25) As Char, _
Description(500) As Char, _
Age as Int)
Using the ByteConverter Library, data stored can be converted using the ToChars and FromChars functions.
so far so good (I'm thinking) but when it comes time to write the Type to file, I can't easily ascertain the length of the Type Object so that I can use that information to sequentially perform actions I would normally be used to doing in VB6. Looping through records, getting record counts, locating a single record in the midst of other records.
Not knowing how to easily get this info, I just created a simple enum or constant (of sorts) to store them PRE-CALCULATED for when I need the values later on, but the values are not adding up properly, and the records are not being read/written correctly in my attempts..
B4X:
Type DataTypeLength(PersonDataLength As Int)
Dim Lens As DataTypeLength
Lens.PersonDataLength = (((25 + 500) *2) + 4)
Extra data that I'm not EXPECTING to have been written to file is being written, and it's not allowing me to get a proper handle on the quantity of records that exist within the database file. I'm missing something... or perhaps I'm doing it improperly..
Yes, there is SQL, but I really want to try maintain the same UDT reading/writing for compatibility between older VB6 databases.
Does anyone have any good RandomAccessFile examples showing Types being used to create a sequential based database?