I am trying to split a string into an array. I thought I had managed it with the following code:
Numbervar NoteLength := Len({Opportunity.oppo_downtimenotes});
Numbervar a;
Numbervar b;
Numbervar counter;
//Calculate the number of Date/Time records in Downtime Notes
For a := 1 To NoteLength Do
(
If Mid({Opportunity.oppo_downtimenotes},a,4) = "<BR>" Then counter := counter +1
);
Global Stringvar Array NoteArray[counter];
For b:=1 To counter Do
(
NoteArray[counter]:=Split({Opportunity.oppo_downtimenotes},"<BR>")[counter]
);
The field {Opportunity.oppo_downtimenotes} contains the string
Incomplete:03/08/2010 16:25:00<BR>Corrected:03/08/2010 16:25:00<BR>Incomplete:03/08/2010 16:27:00<BR>Corrected:03/08/2010 16:30:00<BR>
When I run the report I get the error message "A Subscript must be between 1 and the size of the array".
This is probably an easy fix but I don't know where I'm going wrong.
Many thanks for any help.
Stuart.
Numbervar NoteLength := Len({Opportunity.oppo_downtimenotes});
Numbervar a;
Numbervar b;
Numbervar counter;
//Calculate the number of Date/Time records in Downtime Notes
For a := 1 To NoteLength Do
(
If Mid({Opportunity.oppo_downtimenotes},a,4) = "<BR>" Then counter := counter +1
);
Global Stringvar Array NoteArray[counter];
For b:=1 To counter Do
(
NoteArray[counter]:=Split({Opportunity.oppo_downtimenotes},"<BR>")[counter]
);
The field {Opportunity.oppo_downtimenotes} contains the string
Incomplete:03/08/2010 16:25:00<BR>Corrected:03/08/2010 16:25:00<BR>Incomplete:03/08/2010 16:27:00<BR>Corrected:03/08/2010 16:30:00<BR>
When I run the report I get the error message "A Subscript must be between 1 and the size of the array".
This is probably an easy fix but I don't know where I'm going wrong.
Many thanks for any help.
Stuart.