Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Split function ?? Post Reply Post New Topic
Author Message
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Topic: Split function ??
     Posted: 20 May 2011 at 4:31am

Hi,

 
I have an array "1000,2000,3000...)
 
Do i use split?
But the length of the array can vary, how can I split all elements?
 
Thanks In advance
 Joe
 
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 20 May 2011 at 4:44am
Do you have an "array" or do you have a string separated by commas?

Split is a string function.
It will split on all instances of the specified delimiter.

If for example your string was

"1,2,3,4" and you split on "," then you will get ["1", "2", "3", "4"]

If your string was "1,2" and you split on the comma again, you will get ["1", "2"]

etc
IP IP Logged
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Posted: 20 May 2011 at 4:59am
It is a string seperated by commas
 
but they vary in length,
Actually now thinking...
what I really want to do is base a formula on what the string contains....
example
string = "1000,2000,4000"
then in a formula,
 
if "the string" contains "1000" or "4000" then ......
 
Thanks
 
 
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 20 May 2011 at 7:29am
but they vary in length,


You can use InStr to determine whether the string contains the specified substring or not.

ie:

If InStr(string, "1000") or InStr(string, "4000") Then ...
IP IP Logged
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Posted: 20 May 2011 at 10:23am
great.. thanks will try..
can I use "and" also instead of or?
 
 
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