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

PostPosted: Sun Jan 05, 2003 12:53 am
by Eli
I am trying to do a simple sort (rev and natural) on a one dim array using the sort command.

I set up my commnad as follows
Sort(1000100010000,1,0,count_players-1,temp_list[0]); // rev sort
where count_players is the total elements in temp_list array i am trying to sort.
I am getting a "Global ref out of range" error.

What am i doing wrong? The example in the documentation is to complex to apply.

PS is there a good converter to figure out the binary to octal field translation? I think this is the correct bin number for the simple sort.

thanks
Eli

Eli

PostPosted: Sun Jan 05, 2003 1:12 am
by jstadolnik
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Sort(1000100010000,1,0,count_players-1,temp_list[0]);<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

PocketC doesn't understand binary numbers. It is treating 1000100010000 as an integer. Use hexadecimal format (e.g. 0x1110 in your case).

Make sure that temp_list[0] is a pointer to an array. You probably want &temp_list[0] here, or even just temp_list should work.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">PS is there a good converter to figure out the binary to octal field translation?<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Octal? You want hexadecimal notation. I would suggest doing a search at palmgear.com. I've seen quite a few converteer apps, but can't remember thier names.

Joe


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

PostPosted: Sun Jan 05, 2003 1:38 pm
by Eli
Joe, thanks for the quick reply, but i am still having the same problems. The array is only 18 elements big created as a temp array to be displayed immediately so i don't format it as a pointer for my program. (i.e. temp_list = {joe, eli, james, kevin,...}).

What should my blocksize, offset, and numblocks be? i am so confused with this.

thanks again.

ps. your right i meant hex.

Eli

PostPosted: Sun Jan 05, 2003 2:43 pm
by jstadolnik
That last argument of Sort must be a pointer. Now a pointer is really the "address" to some other data element.

If you declare an array as follows:
string data[100];

The term "data" itself is a pointer (contains the addrees) to the first element in the array.

An alternative format is &data[0], which also yields the address to the first element.

The example given in the Sort section uses a multi-dimensional array, such that "data" is actually a array of pointers. In your case you just have an array of strings.

Just do:

Sort(0x1110,1,0,count_players-1,temp_list);

or alternatively,

Sort(0x1110,1,0,count_players-1,&temp_list[0]);

Joe


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

PostPosted: Sun Jan 05, 2003 7:30 pm
by Eli
THANKS!!!! :)

Eli