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:
Thanks for any assistance.
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.