If you have a tag Tag1 defined as an array
of 4 elements. For example, when using the GENERIC protocol the tag
has an address I1[4]:
Tag1 = I1[4]
->
I1
I2
I3
I4
Tag1 represents the registers I1, I2, I3 and I4.
When Tag1 is used with the Ass() Cicode function it
behaves as follows:
If you associate a value using
Ass(hWin, "X", "Tag1", 0) then the substitution string ?X?[0] gives
the value in I1.
If you associate a value using
Ass(hWin, "X", "Tag1", 0) then the substitution string ?X?[2] gives
the value in I3.
If you associate a value using
Ass(hWin, "X", "Tag1[0]", 0) then the substitution string ?X?[2]
gives the value in I3.
If you associate a value using
Ass(hWin, "X", "Tag1[1]", 0) then the substitution string ?X?[2]
gives the value in I4. This is because the two offsets are added
together to determine the final offset within the array
variable.
If you associate a value using
Ass(hWin, "X", "Tag1[2]", 0) then the substitution string ?X?[2]
gives the error #ERR. This is because the sum of the two array
offsets gives a position (Tag1[4]) that is outside the bounds of
the array.
Using array offsets with a tag that
is not an array
If you have a tag Tag2 defined as a single
value. For example, when using the GENERIC protocol the tag has an
address I1:
Tag2 = I1 ->
I1
When Tag2 is used with the Ass() Cicode function it
behaves as follows:
If you associate a value using
Ass(hWin, "X", "Tag2", 0) then the substitution string ?X?[0] gives
the value in I1. This is because a non-array tag is equivalent to
an array with one element.
If you associate a value using
Ass(hWin, "X", "Tag2[0]", 0) then the substitution string ?X?[0]
gives the value in I1. This is because a non-array tag is
equivalent to an array with one element.
If you associate a value using
Ass(hWin, "X", "Tag2", 0) then the substitution string ?X?[2] gives
the error #ERR. This is because a non-zero offset cannot be applied
to a non-array tag.
If you associate a value using
Ass(hWin, "X", "Tag2[0]", 0) then the substitution string ?X?[2]
gives the error #ERR. This is because a non-zero offset cannot be
applied to a non-array tag.
If you associate a value using
Ass(hWin, "X", "Tag2[1]", 0) then the substitution string ?X?[2]
gives the error #ERR. This is because a non-zero offset cannot be
applied to a non-array tag.
If you associate a value using
Ass(hWin, "X", "Tag2[2]", 0) then the substitution string ?X?[2]
gives the error #ERR. This is because a non-zero offset cannot be
applied to a non-array tag.