Skip to Content
avatar image
Former Member

getting array error suddenly, why?

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]

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 02, 2015 at 02:19 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 01, 2015 at 09:52 PM

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

    -Dell

    Add comment
    10|10000 characters needed characters exceeded