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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Problem with string handling

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
alexander.steppke Posted - 10/25/2010 : 09:50:30 AM
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
1   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 10/25/2010 : 3:36:24 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000