Author Topic: HyperNext as database, where is data stored?  (Read 12863 times)

AnonymousPostings

  • Newbie
  • *
  • Posts: 49
HyperNext as database, where is data stored?
« on: July 01, 2010, 11:14:32 AM »
Hi there, i'm quite new to hypernext and programming itself. and i'm trying to create a database project similar to as what has been reflected in 'book database' project. and i surely want to know where the database been kept? since i can't figure this things out yet.
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 464
  • Here to help you
Re: HyperNext as database, where is data stored?
« Reply #1 on: July 01, 2010, 11:15:30 AM »
The database is actually stored within the memory of your HyperNext application/stack. It isn't stored in an external database such as MySQL etc.

When your HyperNext built application/stack quits it can automatically store its field data onto hard disk and when re-run can automatically reload it.
Please note, when running projects inside the HyperNext Creator, any data in memory is automatically purged when the project run is ended.

By the way, there are 2 book projects with HyperNext - Books HC uses a traditional method to store the database, burt Books HN is more modern and uses far less memory and resources.
Note, array data must be stored by the programmer in a file etc, as array data is not automatically stored when a HyperNext application/stack quits
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

tools-n-stuff

  • Newbie
  • *
  • Posts: 38
Re: HyperNext as database, where is data stored?
« Reply #2 on: October 23, 2010, 09:36:01 PM »
Hi,
I noticed when working on the book example that quiting will save all pages created but only the data contained on the first entry. All the other pages data isn't saved.
Could this have something to do with arrays and if so how do i go about setting one up?

Thanks.
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 464
  • Here to help you
Re: HyperNext as database, where is data stored?
« Reply #3 on: October 25, 2010, 07:05:48 AM »
Quote from: tools-n-stuff
Hi,
I noticed when working on the book example that quiting will save all pages created but only the data contained on the first entry. All the other pages data isn't saved.
Could this have something to do with arrays and if so how do i go about setting one up?
Thanks.

Yes, your are right - it is the arrays  - they don't save automatically.
So you could write them to a file before quitting - there is an example post if writing simple data to a file:-

http://www.tigabyte.com/smf/index.php?topic=29.0


If you don't want to use files then you could use a hidden card and put a number of fields on it - one for each of your records - then let HyperNext save and load them automatically.
Then before you quit use the FieldCard command to place the data there and when your program loads just retrieve the data into your arrays.
The commands are:-

Code: [Select]
@ Put data into field 5 of card 2
FieldCardSet(5,2,data)

Code: [Select]
@ Fetch data from field 5 of card 2
Put FieldCardFN(5,2) into data

One minor problem - if your data has multiple lines then you would need to replace the endofline character with another - then replace it when you reload the data.
« Last Edit: December 05, 2015, 07:32:11 AM by tigabyte »
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.