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 for Programming
 LabTalk Forum
 Column width change when using wks.insert()

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
Gandi Posted - 03/08/2012 : 12:02:22 PM
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)
2   L A T E S T    R E P L I E S    (Newest First)
Gandi Posted - 03/20/2012 : 11:31:56 PM
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!
Drbobshepherd Posted - 03/09/2012 : 10:01:24 AM
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

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