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
 Whai is does " set %k -x Data1_A$(i) " mean ?
 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 - 07/15/2015 :  07:39:50 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi there

I have to maintain an old program that uses a LabTalk script to draw some charts. This script does not run correctly. Since I am a total beginner with Origin Labtalk I have the following question: My code opens 2 data-sources and is supposed to draw the data into 1 graph. When I execute my code it opens an empty graph without data.
___________________________________________________________________

%A=C:\A_Grid#2a.dat;
%B=C:\A_Grid#2b.dat;
xn= 41;
...
window -a Data1;
for (i=1;i<=xn;i+=1) {
worksheet -t $(i*2-1) 4;
worksheet -n $(i*2) B$(i);
worksheet -n $(i*2-1) A$(i);
}
window -i;
window -a Data2;
for (i=1;i<=yn;i+=1) {
worksheet -t $(i*2-1) 4;
worksheet -n $(i*2) B$(i);
worksheet -n $(i*2-1) A$(i);
}
window -i;
window -a Plot;
for (i=1;i<=xn;i+=1) {
%k=Data1_B$(i);
set %k -x Data1_A$(i); // without these lines it works but Why?
layer -i %k;
}

for (i=1;i<=yn;i+=1) {
%k=Data2_B$(i);
set %k -x Data2_A$(i); // without these lines it works but Why?
layer -i %k;
}

___________________________________________________________________

When I leave out the following lines, it works.

set %k -x Data1_A$(i);

set %k -x Data2_A$(i);

Does anybody know

- what this line is supposed to do?
- What the set-command is?
- What -x means ?

Thanks for your help.

itelly

Edited by - scs_emi on 07/15/2015 07:42:26 AM

cdrozdowski111

USA
247 Posts

Posted - 07/15/2015 :  12:27:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
itelly,

Here is the documentation on the command:

http://www.originlab.com/doc/Labtalk/Ref/Set-cmd#-x_value.3B_Associate_an_X_dataset_with_a_Y_dataset

Those lines of code are attempting to change the associated X column for each of the Y columns plotted in the graph. But if it works correctly without those 2 lines, then just comment them out.
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