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
 Command Window executed from C code

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
j@y Posted - 08/28/2015 : 09:13:22 AM
Hi everyone,
To be able to import a file, I need to run.LoadOC(Originlab\FileImport.c, 16); in Command Window. Is it possible in general to execute a Command Window's expression from the C code? Something like LabTalk's LT_execute()?
Many thanks for your help!
2   L A T E S T    R E P L I E S    (Newest First)
j@y Posted - 08/29/2015 : 12:52:51 AM
Many thanks, Castiel! You are totally right. run.LoadOC() is a LabTalk code, so I can do this with a button...
Option #1 seems easiest to me. I need to compile and use a code containing import_file() to import the TDM file. I know there is also an impNITDM X-function. But I am not too familiar with X-functions yet. impNITDM works fine from Command window, but CW is not what I want...
Best regards, Jiri
Castiel Posted - 08/28/2015 : 10:55:13 AM
quote:
Originally posted by j@y

Hi everyone,
To be able to import a file, I need to run.LoadOC(Originlab\FileImport.c, 16); in Command Window. Is it possible in general to execute a Command Window's expression from the C code? Something like LabTalk's LT_execute()?
Many thanks for your help!



The run.loadoc() is really annoying. Two solutions as far as I can see:
1. Create a toolbar (or ogs file...), when click a button on the toolbar, first run.loadoc(originlab\fileimport.c, 16), then run.loadoc(your_source_code, 16), and finally invoke your function....
2. Take int ImportASCII() for example,
first, typedef int (*FIMPORTASCII)(Page &pgTarget, TreeNode &trFilter, LPCSTR lpcszFile, int nFile);
then
Function fn = Project.FindFunction("ImportASCII", GetAppPath(TRUE) + "OriginC\\OriginLab\\FileImport.c");
FIMPORTASCII pf = fn;
pf(....);
See the example of Project::FindFunction().

©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦

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