T O P I C R E V I E W |
AlexD2 |
Posted - 01/10/2014 : 2:18:11 PM Origin Ver. and Service Release: 9.1.0 Sr1 Operating System: Windows7 32 bit
I don't understand the behavior of the %() substitution:
With Book2 and Sheet1 active: >>range rDa1 = %([Book2]Sheet1,1); type %(rDa1) [Book2]Sheet1!Book2_A // OK
With Sheet3 active: >>range rDa1 = %([Book2]Sheet1,1); type %(rDa1) [Book2]Sheet3!Book2_A // ???
Shouldn't the result be independent of which Book/Sheet is active?
Similarly: With Sheet3 active: >>range rDa1 = %([Book2]Sheet3,1); type %(rDa1) [Book2]Sheet3!Book2_A@2 // OK (I only have two sheets: Sheet1 and Sheet3)
With Sheet1 active: >>range rDa1 = %([Book2]Sheet3,1); type %(rDa1) [Book2]Sheet1!Book2_A@2 // Not good
What is also surprising is that the dataset name is correct in every case: I obtain Book2_A or Book2_A@2 as it should be; however the SheetName (Sheet1 or Sheet3) is inconsistent and depends on which worksheet is active.
Is this a normal behavior?
Thanks for your help!
AlexD2 |
1 L A T E S T R E P L I E S (Newest First) |
AlexD2 |
Posted - 01/12/2014 : 04:49:01 AM I answer my own question!
The %() substitution returns only the name of the dataset so in the second example, %([Book2]Sheet1,1) only returns Book2_A. But in absence of a proper absolute range expression, the range declaration (range rDa1 = ...) appends the range of the active sheet (i.e. [Book2]Sheet3) in front of the right hand-side expression!
So the results are indeed logical.
|
|
|