cancel
Showing results for 
Search instead for 
Did you mean: 

getting array error suddenly, why?

Former Member
0 Kudos

I just got this error message in a report that has been working. Any ideas please what this means..

" An Array's dimension must be between 1 and 1000"

shared stringvar array a;

local stringvar t := {CLSPAYTP.OTORD#};

shared numbervar c:=c;

shared stringvar ords:=ords;

//if instr(ords,{CLSPAYTP.OTORD#})<=0 then

    ords:=ords & ',' & {CLSPAYTP.OTORD#};

if not(t in a)

then ( 

        c:= c + 1;

//*** on next line we get the error *****

        redim preserve a[c];

        a[c] := t;

);

if c > 0 then a[c]

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Paul,

Use a delimited string as a workaround:

shared stringvar a;

local stringvar t := {CLSPAYTP.OTORD#};

shared stringvar ords:=ords;

if instr(a, t) = 0 then

(

a := a +  {CLSPAYTP.OTORD#} + '. ';

);

-Abhilash

Answers (1)

Answers (1)

DellSC
Active Contributor
0 Kudos

Crystal limits arrays to 1000 elements, so this will happen when you try to add more than 1000 elements to an array.

-Dell