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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Are you a Labtalk?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

monkeyk

United Kingdom
1 Posts

Posted - 03/18/2018 :  2:53:28 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

i'm teacher

yuki_wu

896 Posts

Posted - 03/19/2018 :  01:22:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi J,

The methods you mentioned are all the ways to execute the LabTalk script, you could just choose one of the methods that you feel it is convenience. Besides, there are other methods and you could find here:
https://www.originlab.com/doc/LabTalk/guide/Running-Scripts

Regards,
Yuki
OriginLab
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000