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
Page 1 of 1

PostPosted: Sat Mar 02, 2002 9:52 pm
by WauloK
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!

PostPosted: Sat Mar 02, 2002 10:01 pm
by jstadolnik
Use the built-in dbopen function to test if the database exists.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm

PostPosted: Sat Mar 02, 2002 10:36 pm
by WauloK
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!

PostPosted: Sun Mar 03, 2002 2:05 am
by WauloK
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!

PostPosted: Sun Mar 03, 2002 2:18 am
by WauloK
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!

PostPosted: Sun Mar 03, 2002 4:37 am
by jstadolnik
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

PostPosted: Sun Mar 03, 2002 5:28 am
by WauloK
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!