Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: a subscript must be between 1 and ...... problem Post Reply Post New Topic
Author Message
mahesht6786
Newbie
Newbie
Avatar

Joined: 10 Feb 2012
Location: India
Online Status: Offline
Posts: 1
Quote mahesht6786 Replybullet Topic: a subscript must be between 1 and ...... problem
    Posted: 14 Feb 2012 at 11:28pm
if ({SS.LOC_NAME}="ABC")
then
(
numbervar i:=0;
numberVar one=1;
numbervar c:=0;
shared numbervar averagec:=0;
numbervar Array a;
redim a[12];
numbervar Array b;

redim b[12];
a[1]:=tonumber({SS.H1});a[2]:=tonumber({SS.H2});a[3]:=tonumber({SS.H3});a[4]:=tonumber({SS.H4});a[5]:=tonumber({SS.H5});a[6]:=tonumber({SS.H6});
a[7]:=tonumber({SS.H7});a[8]:=tonumber({SS.H8});a[9]:=tonumber({SS.H9});a[10]:=tonumber({SS.H10});a[11]:=tonumber({SS.H11});a[12]:=tonumber({SS.H12});
 
b[1]:=tonumber({SS.C1});b[2]:=tonumber({SS.C2});b[3]:=tonumber({SS.C3});b[4]:=tonumber({SS.C4});b[5]:=tonumber({SS.C5});b[6]:=tonumber({SS.C6});
b[7]:=tonumber({SS.C7});b[8]:=tonumber({SS.C8});b[9]:=tonumber({SS.C9});b[10]:=tonumber({SS.C10});b[11]:=tonumber({SS.C11});b[12]:=tonumber({SS.C12});
while i<12
do
(
if(a>a[i+1])
  then

  c:=c+1;
    if(a[i+1]<a[i+2])
    then
    (
     averagec:=(b + b[i+1])/c ;

    )
   else
   ( //i:=i+1;
     
     i:=i+1;
    )
)
else
i:=i+1;    

);
)
else
false

here i am getting error like this
"a subscript must be between 1 and the size of the array"

i am new to crystal reports above i mentioned the coding
database fields are char datatype
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.