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 - hiscorelib

hiscorelib

Discuss PocketC for Palm OS (including Desktop Edition)

Postby Thad on Fri Nov 30, 2001 11:41 am

HISCORELIB - A free open source code library for PocketC.

Makes keeping a high score table easy as pi:

http://thad.notagoth.org/palm/hiscorelib/

Yummy.

Thad

Thad
Thad
Thad
 
Posts: 33
Joined: Thu Feb 22, 2001 10:27 am
Location: United Kingdom

Postby ilvmegs on Mon Mar 21, 2005 9:18 pm

Personally, I can make pie easier; hopefully someone can lend me a little aid. I think I'm having a hard time with the pointers in the code.

I'm trying to create a small hiscore table demo using the hiscorelib. I doing good with creating the table and saving it. I've gotten the info back out of it but I can't figure out how to add a new score to the table. When I run the following applet I get the error: "Addr: 1484 Func: insert_HISCORE Global ref out of range".

Does anyone have some sample code of using this library? Or can you help me figure this out? Thank you!

Nick

ilvmegs
ilvmegs
ilvmegs
 
Posts: 14
Joined: Tue Mar 15, 2005 2:57 pm

Postby ilvmegs on Mon Mar 21, 2005 9:19 pm

Oh, here's what I'm doing:

//high score demo

include "hiscorelib.h"

pointer p, hiscore, name;
int score;


main(){

clear();
new_HISCORE(10);
save_HISCORE(p, "testhiscore");

puts(getname_HISCORE(hiscore, 1) + ", " + getscore_HISCORE(hiscore, 1));

score = gets("score?");

wait();

insert_HISCORE(hiscore, score, name);

puts(getname_HISCORE(hiscore, 1) + ", " + getscore_HISCORE(hiscore, 1));
wait();

}//end main

ilvmegs
ilvmegs
ilvmegs
 
Posts: 14
Joined: Tue Mar 15, 2005 2:57 pm

Postby dewey on Tue Mar 22, 2005 4:10 am

The biggest problem here is that you are calling new_HISCRORE, but not saving the result anywhere. You should be assigning this to "hiscore". When you call save_HISCORE, you should be passing "hiscore", not p (which is uninitialized, and is causing the crash).
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Postby ilvmegs on Wed Mar 23, 2005 4:44 pm

The following gives me the table I expect. When I uncomment the insert_HISCORE() the program immediantly exits. How do I pass the Name and the Score to the insert_HISCORE so that it actually inserts the info into the db? If I uncomment the //name = *usname; I get a global ref out of range in the main funcion. I appreciate your help!

Nick

//high score demo

include "hiscorelib.h"

pointer p, hiscore, name;
int score;
string usname;

main(){

clear();
hiscore = new_HISCORE(5);
save_HISCORE(hiscore, "testhiscore");

usname = "Nick";
//name = *usname;
score = 10;

//insert_HISCORE(hiscore, score, name);

save_HISCORE(hiscore, "testhiscore");

puts(usname +score+"\n");
puts(getname_HISCORE(hiscore, 1) + ", " + getscore_HISCORE(hiscore, 1)+"\n");
puts(getname_HISCORE(hiscore, 2) + ", " + getscore_HISCORE(hiscore, 2)+"\n");
puts(getname_HISCORE(hiscore,3) + ", " + getscore_HISCORE(hiscore, 3)+"\n");
puts(getname_HISCORE(hiscore, 4) + ", " + getscore_HISCORE(hiscore, 4)+"\n");
puts(getname_HISCORE(hiscore, 5) + ", " + getscore_HISCORE(hiscore, 5)+"\n");

wait();

}//end main

ilvmegs
ilvmegs
ilvmegs
 
Posts: 14
Joined: Tue Mar 15, 2005 2:57 pm

Postby dewey on Thu Mar 24, 2005 2:53 am

insert_HISCORE takes a pointer (hiscore), an int (score), and a string (usname). Since usname is not a pointer, you cannot dereference it, which is why "*usname" causes an error. "name" is a pointer, so you should not be passing it to insert_HISCORE (which expects a string). In fact, your code has no use for it at all. Get rid of "name" and "p".
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Re: hiscorelib

Postby palmosm130 on Thu Oct 09, 2008 11:05 pm

Hi... I've noticed that the hiscorelib is missing on all accounts. May I please get a copy? Thank You.
Kirk P Lawrence
palmosm130
 
Posts: 19
Joined: Fri May 27, 2005 1:51 am
Location: Canada


Return to PocketC for Palm OS

Who is online

Users browsing this forum: No registered users and 4 guests

cron