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
 addding comments to data columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

andrewdsto

Australia
Posts

Posted - 05/09/2012 :  04:32:56 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.5 and Service Release 1(Select Help-->About Origin):
Operating System: windows XP

Hi,
I have a data plot(s) containing some dataset ... for example

%c=;
filtered_U2@2

this tells me the dataset is contained within the worksheet called filtered on the second sheet and in a column headed U2.

All very well
however I wish to add a comment to the column's comment field eg "data is filtered"

Is there a simple way to do this using the fact that the dataset is contained within %C and this points to an actual dataset located within a worksheet.

Of course I can strip out all the relevant information and create code to determine the sheet name and relevant column number from the dataset name.. which leads to something like the following code

[filtered]e1u1!col(3)[c]$= "data is filtered";


but I thought there might be a simple way of adding the comment to the column, simply by knowing %c = filtered_U2@2.

I mean
filtered_U2@2[c]$= "data is filtered";

for example.. does work
but how do I enter the correct substitution using only %c to make it work?


Also.

I can also use a string variable so that activefilterset$=%c;
such that
activefilterset$=;
returns
filtered_U2@2

this is in fact my preferred way of dealing with datasets so that I don't loose or confuse which dataset I am manipulating.


thanks
Andrew




Sam Fang

293 Posts

Posted - 05/09/2012 :  04:56:19 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can use:
%C[c]$= "data is filtered";


or

%(activefilterset$)[c]$= "data is filtered";


Sam
OriginLab Technical Services
Go to Top of Page

andrewdsto

Australia
Posts

Posted - 05/09/2012 :  9:42:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks Sam,

You know I tried that before I posted the question and it failed, but now it works... the reason I posted the question is because I thought it should work.
Maybe just a temporary bug, it was running a little slow. Perhaps next time I will exit and come back in a try when it is a simple thing.

thanks Again.

Go to Top of Page

andrewdsto

Australia
Posts

Posted - 05/09/2012 :  10:00:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
actually, here we go, the error occurs with the use of the assigned dataset variable name:- activefilterset$


acitivefilterset$=%c;
%c=;
acitivefilterset$=;

%c[c]$ = "filter attemp 1";
type ok;
%(activefilterset$)[c]$ = "filter attemp 2";


filtered_U2@2
filtered_U2@2
ok
#Command Error!



ok so I can get around this by a temp assignment to %z for example


acitivefilterset$=%c;
%c=;
acitivefilterset$=;

%c[c]$ = "filter attemp 1";
type ok;
%z=activefilterset$;
%z[c]$ = "filter attemp 2";
type ok2;


filtered_U2@2
filtered_U2@2
ok
ok2



but why doesn't the actual assignment work?

Edited by - andrewdsto on 05/09/2012 10:10:07 PM
Go to Top of Page

Sam Fang

293 Posts

Posted - 05/09/2012 :  10:27:01 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There is a spelling error in your script. It should be activefilterset$ not acitivefilterset$.

Sam
OriginLab Technical Services
Go to Top of Page

andrewdsto

Australia
Posts

Posted - 05/09/2012 :  11:45:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
point taken with the spelling, but the problem still exists


afset$=%c;
%c=;
afset$=;


%c[c]$ = "filter attempt 1";
type ok;
%z=afset$;
%(afset$)[c]$ = "filter attempt 2";
type ok 2;
%z[c]$ = "filter attempt 3";
type ok3;



filtered_U2@2
filtered_U2@2
ok
#Command Error!
Go to Top of Page

Sam Fang

293 Posts

Posted - 05/10/2012 :  04:27:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes. %(afset$)[c]$ can't work in 8.5.

It is a bug in Origin8.5. It has been fixed in 8.6.

Sam
OriginLab Technical Services
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