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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array Assistance

Status
Not open for further replies.

shelby55

Technical User
Jun 27, 2003
1,229
CA
Hi

I'm using Crytal 8.5 accessing an SQL database.

I have never created an array in Crystal before and I did read the examples here but couldn't find one that matched or worked.

In the database I'm using, there are 20 potential procedure codes and each one has a matching intervention room. So an abstract could have anywhere from 0 to 20 procedures. What I want to do is loop through the procedures and based on the procedure criteria, display the intervention room (text field).

What I have so far produces the error message "a subscript must be between 1 and the size of the array" but if I set it to 20 then it doesn't like it if there are less than 20 or zero. The code thus far:
Code:
numbervar i;
shared stringvar array pxcode;
shared stringvar array room;
shared stringvar delroom;

for i:=1 to ubound(pxcode) do
(if not isnull({Procedures.Proc Code}) and pxcode[i] startswith "5.MD.6" then delroom=room[i]);

delroom;

Thanks for any assistance.
 
Can you show some sample data? Are you trying to loop through multiple records to find the matching room or are you trying to loop within each record?

-LB
 
I might be wrong but I dont think Crystal 8.5 supports Shared arrays, I vaguely recall that was only added in Cr9

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top