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 - BMP Databases

BMP Databases

A PocketC native palm library offering native forms and assorted utilities

Postby WauloK on Sat Mar 02, 2002 9:52 pm

Hey Joe.

I have a Q about the OpenBmpDb function.

How do I first test if the database exists in order to give an error?
Normally, I would use:
OpenBmpDb("Database_Name") || alert("Database missing"); exit();
But if I use this and the DB is missing, PTL will create one..

Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
If you love PocketC, you'll love this!
Join and become part of the community!
News, reviews, free source code and more!
Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
WauloK
 
Posts: 232
Joined: Tue Jan 15, 2002 2:41 am
Location: Australia

Postby jstadolnik on Sat Mar 02, 2002 10:01 pm

Use the built-in dbopen function to test if the database exists.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby WauloK on Sat Mar 02, 2002 10:36 pm

tnx
I open it with that then open again with openbmpdb..

Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
If you love PocketC, you'll love this!
Join and become part of the community!
News, reviews, free source code and more!
Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
WauloK
 
Posts: 232
Joined: Tue Jan 15, 2002 2:41 am
Location: Australia

Postby WauloK on Sun Mar 03, 2002 2:05 am

This gives two alerts. The first one is "IF_Gx_8bit_DB" (which exists) and the second alert has "0".
Whether the database is on the palm or not, it always gives "0".

I even tried:
dbopen(dbname) || alert("Error: Database "+dbname+" missing!");

Whethere the database was installed or not, it gave that alert.

// Set resolution to use
graphmode() {
int depth;
string dbname;
depth=SetDepth(-1);
if (depth&8) { SetDepth(8); dbname=("IF_Gx_8bit_DB");}
else if (depth&4) { SetDepth(4); dbname=("IF_Gx_4bit_DB");}
else { SetDepth(1); dbname=("IF_Gx_BW_DB");}
depth=dbopen(dbname);
alert(dbname);
alert(depth);
// || alert("Error: "+dbname+" missing. Please install and restart this program!"); exit();
}


Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
If you love PocketC, you'll love this!
Join and become part of the community!
News, reviews, free source code and more!
Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
WauloK
 
Posts: 232
Joined: Tue Jan 15, 2002 2:41 am
Location: Australia

Postby WauloK on Sun Mar 03, 2002 2:18 am

Possible reason?

"All the database functions work on databases with any creator id/type, but use of resource databases may cause unexpected results. "

Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
If you love PocketC, you'll love this!
Join and become part of the community!
News, reviews, free source code and more!
Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
WauloK
 
Posts: 232
Joined: Tue Jan 15, 2002 2:41 am
Location: Australia

Postby jstadolnik on Sun Mar 03, 2002 4:37 am

dbopen used to work on resource databases... it looks like Jeremy changed this recently.

Use dbtotalsize instead.

Also, you are tapping the wrong bits from the SetDepth(-1) result. The return format is not what you think. Look at the docs more carefully, there's a paragraph on this.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby WauloK on Sun Mar 03, 2002 5:28 am

Ok corrections fixed. Thanks for your help.

// Set resolution to use
// and check PTL version
graphmode() {
int depth;
string dbname;
depth=SetDepth(-1);
if (depth&7) { SetDepth(8); dbname=("IF_Gx_8bit_DB");}
else if (depth&3) { SetDepth(4); dbname=("IF_Gx_4bit_DB");}
else { SetDepth(1); dbname=("IF_Gx_BW_DB");}
if (!dbtotalsize(dbname)) {alert("Error: "+dbname+" missing. Please install and restart this program!"); exit();}

if (GetPTVersion()<1826) { alert("Version of PToolboxLib is lower than 7.2.2 Please upgrade to a later version. You can find a link to download it at http://www.orbworks.com"); exit();}

}


Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
If you love PocketC, you'll love this!
Join and become part of the community!
News, reviews, free source code and more!
Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
WauloK
 
Posts: 232
Joined: Tue Jan 15, 2002 2:41 am
Location: Australia


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 2 guests

cron