File reading, large numbers and database functionality
Posted: Fri Apr 08, 2016 12:13 am
Hi all,
I'm a new Smart Basic user, just starting to look at my first program. I'm more interested in productivity and data driven applications than graphic action games, so data manipulation functionality is important to me.
I've had a read through the FILE functions, which seem the base I'd have to build from to make something along the lines of SQL functionality. I have a couple of simple questions about file reading and wriring to start.
Q1. The FILE N$ WRITE X function only writes a single byte. What's the suggestion for storing numbers > 255? Do they need to be stored as a string, and then converted back to a number when read in? The automatic string to number conversion should make that easy, but I'm not sure of the performance overhead if it is being done frequently.
Q2. Do the FILE - READ/WRITE functions move the file pointer, or any of the read & write functions? The manual is a little unclear. It states on some functions that they don't affect the pointer, but does that mean any that don't state it, will move the pointer? If no, that means to process through the file byte by byte requires using the SETPOS command every time?
Thanks.
I'm a new Smart Basic user, just starting to look at my first program. I'm more interested in productivity and data driven applications than graphic action games, so data manipulation functionality is important to me.
I've had a read through the FILE functions, which seem the base I'd have to build from to make something along the lines of SQL functionality. I have a couple of simple questions about file reading and wriring to start.
Q1. The FILE N$ WRITE X function only writes a single byte. What's the suggestion for storing numbers > 255? Do they need to be stored as a string, and then converted back to a number when read in? The automatic string to number conversion should make that easy, but I'm not sure of the performance overhead if it is being done frequently.
Q2. Do the FILE - READ/WRITE functions move the file pointer, or any of the read & write functions? The manual is a little unclear. It states on some functions that they don't affect the pointer, but does that mean any that don't state it, will move the pointer? If no, that means to process through the file byte by byte requires using the SETPOS command every time?
Thanks.