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
 All Forums
 Origin Forum
 Origin Forum
 Renaming worksheet columns and datasets

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Tom Blanpied Posted - 08/14/1998 : 7:57:00 PM
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

1   L A T E S T    R E P L I E S    (Newest First)
a_user Posted - 08/14/1998 : 7:58:00 PM
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 ?


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000