Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Split String Array Post Reply Post New Topic
Author Message
CUser
Newbie
Newbie
Avatar

Joined: 14 Apr 2010
Location: United States
Online Status: Offline
Posts: 8
Quote CUser Replybullet Topic: Split String Array
     Posted: 19 Apr 2010 at 7:41am

I have string Array of size 3, when I try to Split using below code I get 'A subscript must be between 1 and the size of the array'

WhilePrintingRecords;
shared stringvar Array labelquest;
Split(labelquest,",")[1]
 
Can someone shed a light..
 
Thanks in advance.


Edited by CUser - 19 Apr 2010 at 7:42am
CUser
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 19 Apr 2010 at 7:50am
Are you trying to split the first entry in the array? if so, I believe this is the correct syntax.  Split(labelquest[1], ",")
IP IP Logged
CUser
Newbie
Newbie
Avatar

Joined: 14 Apr 2010
Location: United States
Online Status: Offline
Posts: 8
Quote CUser Replybullet Posted: 19 Apr 2010 at 9:11am

No I want all three values and not just one. I would like to display in my main report all three labels which are joined by ',' in the supbreport. When I try to split the string array I get the subscript error.

 
Thanks for your quick response.
 


Edited by CUser - 19 Apr 2010 at 9:18am
CUser
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 19 Apr 2010 at 9:42am
The syntax is wrong the way you are trying to index the array.  I do not believe Split will work for you.  From what it appears you are telling me labelquest[1] is the first label, labelquest[2] is the second label and labelquest[3] is the third label.
 
Is this correct? If so, there would be no reason to split anything.  I am not sure how the labels are joined by ','.
 
 
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