michaelk Posted January 3, 2012 Share Posted January 3, 2012 Thanks, everyone, for your patience. I'd like to test your good graces a little further: I'm working on a script where I need to get the leader and/or trailer on a number in a worksheet cell. I can write a leader or trailer to a cell, but I can't read it. Does this have something to do with the leaders and trailers being truncated at 7 characters? Is the variable not really a string, but an array of characters? I'll attach an example file. Select the cell and run the script. I'll include the script for those not running 2012. I haven't tried previous versions- but in 2012, when a cell is formatted to have a leader and/or trailer the script does not picked up the string. Unless I'm doing some truly boneheaded.... Thanks MK Procedure GetLeaderTrailer; {Badly scripted by Michael Klaers} VAR WSHand : Handle; {Handle to Worksheet} topRow,leftColumn,bottomRow,rightColumn,fontIndex,fontSize,fontStyle :INTEGER; currentCellRow,currentCellColumn,topRangeRow,leftRangeColumn,topRangeSubrow,bottomRangeRow,rightRangeColumn,bottomRangeSubrow :INTEGER; numStyle,numAccuracy : INTEGER; currentLeaderString,currentTrailerString : STRING; BEGIN {Main} WSHand:=GetTopVisibleWS; {Get WORKSHEET cell range} GetWSSelection(WSHand,currentCellRow,currentCellColumn,topRangeRow,leftRangeColumn,topRangeSubrow,bottomRangeRow,rightRangeColumn,bottomRangeSubrow); GetWSCellNumberFormat(WSHand,currentCellRow,currentCellColumn,numStyle,numAccuracy,currentLeaderString,currentTrailerString); Message( '||handle: ',WSHand, ' ||CurrentCellRow: ',currentCellRow, ' ||CurrentCellColumn: ',currentCellColumn, ' ||NumStyle: ',numStyle, ' ||NumAccuracy: ',numAccuracy, ' ||CurrentLeaderString: ',currentLeaderString, ' ||CurrentTrailerString: ',currentTrailerString); END; {Main} RUN(GetLeaderTrailer); Quote Link to comment
Vectorworks, Inc Employee klinzey Posted January 3, 2012 Vectorworks, Inc Employee Share Posted January 3, 2012 I think there is something wrong with the GetWSCellNumberFormat call. I'm not seeing it return the values for the Leader and the Trailer. I'll enter it as a bug and get someone to take a look at it. Quote Link to comment
michaelk Posted January 3, 2012 Author Share Posted January 3, 2012 Thanks, Kevin. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.