Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Need help making an Array loop. Post Reply Post New Topic
Author Message
xoleigh
Newbie
Newbie


Joined: 19 May 2010
Online Status: Offline
Posts: 5
Quote xoleigh Replybullet Topic: Need help making an Array loop.
     Posted: 06 Sep 2010 at 12:38am
Hi All

I'm in desperate need of help.
I have two fields, Insurer and InsurerRef. Both these fields contain concatenated values e.g. you may get 5 insurers separated by a semi colon in one row. You then get their respective References in another filed.
I need to first split these insurers and an then combine them with their respective references. The followign is what I had in the beginning. It works fine only the problem is that it is static and will produce incorrect results should the array have more values.

whileprintingrecords;
stringVar Array Insurer:=split({CR_ClaimRegister_MarLiab;1.Insurer},';');
stringVar Array InsurerRef:=split({CR_ClaimRegister_MarLiab;1.Ins_Ref},';');
if len('Insurer') = 1 and len('InsurerRef') =1 then Insurer[1] & '' & '(' & InsurerRef[1] & ')'
else
if len('Insurer') >= 1 and len('InsurerRef') >=1 then Insurer[1] & '' & '(' & InsurerRef[1] & ')' & chr(10)
& Insurer[2] & '' & '(' & InsurerRef[2] & ')'
else '';

Any suggestions will be highly appreciated.

IP IP Logged
Crystal Bee
Newbie
Newbie
Avatar

Joined: 09 Aug 2010
Online Status: Offline
Posts: 17
Quote Crystal Bee Replybullet Posted: 07 Sep 2010 at 12:06am
heyy y dont u use 'for loop' den???
get size of dat arrey and run 'for loop'...
it will avoid system overhead wen you have array with many values...
wot say??


Edited by Crystal Bee - 07 Sep 2010 at 12:09am
IP IP Logged
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