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
[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 - "strupr" don't work in PCA !
Page 1 of 1

PostPosted: Tue Nov 21, 2006 9:09 pm
by RWB
I have used "strupr" in PocketC and it worked fine but, in PCA nothing happens!I included #include "pc_most.oc" and it seems to work for the other PocketC commands! but not strupr !!

string myname="borat";
myname(strupr[myname]);

myname should be BORAT but,

it still returns borat !

What's wrong? [:0]



RWB

PostPosted: Wed Nov 22, 2006 8:30 am
by mlambrigger
just change and use strupper

Marc Lambrigger

PostPosted: Thu Nov 23, 2006 1:46 pm
by RWB
Thanks Marc,for the reply.
strupper didn't work ,either!

borat BORAT was a silly exampel to see if there was another way to do this but in my real code it was not working.

ex: I loaded a memofile with a lot of strings.

string mystrings;
while (!mmeof()){
mystrings[data++] = mmgetl();
mystrings[data]=strupper(mystrings[data]);//strupr,strupper don't work here!

//strange!!

I solved it with a loop and used "substr" to convert it.
I wonder what Jeremy Dewey would replay on this matter!

Best regards RWB




RWB

PostPosted: Thu Nov 23, 2006 2:05 pm
by mlambrigger
the mystring[data] will return a char and not a string, this is why it does not work.
If you want to use different strings, convert your code to:

Code: Select all
string mystrings[100];
while (!mmeof()){
mystrings[data++] = mmgetl();
mystrings[data]=strupper(mystrings[data]);


This must work, but you are limited to 100 lines.
If you want more lines, update de mystrings[100] to a bigger value.
If you want to use it as autoadapted, write the following code:
Code: Select all
string* mystrings;
mystrings = new string[xx] // replace xx by your value
while(!mmeof()){
mystrings[data++] = mmgetl();
mystrings[data] = strupper(mystrings[data]);
}
free(mystrings);


Marc Lambrigger

PostPosted: Fri Nov 24, 2006 4:57 pm
by RWB
Hi Marc.I saw I had forgotten to set string mystrings; to

string mystrings[100]; when I wrote the exampel but,
I have string mystrings[xx]; in my original code, but it don't work anyway.Tested it again but, it won't work!

Solve the problem with :

if(mystrings[xx]=="z" ){
mystrings@[xx]="Z";
}

It was just a few letters, to strupper.

RWB

RWB

PostPosted: Thu Nov 30, 2006 7:02 pm
by dewey
The problem with the code is bad indexing:
Code: Select all
mystrings[data++] = mmgetl();
mystrings[data] = strupper(mystrings[data]);


When the loop is run the first time, data is 0, and the first line evaluates to mystrings[0] = mmgetl(). data is then incremented to 1 (data++). So, the second line actually makes mystrings[1] uppercase (which is an empty string).

To fix it, increment data after calling strupper.