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
 Origin Forum
 Button for my attached scriptfile

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
Chris2 Posted - 10/07/2010 : 03:36:47 AM
Windows Vista
Origin 8.1

Hello,

I have a Origin Project and attached a Origin C-Script to this project so everbody has the opportunity to see the script whether he has the script on his pc or not (of course if he has the projectfile). Now my question is, if it is possible to create my own button which executes functions of the attached scriptfile without any ogs-files.

Hope you can help me
2   L A T E S T    R E P L I E S    (Newest First)
rlewis Posted - 10/08/2010 : 01:48:08 AM
However, to ensure that the OriginC finction is compiled when you activate the button, you will need to do a bit more than indicated by Larry above ....
The following is an example of a button script that I use to ensure compilation and execution of an OriginC function called "MassNormalizeMCVPDSC" which is located in an OriginC file called "MicroCalDSC.c"


%P=System.Path.Program$;
%Z=OriginC\System\rnahl\ImportSpecial\MicrocalDSC\MicroCalDSC.c;
if(run.loadOC(%P%Z)!=0)
{
     ty -q Cannot Load Origin Support File MicroCalDSC.c;
     ty -b;
}
 else
{
     ty -q Loading Origin Support File MicroCalDSC.c;
     MassNormalizeMCVPDSC();
};
larry_lan Posted - 10/07/2010 : 11:43:20 PM
Hi Chris:

Are you saying you attached an .c file in the OPJ? When talking about script, we mean .ogs files in Origin.

So, currently, you have a .c file, which attached in an OPJ. Then you share this OPJ. And you want to run the .c file by a single click in another computer. Right?

If so, you can:

  • As you mentioned, you need an .ogs file and a custom button. And then associate this .ogs with the button settings. The draw back is you should also share this .ogs file.


  • Make a button by:

    Add a test on worksheet, right-click and select Programming Control.



    And then call the c function



  • Beside buttons, you can also turn you .c functions into an X-Function, and shared this X-Function with others. X-Functions can easily run from command window or custom menu item. It just need to compile once, and it doesn't need to attached with an OPJ. Please look at "Help -> Programming -> X-Function" to see how to create one.


Thanks
Larry

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