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
 Column width change when using wks.insert()
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Gandi

USA
Posts

Posted - 03/08/2012 :  12:02:22 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I am using wks.insert() to insert a column before a certain column that is specified by wks.col = ii. However, the new column takes the width of column ii, while column ii is set to a standard width of 7.

Is there a way to insert a column and make sure the columns to the right keep their original width?

Thanks!

Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.5.1 SR2
Operating System: Win 7 (64 bit)

Drbobshepherd

USA
Posts

Posted - 03/09/2012 :  10:01:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Before executing the insertion, try this:

wks.col=ii; // Select column.
%A=wks.col.width; // Read column width.

Then execute your insertion, followed by:

wks.col=(ii+1); // Select next column, which is actually original.
wks.col.width=%A; // Set column to original width.

DrBobShepherd
Go to Top of Page

Gandi

USA
Posts

Posted - 03/20/2012 :  11:31:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for your reply, DrBobShepherd.

Upon closer inspection, what happens is that that each column after the inserted one takes the width of it its right neighbour, with the last one being assigned the default width. Hence one would have to loop over all these columns to assign their correct width. While this is probably doable, I'm finding it hard to believe that there's no simpler way of solving this problem. Any suggestions?

Thanks!
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