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
[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 - Peek and Poke

Peek and Poke

A PocketC native palm library offering native forms and assorted utilities

Postby RunningUtes on Sat Jul 10, 2004 8:50 pm

I'm new to the Peek and Poke commands. Is there a listing of available addresses that are "safe" to peek and poke? I was actually interested if there is a way to peek data from a record in another database. For instance, using RsrcEdit on the palm, I've determined where specific data segments are located, that is records in a database. I would like to read this data and use it with a pocketC program. Is this possible?
RunningUtes
 
Posts: 20
Joined: Sun May 30, 2004 3:27 am

Postby jstadolnik on Sun Jul 11, 2004 12:52 am

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
I'm new to the Peek and Poke commands. Is there a listing of available addresses that are "safe" to peek and poke?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

The only safe places to access are the processor registers. You'll have to track down the various chip specifications (dragonball & MX from Motorola, Omap from TI, StrongArm from Intel, etc.) to figure out what registers are available for each processor type. You can muck with things like clock rates, uarts, all kinds of stuff, but it's all very low level.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
I was actually interested if there is a way to peek data from a record in another database. For instance, using RsrcEdit on the palm, I've determined where specific data segments are located, that is records in a database. I would like to read this data and use it with a pocketC program. Is this possible?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

This is dangerous because the OS can change the memory position of an application or database at will and without you knowing. So you can easily end up accessing the wrong data or worse blindly trampling the data of another application.

BTW: Using RsrcEdit you can figure out where in a record data is located, but it doesn't allow you to figure out where in sram space the record (or database) is located... and you'd have to know that to even attempt a peek.

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 RunningUtes on Sun Jul 11, 2004 4:37 am

So the Peek and Poke commands don't sound like they will work for reading a random database. Are there any other programs, commands, techniques, etc that will work?

I found another post that has something similiar to what I want. The program was AAEdit. The Author says that he wants to edit records in a database. Is this possible with AppPrefBytes? How does that work exactly (ie. I've looked at the code demo and still don't understand it.) ;-)

Could I access the database with dbreadx using s# with #=dbsize()?
I tried that already, but didn't have any luck. The string has a null character in the beginning. I tried replacing it using Toolbox Replace(pointer,"\00"," ",1,0) , but no luck either. Any other ideas?

Thanks!
RunningUtes
 
Posts: 20
Joined: Sun May 30, 2004 3:27 am

Postby jstadolnik on Sun Jul 11, 2004 1:53 pm

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
So the Peek and Poke commands don't sound like they will work for reading a random database. Are there any other programs, commands, techniques, etc that will work?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Use PocketC's database commands.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
I found another post that has something similiar to what I want. The program was AAEdit. The Author says that he wants to edit records in a database. Is this possible with AppPrefBytes? How does that work exactly (ie. I've looked at the code demo and still don't understand it.) ;-)
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

AppPrefBytes only works on the two preference databases.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
Could I access the database with dbreadx using s# with #=dbsize()?
I tried that already, but didn't have any luck. The string has a null character in the beginning. I tried replacing it using Toolbox Replace(pointer,"\00"," ",1,0) , but no luck either. Any other ideas?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Replace won't work in this fashion because PocketC has already axed everything after the first null. In other words, the data after the first null is already gone even before you called Replace().

As for solutions, you can pull all the data from a record into a byte array or you can keep reading the record for strings until the record end is reached.

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 RunningUtes on Mon Jul 12, 2004 2:02 pm

OK so this should work (I think) but is doesn't.
I'm using a handbase 2.75e database. The first 31 records contain information needed by handbase for itself. The actual data begins in record #31. I have a database setup with 3 positions in two records. The records are as follows:
Code: Select all
#31 - 00 03 00 31 41 00 03 00 32 42 00 03 00 33 43 00 ff ff
ASCII  .  .  .  1  A  .  .  .  2  B  .  .  .  3  C  .  y  y

#32 - 00 03 00 34 44 00 03 00 35 45 00 03 00 36 46 00 ff ff
ASCII  .  .  .  4  D  .  .  .  5  E  .  .  .  6  F  .  y  y

The data (1A,2B,3C) is seperated with 00 03 00 and the record ends with 00 ff ff. I know that 00 is a null character and signifies the end of a position in PocketC, but what I would like to do is cycle through all possible positions recogized by PocketC to parse the data.
I think that the data should come out like this ",.,1A,.,2B,.,3C,"
Code: Select all
//DB Access
main(){
string data, result[18];
int n;
puts(dbopen("dbName")+"\n"); //returns 1 if dbopen worked
puts(dbnrec()+",");          //returns 33 records
dbrec(31);                   //goto record #31
puts(dbsize)+"\n");          //returns 18 for record 31 size
for (n=0;n<18;n++){
dbreadx(&data,"sz");         //read string ending with null character
result[n]=data;              //store data in results array
for (n=0;n<18;n++)
puts(result[n]+",");         //return each possible position
}
RunningUtes
 
Posts: 20
Joined: Sun May 30, 2004 3:27 am

Postby jstadolnik on Mon Jul 12, 2004 9:34 pm

In your code, where is the close bracket "}" on your first "for" loop?

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 SamWillis on Fri Jul 23, 2004 3:15 pm

And theres no { on the end of the second for loop.

It should be:

//DB Access
main(){
string data, result[18];
int n;
puts(dbopen("dbName")+"\n"); //returns 1 if dbopen worked
puts(dbnrec()+","); //returns 33 records
dbrec(31); //goto record #31
puts(dbsize)+"\n"); //returns 18 for record 31 size
for (n=0;n<18;n++){
dbreadx(&data,"sz"); //read string ending with null character
result[n]=data; //store data in results array
<font color="blue">}</font id="blue">
for (n=0;n<18;n++)<font color="blue">{</font id="blue">
puts(result[n]+","); //return each possible position
<font color="blue">}</font id="blue">
}
SamWillis
 
Posts: 4
Joined: Mon Jun 28, 2004 1:44 pm


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 0 guests

cron