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
 LabTalk Forum
 Are you a Labtalk/origin ninja?

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
jdf726 Posted - 02/02/2018 : 2:30:54 PM
Origin Ver. and Service Release (Select Help-->About Origin): Origin 2016 pro
Operating System: Win 7 pro

I have some experience with originC and labtalk but I think is something missing in my understanding - how to trigger scripts/code (perhaps with some input parameters) in a way that doesn't require you to remember lots of syntax (and maybe how to make the scripts general enough that you don't have to mess about with them every time).

Example: I often use the GUI to convert a matrix to a worksheet, copying the name across, setting the first row as column labels. I realised that I might as well write a labtalk snippet that does this in one go.

a$=page.name$; m2w -r 2 xy:=ycol xcol:=1 ylabel:=row1 ow:=[a$]; worksheet -s 0 1 0 1; wks.SetAsLabel(L,-1,0,0);

I can paste this onto the command line and it does the trick, but how do I make easy to trigger?
A toolbar button?
A custom menu item?
Should I compile this into an originC function so I only have to type 'mymatrixtoworkbook()', instead of typing "run.section(myfunctions,mymatrixtoworkbook)"?
Should I used the UIM (or whatever) to make my own GUI driven functions?

I am after some general good advice/ideas...How do labtalk/originc ninjas organise their workflow?


J.
5   L A T E S T    R E P L I E S    (Newest First)
jdf726 Posted - 02/16/2018 : 06:57:08 AM
To comment on what I have learned...

Although I already used a bunch of origin scripts and have dabbled in labtalk, I have now discovered that I can enhance my productivity using these tool by

1) adding newly created functions to a custom menu system (stored in an OMC file) means that it puts these within easy use, even if you have forgotten how they work.

2) using a mediawiki on a local PC for documentation (When I write a script/snippet that works, I post it there).

3) adding the code that Chris suggested for compiling origin c on a remote machine into an OMC entry (You could switch and compile workspaces this way).

I still don't know anything about getting user input (other than 'getstring' or the file dialog) so that is next.
Chris D Posted - 02/06/2018 : 09:50:52 AM
Hi jdf726,

I authored the blog post Yuki mentioned. If you can contact me at tech@originlab.com, we can continue the discussion about your needs via email since that may be more efficient that going back and forth in the forum.

Thanks,
Chris Drozdowski
Originlab Technical Support
jdf726 Posted - 02/05/2018 : 08:57:56 AM
LOL, I think that particular issue was one that I raised. It's nice to see a customer scenario written up that way. I will read more of your site...

I guess an extension to that question is 'Can every Origin instance in use in our group have a centralised custom menu?' ;-)

At the moment we have (centrally defined) functions with short names of the form 'abc4()' which prompt the user to choose user configuration files from a network drive before selecting input data.
The config files act as a substitute for multiple arguments in the function call e.g. 'abc4(1,true,1.2)' (because it's easy to loose track of argument place order) and also as a substitute for a user interface 'form' (because I don't know how to make one - we edit the config files in MS Notepad 'on the fly' using the right click menu 'edit' option!)

So, we don't use any custom menus or buttons to trigger the code, neither do we use any 'forms' to collect configuration data, both of which seem like a good idea.



J.



quote:
Originally posted by yuki_wu

Hi,

Not sure if you are looking for something like this blog, but you could have a look at first:
http://blog.originlab.com/programming/centralizing-originc-files-on-a-network

Regards,
Yuki
OriginLab

yuki_wu Posted - 02/05/2018 : 12:57:30 AM
Hi,

Not sure if you are looking for something like this blog, but you could have a look at first:
http://blog.originlab.com/programming/centralizing-originc-files-on-a-network

Regards,
Yuki
OriginLab
jdf726 Posted - 02/02/2018 : 4:59:30 PM
Aha! I managed to make a custom menu (with my name on it!) that looks like it can execute labtalk. Now I just need to work out how to make this run on different machines (and to call origin c functions).

My originc code and a workspace file is on a network drive, so I open the OC workspace file and compile, but can I make a centralised network .omc file for multiple machines?

I will look at the links here too...

https://www.originlab.com/doc/LabTalk/guide/Running-Scripts


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