<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by jstadolnik</i>
<br />It is currently possible to copy a database by loading it into an array in PocketC and then re-dumping it to a new database. It might be hair slow, but I wouldn't expect database copy operations to be a frequent operation.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
that's perfect. for some reason i never thought of this when originally trying to figure it out. i don't remember much now as it's been a exactly month (hehe) since that post... will have to look over the docs again hopefully figure out how to do that (i remember DBopen opens a database, now i'll just have to find a DBsaveas-type function). shouldn't be too hard assuming such a function is in the docs, so don't worry.
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
ps. is there any kind of buffering for reading fields from a DB? say if i need the speed and have to access a field a lot of times... would it be much faster to just copy its value to a local var and use that?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
Sure, just load it in into a PocketC array, it will definitely be faster.<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
what i meant was just one record, not field... my bad, i forgot all the terms. in other words, just one value (or a record, i guess).
because... i'll quickly explain why i need this.
basically, i have some data that i use a lot all over the place, but it's always at the top of my DB. what it is, is just the number of rooms (1st record) and then follow the locations (offsets from origin) of each one of those rooms. i use those values quite often.
however, each time i create a room, i have to increment my room count, and add another room location to the bottom of the list.
the way i did it at first was have it all (room count, room loctations) in an integer and a PToolboxLib Array(), respectively.
the problem is that every time i do that, i have to update my database. meaning, change the 1st record to the new room count, and insert another room location after the last room (there are many many records following that - the actual tiles).
so... it's kinda pointless to have this int/Array since i have to change the database each time another room is added (or removed, etc.) anyway...
but i *do* use 'em in calculations quite often, so it wouldn't be smart to call DBgetrec (is that the command for getting a value from a DB? i'm talking about that one) so often.
i guess i should keep it the way it is right now - a DB and a separate int/Array. it's a pain keeping 'em in sync though, but i guess it's necessary since i'll be using their value a lot per frame (some frames only, actually, like when the room changes or something).
is that what you would recommend?
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">The technique of keeping your most frequently used data in a fast access area is called "caching".<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
yeah, i knew that, just forgot the right word.

taking coding breaks is hell. :\ hehe.
ps. damn it, lol, so much for a short post... AGAIN! :[ i'm sorry...
edit: just wanted to say thanks for helping me and putting up w/ all these wordly and not-so-straight-to-the-point posts. 'preciate it very much.
