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
 Origin Forum
 Renaming worksheet columns and datasets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Tom Blanpied

Durham, NC, US
1 Posts

Posted - 08/14/1998 :  7:57:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi all. I'm confused about renaming worksheet columns and datasets. I would
like to rename a worksheet column to something based on user input during
button script execution. There seem to be a number of ways I can do this, but
each has problems.

The most clumsy way is by switching the active window to the worksheet (in
this case data1), renaming the column, and changing back the active window to
what it was and where the button is (in this case, graph1):
win -a data1;
work -n 3 newname;
win -a graph1;

This isn't always suitable, since it maximizes the worksheet. Why is it
necessary to have the worksheet command only operate on the active worksheet?

Alternatively, it seems as though one could use the win -w command to execute
scripts temporarily considering the worksheet the active window:
win -w data1;
work -n 3 newname;
win -w graph1;
This simply doesn't work. I don't know why, although it isn't clear from the
Labtalk manual whether this is the correct format for this command. (Is the
second win -w command supposed to specify the original active window? Is
this all supposed to be executed within brackets?)

Using the set command seems as though it should be the best option. However,
this has been more troublesome. I used:
set data1_C -n data1_newname;
and was dismayed that the column name in the worksheet did not change. Then I
noticed that the dataset name (as listed in the layer n dialog box) was in
fact changed. However, going into the Plot Associations dialog for the layer
lists only the column names as they appear on the worksheet. So the same data
is now appearing in different places as having different names. Was a new
dataset created somehow? The other problem with this command for my purposes
is that it cannot be used to rename X columns.

I'll take any advice.

Tom

a_user

USA
0 Posts

Posted - 08/14/1998 :  7:58:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Renaming ...

Just a small hint ...

have you tried something like that ?
getstring (blabla) %Z (Horrigin);
worksheet -b %E;
wks.colXX.name$=%Z # XX is the number of the column in the worksheet

For my applications this works. Columns are renamed and I can address the datasets with %E_bla1 (for %Z=bla1, you probably have to do some string handling if you use %Z in the dataset...). Another problem is of course that Origin really loves to forget %E and I did not find any reason when and why yet...

By the way ...

Anyone out there at Microcal who is able to answer my last question ?

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