Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Array Ubound Post Reply Post New Topic
Author Message
Schugs
Newbie
Newbie


Joined: 08 Aug 2012
Online Status: Offline
Posts: 36
Quote Schugs Replybullet Topic: Array Ubound
    Posted: 21 Aug 2012 at 10:25am
I can not for the life of me figure out why this wont work?

global numbervar array CaseIDDblChk;
if {Applicant1.ApplicantCaseId} in CaseIDDblChk then
True
else
numberVar x =toNumber(count(CaseIDDblChk)) + 1;
Redim preserve CaseIDDblChk[x];
CaseIDDblChk[x]:={Applicant1.ApplicantCaseId};
False;

debugging info:
it sees:
var: CaseIDDblChk: [0,0]
var x: 0

im getting an error when it is trying to redim the array because x is reading as 0?

IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet Posted: 22 Aug 2012 at 2:46am
see how this goes?
 
global numbervar array CaseIDDblChk;
if {Applicant1.ApplicantCaseId} in CaseIDDblChk then
True
else
(numberVar x:=toNumber(count(CaseIDDblChk)) + 1;
Redim preserve CaseIDDblChk[x];
CaseIDDblChk[x]:={Applicant1.ApplicantCaseId};
False;
)
 
Think you were just missing the :=
numberVar x =toNumber
IP IP Logged
Schugs
Newbie
Newbie


Joined: 08 Aug 2012
Online Status: Offline
Posts: 36
Quote Schugs Replybullet Posted: 22 Aug 2012 at 2:51am
Thanks for the reply. I have tried that and when that is set the error becomes "A boolean is requrired here"

To that note, what exactly is the difference between = and := I have also tried using Ubound() and that is also failing.

local numberVar x=UBound(CaseIDDblChk) + 1;
Redim preserve CaseIDDblChk[x];
CaseIDDblChk[x]:={Applicant1.ApplicantCaseId};
False;
IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet Posted: 22 Aug 2012 at 3:00am
You also need to add brackets around the statements after the else.
see what i pased previously.
= is when you are checking if it is equal, eg 1=1,
:= is to set a value.
IP IP Logged
Schugs
Newbie
Newbie


Joined: 08 Aug 2012
Online Status: Offline
Posts: 36
Quote Schugs Replybullet Posted: 22 Aug 2012 at 3:10am
THANK YOU!!!

Sorry i over looked the (). To be honest i really thought i tried that, it must have been the () and the := not tried at same time. Thanks for fast responses and the clarification on the = vs. :=

Love this forum, hopefully soon ill be able to help answer questions ha.
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.