Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Database Saving Problem

Database Saving Problem

Postby juha2u on Mon Aug 26, 2002 2:17 am

I?¢‚Ǩ‚Ñ¢m not quite certain I can articulate my problem, but here goes:

I am developing a diet program to capture certain nutrition elements from various foods. The main screen is an entry screen that captures the info and saves to the database. Each food item and related elements have a record number. When I tap on the "Select" button from the main screen, the program does some math and posts the totals to a second screen. The screen designs are both done through Ccontrols using two forms and two message loops.

The Problem:

I can?¢‚Ǩ‚Ñ¢t figure out how to save the totals (contained on the second form) to the database. Each time I exit the program the totals are reset to zero. I need to keep a running tally each day until I clear the totals for the next day.

I tried using the same logic (dbreadx, dbwritex, etc.) that I used for the main screen elements but I keep getting errors and the totals are not saved. Do I need to assign a record number to the totals screen? I?¢‚Ǩ‚Ñ¢m not even quite sure where in the code to use the read and write statements. I guess my lack of knowledge of databases is evident. I?¢‚Ǩ‚Ñ¢ve spent about 100 hours on this and I am so close I can taste it but I just can?¢‚Ǩ‚Ñ¢t get over this last hurdle.

Any suggestions? Thanks to everyone so far.
juha2u
 
Posts: 11
Joined: Tue Aug 13, 2002 7:45 pm

Postby Vilmos on Mon Aug 26, 2002 12:40 pm

I've been doing almost the same thing, although it is a budget program and has around 6 forms. What I did is just calculate the totals when the program starts up. There must be a routine to calculate anyway, and why save information to the database that can be calculated and will be wrong as soon as the person uses the program anyway?

If saving is really what you want to do, then yes you will need a new record just for totals. Then you can use dbrec to go specifically to that record and read or write the totals.

Vilmos
Vilmos
 
Posts: 174
Joined: Tue Dec 05, 2000 6:13 pm
Location: Canada

Postby juha2u on Mon Aug 26, 2002 5:10 pm

Vilmos,

Thanks for the quick reply. It's hard to explain but I do need to save the totals. I tried your ideas but I think I am lost. Specifically, how exactly do I create a record just to store the totals? I assume it should be the same record number all the time? I'm not sure where to insert these new lines of code (including the dbreadx and dbwritex)as I am getting confused between the main screen functions and the totals functions. Remember I have two message loops.

I know I may be asking for a lot, but perhaps some sample lines of code to accomplish this would go a long way. Perhaps the next step would be to post some excerpts from the program to see where I am going wrong.

Thanks again.
juha2u
 
Posts: 11
Joined: Tue Aug 13, 2002 7:45 pm

Postby Vilmos on Mon Aug 26, 2002 7:07 pm

Hmm, I think I'll need to see code. I can't post any right now, but if you put your save/load routine up maybe we can find something. Are you trying to work with a variable number of records? I'm not sure why you are having problems.

What I do is just save and load in the same order. For my program the different records signify a different "file" to the user. All of the variables are in one record, which is repeated for the next record.

I also use the first record (0) as an index so I know what files are at what records and more important is to set up the program to the state it was in when last run.

Post some of your code and if that doesn't help I will probably be at home and can show a bit of my code.

Vilmos
Vilmos
 
Posts: 174
Joined: Tue Dec 05, 2000 6:13 pm
Location: Canada

Postby juha2u on Tue Aug 27, 2002 1:50 pm

Vilmos,

Thanks. I tried using this board to send you an email but I'm not sure if you got it. Perhaps we can take this off-line. If you wouldn't mind, could you please give me your email address. You can send it to juha2u@yahoo.com

Thanks.
juha2u
 
Posts: 11
Joined: Tue Aug 13, 2002 7:45 pm

Postby Vilmos on Tue Aug 27, 2002 3:15 pm

Done.

Vilmos
Vilmos
 
Posts: 174
Joined: Tue Dec 05, 2000 6:13 pm
Location: Canada


Return to PocketC for Palm OS KB

Who is online

Users browsing this forum: No registered users and 3 guests

cron