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
 Problem with string handling
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

alexander.steppke

Germany
10 Posts

Posted - 10/25/2010 :  09:50:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Using Origin 8.1 I get a strange error using Origin C and strings as parameters. My example code looks as follows:


void string_test1(string s1, string s2)
{
	printf("string 1: %s\n", s1);
	printf("string 2: %s\n", s2);
}


Calling this from the command windows works with these arguments nicely:
quote:

>>string_test1("a", "b")
string 1: a
string 2: b



It fails with these arguments though:
quote:

>>string_test1("a", "b=c")
incorrect number of arguments passed to function: string_test1
#Command Error!
>>


It seems that the equals sign triggers some kind of interpretation that I do not want. Escaping it with \= did not make any difference or putting ' around the string values. Can somebody give me hint what is going on here or is this a bug in Origin?

Thanks for any help.
Alexander

easwar

USA
1964 Posts

Posted - 10/25/2010 :  3:36:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Alexander,

This is a bug, we will fix it in future version.

For now if you call the function the following way it works:
string_test1 "a" "b=c"
So just remove the parantheses and list the strings/function parameters one after the other without the comma.

Easwar
OriginLab
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