× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am not able to get the %Elem function to work with the array 'Q' in the
following code.
I believe the problem is caused by 'Q' being in a 'doubly qualified' data
structure, but wanted to see if anyone else sees another/different error in
what I am doing before I give up.

>From compile listing:
(Line 588 is a 'test' line inserted to show that the syntax
'Qty4LY.Qty4Wk(1).Q(1)' is valid and that 'Q' is recognized as an array)
058800         N8D0 = Qty4LY.Qty4Wk(1).Q(1);
058900         Idx2 = %Elem(Qty4LY.Qty4Wk(1).Q);
======>                                  ab
*RNF0312 20 a      058900  A right parenthesis is expected but is not found.
*RNF5377 20 b      058900  The end of the expression is expected.

059300         For Idx2 = 1 to %Elem(Qty4LY.Qty4Wk(1).Q) by 1;
======>                                           ab
*RNF0312 20 a      059300  A right parenthesis is expected but is not found.
*RNF5429 30 b      059300  The syntax of the FOR statement is not valid.
059600            If Idx2 <= %Elem(Qty4LY.Qty4Wk(1).Q);                     
======>                                         ab                          
*RNF0312 20 a      059600  A right parenthesis is expected but is not found.
*RNF5377 20 b      059600  The end of the expression is expected.

Explanation/clarification:
Lines 590-592 were comments.
When I try this without the '(1)' I get an error telling me that I do not
have enough indexes specified. 
>From the errors I am getting I would guess that the %Elem function is
incorrectly evaluating its parameter as '(Qty4LY.Qty4Wk(1)'.
I know I can get around this by hard coding the # of elements, but I wanted
to make the code more easily maintainable.

Anyone see anything I am doing incorrectly that would cause these errors, or
is this another BIF that does not work with this kind of data structure?

TIA

Tim Kredlo
Exterior Wood, Inc.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.