Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declaring an Array

Status
Not open for further replies.

csr

Programmer
Jul 20, 2000
507
I have a report which makes use of an array called ...
aLabels.

The first place I mention this array is in a CONTINUE button on a form which leads to that report.

This is the code in the CLICK method of that CONTINUE button.

dimension aLabels[20,5]
for j = 1 to 20
for k = 1 to 5
aLabels[j,k] = ''
endfor
endfor


Everything works just fine. However, each time I generate the EXE I get the warning: UNABLE TO FIND UNKNOWN aLabels .... at which time I simply IGNORE and everything is fine.

I know I should declare this array as EXTERNAL somewhere.

Where should I do that and what would be the SYNTAX for this ?

Thanks.


Don


 
You would declare the EXTERNAL in the same function that contains the REPORT FORM statement that uses the array. But I have a similar situation, and I just declare the array as PRIVATE and ignore the error.

Mike Krausnick
Dublin, California
 
> Declaring the array as private and ignore the error.

Well, that is basically what I have done.

I call the report in this same code ...


dimension aLabels[20,5]
for j = 1 to 20
for k = 1 to 5
aLabels[j,k] = ''
endfor
endfor


* some processing and then ...

report form xxxx to print prompt noconsole

================================================

So, you are saying that I should include my EXTERNAL statement at the top of this code ?



Don


 
Don,
In the report's data environment, try adding the EXTERNAL ARRY statement to say the Init() method.

Rick
 
Thanks to all who contributed ...

The solution was to replace the DIMENSION keyword with PUBLIC ARRAY as in ...

public array aLabels[20,5] and the problem was solved.

Simple.



Don


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top