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
 problems with work -n colRef newName cmd
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

martinoli

Switzerland
2 Posts

Posted - 06/26/2002 :  09:08:44 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I'm trying to use the command

work -n colRef newName

to change the column's name, but using the original column name instead of the numeric reference. I've tried

work -n data1_A AA;

and it doesn't work (A is one column of the data1 worksheet, AA the newname).
I'm using the command as indicated in the labtalk manual. I've tried also making the window active and then just

work -n A AA;

The response is always the awful #command error !
I'll appreciate very much if you can help me with this. Cheers!

yuivanov

USA
11 Posts

Posted - 06/26/2002 :  10:15:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Piero
Here is the text from the help article:
-n colRef newName
Change the name of the colRef column to newName. ColRef must be the column number.


So I assume that if you type:

work -n 1 AA;

it should work.
Thanks
Yuri

Edited by - yuivanov on 06/26/2002 10:25:36
Go to Top of Page

martinoli

Switzerland
2 Posts

Posted - 06/26/2002 :  12:15:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I know that it works with the column number, my problem is that I want to use the column name. In the manual it says that if you don't type the number, it assumes you are typing the column name, but it doesn't work...Thanks anyway.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 06/26/2002 :  1:03:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You must be using an older version of Origin. The Origin 5.0 manual says something about using a name instead of number for colRef, but the 7.0 manual states specifically that colRef must be a number (as quoted by Yuri). The manual was undoubtedly revised because of experiences like yours.

If you need to change the name of a column but don't know the column number you can use something like this (the worksheet in question must be active)...

%A=current_name;
loop (ii,1,wks.ncols)
{
%B=wks.col$(ii).name$;
if("%B"=="%A") break;
};
wo -n ii new_name;

That script works in Origin 5 and up. (Notice that %A and %B are both in quotes in the if statement. That's necessary when comparing string variables.)

Mike Buess
Origin WebRing Member
Go to Top of Page

martinoli

Switzerland
2 Posts

Posted - 06/27/2002 :  04:20:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
..

Edited by - MARTINOLI on 06/27/2002 04:25:56
Go to Top of Page

martinoli

Switzerland
2 Posts

Posted - 06/27/2002 :  04:21:19 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
(To Yuri 2)

THANK YOU!!!

Go to Top of Page

martinoli

Switzerland
2 Posts

Posted - 06/27/2002 :  04:22:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
-

Edited by - MARTINOLI on 06/27/2002 04:26:35
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