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
 Inserting 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

LucSerre

Posts

Posted - 02/01/2005 :  12:47:04 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 6.1
Operating System:win2k

I have wks with about 60 Y cols. (ex: X y1 y2 y3 y4...y60)
I'm trying (unsuccesfully) to add a blank column between all the y's.
Ex: X y1 y1b y2 y2b y3 y3b...y60 y60b

Is there a command don't know about that I can use?
Is there a simple way of doing this?

Thanks,
Luc S

Mike Buess

USA
3037 Posts

Posted - 02/01/2005 :  1:16:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Luc,

Starting with columns X Y1 Y2 the command "wo -i 2 Y1b" will create X Y1 Y1b Y2. If you're doing this in a loop keep in mind that inserting a column changes the numbering of all columns to the right. That will affect how you should structure the loop.

...In your case the following script should work.

for(ii=wks.ncols;ii>1;ii--) {
wo -i ii Y$(ii-1)b;
};

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 02/01/2005 1:24:59 PM
Go to Top of Page

LucSerre

Posts

Posted - 02/01/2005 :  1:35:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike!
Great help!

That is the boost I needed to keep going with this project!
Thanks again!

-Luc S
Go to Top of Page

LucSerre

Posts

Posted - 02/01/2005 :  2:03:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok, now I'm trying to do it a little diffrently and i'm getting confuzed.

Instead of renaming them to Yb1 format, I'm trying to rename the col to the string of the value of the cell right below the col title
For example, I'm trying to rename col 4 to cell(1,4).

for(ii=wks.ncols;ii>1;ii--)
{
work -n $(ii) P$(cell(1,ii));
};

This works, except that it doesn't keep the sign of the cell.
Ex, if cell(1,4)= -9.2, then it only make the title P9.2 and not P-9.2
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/01/2005 :  2:46:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The minus sign (along with most other special characters) is not allowed in a column name. Double-click on a column and try to name it P-9.2 yourself. Won't work.

Mike Buess
Origin WebRing Member
Go to Top of Page

LucSerre

Posts

Posted - 02/01/2005 :  2:49:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
WHen I use this code, right after the code that I just pasted my last message, it works.

for(ii=wks.ncols;ii>1;ii--)
{
wo -i $(ii) mes$(cell(1,ii));
};

This actualy puts the - in the col name.
I don't know how that happened.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/01/2005 :  2:55:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sounds like a bug and I would certainly avoid doing that. It will likely bite you when you need to use the column name in a LabTalk command.

Mike Buess
Origin WebRing Member
Go to Top of Page

LucSerre

Posts

Posted - 02/01/2005 :  3:12:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok then, Thanks very much for the help.
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