The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Compilation problem?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

peter.cook

UK
356 Posts

Posted - 05/31/2006 :  06:38:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5 SR6
Operating System: Win 2000

Hi,

I have two functions below :

int test1(string str1, string str2)
{
str1.MakeUpper();
str2.MakeUpper();
return(str1.Find(str2));

}


int test2(string str1, string str2)
{
str1.MakeUpper();
return(str1.Find(str2.MakeUpper()));

}



which I test with

TEST1(INTEGER,PATH|MOLARUNITS|STRING)= .... returns -1
TEST2(INTEGER,PATH|MOLARUNITS|STRING)= .... returns 7

I'm puzzled as to why..

Cheers,

Pete

easwar

USA
1965 Posts

Posted - 05/31/2006 :  08:42:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Pete,

Note that the MakeUpper() method does not return any value. It just sets the string to upper case. So in the test2 function, str2.MakeUpper() does not return a string as is needed for the Find() function to work.

The compiler should have caught this one - we will look into why it did not - thanks for reporting this.

Easwar
OriginLab



Edited by - easwar on 05/31/2006 08:49:56 AM
Go to Top of Page

peter.cook

UK
356 Posts

Posted - 05/31/2006 :  09:05:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Easwar,

Thanks. That makes sense I guess.

Cheers,

Pete

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000