ADC Home > Reference Library > Technical Q&As > Legacy Documents > Apple Applications >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Storing an Array Name in a Field in Another Array


The Apple Media Tool and Apple Media Tool Programming Environment products have been discontinued. For more information check out: AMT/PE Discontinued.

Q: I am having a problem accessing items from arrays with other arrays. I get a runtime error:

File 'SERVER DRIVE:PROJECTS:TEST:LBB PROJECT
WITH AMTCX:SOURCES:ALPHADB.K'; Line 89 # K call: MESSAGE has no _COUNT!

I use the following code to extract the name of a particular array and make CurrentAlphaIndex refer to that particular array:

self.CorrectAlphaArray := self.AlphaArray;
self.CurrentAlphaIndex := (self.CorrectAlphaArray @ self.CurrentRec @ 3);

This is the line it stops working on:

while (loopIndex <= #(self.CurrentAlphaIndex @ LineNum @ 2)) loop

What gives?

A: Because of the way the parser works (it works from right to left, instead of left to right), when you have several @ characters in the same statement, you have to use parentheses to specify how the expression should be parsed.

In other words, the parser is reading:

self.CurrentAlphaIndex @ LineNum @ 2

as:

self.CurrentAlphaIndex := (self.CorrectAlphaArray @ (self.CurrentRec @ 3));

However, what you mean is:

self.CurrentAlphaIndex := ((self.CorrectAlphaArray @ self.CurrentRec) @ 3);

This is also true for the other line:

while (loopIndex <= #(self.CurrentAlphaIndex @ LineNum @ 2)) loop

The solution is to use parentheses to specify what you want.

[Aug 01 1995]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.