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
 set - x command
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

scs_emi

4 Posts

Posted - 04/14/2016 :  05:21:41 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have an old code in Labtalk (written about 2000) that is supposed to draw a graph in red color. I use Origin 2015. Unfortunately the code doesn`t run properly. ( It did back in 2000, though)

...
%M=Time;
%N= aX1Y10;
%S=Data_%N;
set %S -x Data_%M;
set %S -c 2;
...

The problem occurs in this line where my LabTalk Script Window reports an #Command Error!

set %S -x Data_%M;

When I look in the manual of Labtalk they show the set -x - command, but the command is written in a lighter color. Does this mean that there was a change made in this command within the last 15 years? Is there an other command that I would be supposed to use today?


Thank you

itelly

SeanMao

China
288 Posts

Posted - 04/15/2016 :  02:01:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I tried your code, it works on my side in Origin 2015. Here is how I understand your code:

You have a workbook named "Data", you have one column with short name "aX1Y10" and another column with short name "Time". Previously, you have plotted column "Time" with respect to some X column and now you want to switch to use column "aX1Y10" to replace the X of current graph.

The command set %S -x Data_%M will set column %S (aX1Y10) as the X column of column %M (Time). However, since %S is already regarded as X column and when you use set %S -c 2 to set the color it will not work.

You will need to change your last command line to:

set %C -c 2; // set current active plot as red
or
set Data_%M -c 2; // set specified plot as red.

Hope I make this clear to you.

Regards!

Sean

OriginLab Tech.


Edited by - SeanMao on 04/15/2016 02:02:32 AM
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