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

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

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

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

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

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

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

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

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[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 - Search a HanDBase

Search a HanDBase

A PocketC native palm library offering native forms and assorted utilities

Postby znamezsame on Fri Oct 10, 2003 1:32 pm

What is the fastest way to search a HanDBase database? I'm currently using this:

FindKey(string strDB, int intField, string strKey){

// Returns the record # of a record in DBname that contains strKey in field# intField
// Returns -1 on failure
// Note: Opens strDB in the process and leaves it open

int intRecords, intRecord=0, ctr;
string strField;

DBopen(strDB);
intRecords=DBinfo(2,0);

for(ctr=0;ctr<intRecords;ctr++){
strField = DBgetfield(ctr,intField);
if (strKey==strField){
intRecord = ctr;
break;
}
}
if (intRecord>0){
return intRecord;
}else{
return -1;
}
}

It works, but is quite slow. Along this line of questioning, I was investigating HB++, is it possible to use your library with this language? Or perhaps read HanDBase files directly with HB++? I tried opening them, but it looked like gibberish to me. Who knows if I was doing it right or not. I guess what I'm asking is if there is some special way to read these files that your library is using, that I could produce in a faster language (than PocketC). If not, or if it would be exceedingly difficult, I'm just hoping for a faster search in PocketC.
znamezsame
 
Posts: 5
Joined: Fri Oct 10, 2003 1:23 pm

Postby jstadolnik on Fri Oct 10, 2003 4:04 pm

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
What is the fastest way to search a HanDBase database?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

You're doing it.

Currently, that's pretty much the fastest way to search a HanDBase database. I do have plans for adding a DBsearch function for just that purpose, but the speed gain would probably be x2 at best.

Under the hood, the PToolboxLib calls the HanDBase app itself and request a database operation (create, read, write, etc). The problem right now is that the HanDBase app itself is terribly slow at doing these operations. HanDBase v2.x was slow, but something went wrong in v3.x and things are now even slower. Hopefully the HanDBase team will get around to speeding up thier 3rd party app interface (which they call "HAPI") sometime in the near future. I would suggest emailing them directly and putting in a request for speeding up thier HAPI interface.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
Along this line of questioning, I was investigating HB++, is it
possible to use your library with this language?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Nope, only PocketC.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
Or perhaps read HanDBase files directly with HB++?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

The last I knew, DDH software has not publically released the structure of HanDBase databases. They instead provide this HAPI interface I mentioned earlier to allow 3rd party apps to access these databases through the HanDBase app itself. This allows DDH to completely change the database structure at will without effecting 3rd party apps (which they did in the v2.x to v.3 migration).

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
I guess what I'm asking is if there is some special way to read these files that your library is using, that I could produce in a faster language (than PocketC).
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

The slowness here is not because of PocketC or the library, it's due to the HanDBase app itself. You will see this slowness with development platform you use (which employs the HAPI interface).

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 znamezsame on Fri Oct 10, 2003 5:18 pm

Thank you very much Joe. It's nice to hear from someone who actually knows their stuff.

I went to DDH's site and snagged their HAPI interface code. But it would probably help if I knew real C. Pocket C is about the extent of my C coding experience, and got the book recommended on the OrbWorks site to learn it. I dabbled with C in the past, but I am a fairly strong VB guy. Hence my attraction to HB++. I would love to use OnBoardC. I think PocketC is nifty, but it's insanely cool to build native standalones right there in the Palm. Anyway, I guess my point is I don't know if it would be worth my time to learn some real Palm C. Where would be a good place to learn the style of C I would need to build native Palm apps (perhaps keeping free compiliers like OnBoardC in mind)?

Oh, and you'll be receiving an email from me with the app I wrote with your library (as requested in the documentation). It's an interface to randomly select movies from my movie database, which I synch with Access. I can't imagine you'll actually use it, but I'll send the whole lot to ya. You deserve it man. ;-)
znamezsame
 
Posts: 5
Joined: Fri Oct 10, 2003 1:23 pm

Postby jstadolnik on Sat Oct 11, 2003 1:13 pm

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
I went to DDH's site and snagged their HAPI interface code. But it would probably help if I knew real C. Pocket C is about the extent of my C coding experience, and got the book recommended on the OrbWorks site to learn it. I dabbled with C in the past, but I am a fairly strong VB guy. Hence my attraction to HB++.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

If you look carefully at the HAPI interface, you'll find that it's just a matter of data structures and using the SysAppLaunch PalmOS API call. As such, I would think that most native compiler languages could use HAPI with a bit of modification.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
I would love to use OnBoardC. I think PocketC is nifty, but it's insanely cool to build native standalones right there in the Palm.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

OnBoardC is definitely nice. It gives you a lot of control (access to most of the PalmOS API) and generates small stand-alone executables. However, PocketC is way easier to use than OnboardC. With PocketC and the PToolboxLib, much of the dirty work is done for you (it generally takes much more OnboardC code to produce the same results). The higher complexity of OnboardC code also makes it much more error prone (it's much easier to crash an OnboardC app). As such, PocketC is much more convenient langauage for onboard development. That said OnboardC does have advantages: more fine grained control (direct palmOS API access), standalone apps generated onboard, app speed, and app size. It's matter of what you want to do, and how much time you want to spend doing it.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
Anyway, I guess my point is I don't know if it would be worth my time to learn some real Palm C. Where would be a good place to learn the style of C I would need to build native Palm apps (perhaps keeping free compiliers like OnBoardC in mind)?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

If you're a programmer, it's always good a know a couple of languages. Each has thier own benefits and drawbacks. There's tons of C programming books out there. I would suggest digging around on Amazon and reading the various reviews. Also keep in mind that OnboardC is not a C++ compiler.

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 znamezsame on Mon Oct 13, 2003 1:57 pm

Is it possible to use "HapiFindNextLinkedRecord" to perform faster searches for a particular value within a field? I'm guessing no, since it didn't end up in PToolbox?
znamezsame
 
Posts: 5
Joined: Fri Oct 10, 2003 1:23 pm

Postby jstadolnik on Mon Oct 13, 2003 3:10 pm

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
Is it possible to use "HapiFindNextLinkedRecord" to perform faster searches for a particular value within a field? I'm guessing no, since it didn't end up in PToolbox?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

No, it actually quite doable. I'll add support for this on the next release.

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 znamezsame on Mon Oct 13, 2003 4:29 pm

Horray! :D I look forward to it. What kind of speed increase do you suppose there will be? I am astounded by the search speed of global find. It can search and find a string in any Palm database long before my loop above could find a single value in a specific field. HanDBase's searching from within the app itself is also quite fast. That's the kind of speed I would probably need to develop decent user interfaces to HanDBase back-ends.
znamezsame
 
Posts: 5
Joined: Fri Oct 10, 2003 1:23 pm

Postby jstadolnik on Mon Oct 13, 2003 7:15 pm

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">What kind of speed increase do you suppose there will be?<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

It would depend on how many records you are searching through. If say you are searching through 1000 records, you'll probably see on average a 500x speed up from the way you are currently doing it. I say this because the HanDBase app would only need to get called once, rather than potentially hundreds of times.

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


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 2 guests

cron