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 !

"strupr" don't work in PCA !

Discuss OrbForms Designer and PocketC Architect

Postby RWB on Tue Nov 21, 2006 9:09 pm

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
RWB
RWB
 
Posts: 28
Joined: Fri Feb 10, 2006 12:43 pm
Location: Sweden

Postby mlambrigger on Wed Nov 22, 2006 8:30 am

just change and use strupper

Marc Lambrigger
Marc Lambrigger
mlambrigger
 
Posts: 113
Joined: Fri Feb 13, 2004 11:07 am
Location: Switzerland

Postby RWB on Thu Nov 23, 2006 1:46 pm

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
RWB
RWB
 
Posts: 28
Joined: Fri Feb 10, 2006 12:43 pm
Location: Sweden

Postby mlambrigger on Thu Nov 23, 2006 2:05 pm

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
Marc Lambrigger
mlambrigger
 
Posts: 113
Joined: Fri Feb 13, 2004 11:07 am
Location: Switzerland

Postby RWB on Fri Nov 24, 2006 4:57 pm

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
RWB
RWB
 
Posts: 28
Joined: Fri Feb 10, 2006 12:43 pm
Location: Sweden

Postby dewey on Thu Nov 30, 2006 7:02 pm

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.
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 2 guests

cron