Page 1 of 1

Table Selection

Posted: 2009-03-20 07:40:29
by phspaelti
The macro reference says the following:
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: Select all

$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: Select all

$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?

Re: Table Selection

Posted: 2009-03-20 13:03:49
by martin
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: Select all

$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?

Re: Table Selection

Posted: 2009-03-21 03:32:16
by Kino
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: Select all

TableSelection.new tableObject[, rowRangeObject[, columnRangeObject]]

Re: Table Selection

Posted: 2009-03-25 07:54:40
by phspaelti
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:
If ranges are not provided then…