Reply to topic  [ 4 posts ] 
Table Selection 
Author Message
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
The macro reference says the following:

Quote:
TableSelection.new tableObject, [rowRangeObject], [columnRangeObject] v1.1
Returns a new selection describing a cell region within the given table. Both Range objects must be in-bounds for the table or an error will be displayed. If either range is not provided then the selection will encompass all rows/columns.[emphasis mine]


When I try something like this
Code:
$myTableSel = TableSelection.new $myTable, $rowRange

it works as expected and I get full rows selected. But any attempt to not provide the row range fails. For example the following just returns an error:
Code:
$myTableSel = TableSelection.new $myTable, , $columnRange

So my question is: is it possible to provide only a column range with some syntax I don't know about? Or is the manual in error? Or is this a bug?

_________________
philip


2009-03-20 07:40:29
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
The core issue is that the macro language's support for missing arguments is limited. One can only omit arguments from the tail of the of list, not in the middle as you've attempted.

As to the wording in the macro language, it merely refers to the first two of the following valid usages:
Code:
$myTableSel = TableSelection.new $myTable
$myTableSel = TableSelection.new $myTable, $rowRange
$myTableSel = TableSelection.new $myTable, $rowRange, $colRange


It would be more clear but less succinct to say, "if the row range, or both the row and column range, is not provided then..." Do you think the verbosity is needed to make the behavior clear?


2009-03-20 13:03:49
Profile WWW

Joined: 2008-05-17 04:02:32
Posts: 400
martin wrote:
One can only omit arguments from the tail of the of list, not in the middle as you've attempted.
In that case, I think something like this would be clearer (to me at least: I seldom read the description ;-)
Code:
TableSelection.new tableObject[, rowRangeObject[, columnRangeObject]]


2009-03-21 03:32:16
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
Thanks Martin, Kino, for the comments. I deduced that this was the behavior, but now I have peace of mind as well!

As far as the description goes, since it is a technical reference I think precision trumps verbosity, but if you're worried about verbosity you could drop the either making it:
Quote:
If ranges are not provided then…

_________________
philip


2009-03-25 07:54:40
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software