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 Automation Server/COM and LabVIEW
 How to debug m_originApp.Execute()

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
newuser_ca Posted - 11/05/2012 : 3:38:12 PM
Origin 8.6 Pro in Win7
Visual C# 2010

I have C# codes to call origin function. I have a problem to parse a string containing comma.
Here are my C# code:
m_originApp.Execute("StringArray wordArray;StringArray styleArray;"); // define a LabTalk string array
string str = "wordArray.Add(abc);styleArray.Add(123);"; // add string to array command
m_originApp.Execute(str);
string title = "\"this is the title, please check\"";
string input = "C:\\Users\\origin\\AppData\\Local\\Temp\\tdv_1468707591030654585.dat";
string pltSampleCMD1 = "string testName = CSharp_test2(" + title + "," + input + ",wordArray,styleArray,1)$;";
m_originApp.Execute(pltSampleCMD1); // execute the LT command
string st1 = m_originApp.get_LTStr("testName");
MessageBox.Show(st1, "Msg");



Here are my origin codes:

string CSharp_test2(string title, string inputfile, StringArray tlmArray, StringArray styleArray, int gridFlag)
{
printf("title is %s\n", title);
printf("input file is %s\n", inputfile);
return title;
}


if I defined my "input" in C# as
string title = "\"this is the title, please check\""; // with comma
string input = "inputfile";

it will work.

Or if I define
string title = "\"this is the title\""; // no comma
string input = "C:\\Users\\origin\\AppData\\Local\\Temp\\tdv_1468707591030654585.dat";

It will work, too.

I don't know what's wrong in the first case. I step into it, and noticed that m_originApp.Execute(pltSampleCMD1) is not executed at all.
Is there any way to debug m_originApp.Execute()?

Thanks!
3   L A T E S T    R E P L I E S    (Newest First)
fifacoins11 Posted - 10/04/2015 : 01:40:00 AM
FIFA 16 is an association football simulation video game published by EA Sports for Microsoft Windows, PlayStation 3, PlayStation 4, Xbox 360, Xbox One, Android and iOS. The game is the first in the FIFA series to include female players at fifa16.vipmmobank.com
newuser_ca Posted - 11/08/2012 : 09:50:29 AM
Thanks a lot for your help.
It is working now.

Penn Posted - 11/08/2012 : 03:35:27 AM
Hi,

The problem is not about the comma. There is the number of characters of arguments limitation when calling a function in LabTalk. For now, the solution is to put the "title" and "input" into the LabTalk string, such as

m_originApp.Execute("StringArray wordArray; StringArray styleArray;");
string str = "wordArray.Add(abc); styleArray.Add(123);";
m_originApp.Execute(str);
// string title = "\"this is the title, please check \"";
m_originApp.Execute("string title$ = \"this is the title, please check\";");
// string input = "C:\\Users\\origin\\AppData\\Local\\Temp\\tdv_1468707591030654585.dat";
m_originApp.Execute("string input$ = \"C:\\Users\\origin\\AppData\\Local\\Temp\\tdv_1468707591030654585.dat\";");
// string pltSampleCMD1 = "string testName$ = CSharp_test2(" + title + "," + input + ", wordArray, styleArray, 1)$;";
string pltSampleCMD1 = "string testName$ = CSharp_test2(title$, input$, wordArray, styleArray, 1)$;";
m_originApp.Execute(pltSampleCMD1);
string st1 = m_originApp.get_LTStr("testName");
MessageBox.Show(st1, "Msg"); 


Penn

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