Using the Book HN, i am trying to store the data created by the user to a bin file. The reason i am looking at using a bin file is because i read that writing to a file (excel i imagine) is a little limited by the number of entries.
So my first question is:
Is bin the way to go?
I have looked at the example contained within the Hn built in guide and pasted the example into my project.
GUIDE example - as is.
These show how to write and read to/from binary files. No checking for the files existence or type is made using fdets.
Note if the file variable fvar is zero then the file does not exist.
@ Write to a named file
Local fname,fvar,fdets,ftypes,fpaths,fnames,fextens
Local findex,n
FileGet(fname,fvar,fdets,ftypes,fpaths,fnames,fextens)
CreateBFile(fvar,findex,n)
WriteBVariable(findex,'hello')
For n=1 to 10
WriteBByte(findex,n)
EndFor
CloseBFile(findex)
@ Read from a named file, assumes format known
Local fname,fvar,fdets,ftypes,fpaths,fnames,fextens
Local findex,n
FileGet(fname,fvar,fdets,ftypes,fpaths,fnames,fextens)
OpenAsBFile(fvar,findex)
ReadBVariable(findex,mess)
For n=1 to 10
ReadBByte(findex,num)
Put num After mess
EndFor
CloseBFile(findex)
The read part i have tried placing it on the home card and on card 2 which is the main working environment. And the 'write' part i have tried placing on an independant button and directly on the Book HNs update button. I remember last night that on one try i got a conflict on 'nVar' as been already used!!?? I could see being used twice but couldn't work out if i should or how to get them to work together.
From what i can gather from this example, it should create a bin file in the data store, but i can't see it.
Any chance of a few pointers as to how to create a bin file as i am lost again. I can't work out if someting else should be declared and where, or if its needed to get the bin file hooked up to the project.
One thing i thought of thought:
When writing to a bin or file will it save all the fields from that Book HN page entry or does something need to be done so that the bin file knows there are more than one field, and doe's it know that there are more than one page with reusing the same fields but with new data? I know it maybe a lame question, but i am just trying to understand what i am doing.
Thanks in advance.