Error Messages/42613


Example error message

When forming a sequence from a textual «start» value to a textual «stop» value, «start» and «stop» 
must both be single characters (in which case an ascii sequence is formed) or both must contain only letters, 
in which case a "base-26" numeric sequence is formed similar to the sequence found in spreadsheet column names.  
The specified «start» of "A1" and «stop» of "Z9" does not fall into either of these cases.

Cause

This error occurs when an attempt is made to create a textual sequence, either by use of the the Sequence Operator m..n or by Sequence function, when the particular combination of «start» and «stop» is not allowed. For example, the above error occurs in these cases:

'A1'..'Z9'
Sequence('A1', 'Z9')

The Sequence function support two types of textual sequences (and only these):

  • Single-character ascii sequence.
In this sequence, both the start and the stop are single characters. The sequence spans the two characters according to standard ascii character order. Start and stop can be any character from Chr(1) through Chr(255). Examples:
'1'..'9' → ['1', '2', '3', '4', '5', '6', '7', '8', '9']
'T'..'f' → ['T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f']
Sequence('!', '@') → ['!', '""', '#', '$', '%', '&', , '(', ')', '*', '+', ', ', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@']
  • Spreadsheet column name sequence
These are letter sequences that go from 'A'..'Z', then from 'AA'..'AZ', 'BA'..'BZ', ... 'ZA'..'ZZ', then 'AAA'..'ZZZ', 'AAAA'..'ZZZZ', etc., up to six digits total.
'W'..'AF' → ['W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF']
For these sequences, the start and stop must consist entirely of letters, and all letters must be all upper case or all lower case.

Any other combinations of textual «start» or «stop» will cause this error, including zero-length text, multi-character text values with non-letters, etc.

Remedy

If you are trying to generate a multi-character text sequence of a different sort, then you can accomplish this with more sophisticated Analytica code. You need to decide what the rules are for your sequence, because in other combinations, many possibilities exist. Here is one example for how a 'A1'..'Z9 sequence might be generated (this is just one interpretation):

Index L := 'A'..'Z';
Index D := '1'..'9';
CopyIndex(ConcatRows(L&D, L, D))

For other types of multi-letter sequences, other logic can be developed.

See Also

Comments


You are not allowed to post comments.