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
 Forum for Origin C
 How to add column to the front of worksheet?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ashvilki

USA
10 Posts

Posted - 08/24/2003 :  7:50:46 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi, guys!
Does anybody know how to insert a column in front of the worksheet (and make it X) rather than add to the end?
Thanks a lot,

Alexei

Mike Buess

USA
3037 Posts

Posted - 08/24/2003 :  8:54:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Alexei,

worksheet -i 0; // insert col at beginning of wks
worksheet -t 1 4; // set the type of the first column (4=X col, look at LabTalk help for others)

...Since this is the Origin C forum you might prefer the following.

void test()
{
string colNameCreated;
Worksheet wks = Project.ActiveLayer();
if( wks.InsertCol(0,"",colNameCreated) )
{
wks.Columns(0).SetType(OKDATAOBJ_DESIGNATION_X);
printf("New column is %s\n",colNameCreated);
}
else
printf("Could not create new column.\n");
}

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 08/25/2003 2:07:49 PM
Go to Top of Page

ashvilki

USA
10 Posts

Posted - 08/25/2003 :  9:32:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, Mike!
Both methods worked.
Alexei
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