Solved

indexing an array in Crystal Syntax

Posted on 2006-07-06
9
472 Views
Last Modified: 2011-10-03
I would like to know the syntax on indexing an array in Crystal Syntax.  I am in the formula workshop, and am dealing with a database field that contains multiple values separated by semicolons.  Thanks
0
Comment
Question by:cpursley1979
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 16

Expert Comment

by:wykabryan
ID: 17050343
What version of CR are you using?  When you say, "database field that contains multiple values separated by semicolons", are these contained within one column?
0
 

Author Comment

by:cpursley1979
ID: 17050357
I am using Crystal designer 11.  Yes this is 1 column I am referencing.
0
 
LVL 16

Expert Comment

by:wykabryan
ID: 17050370
Ok.. you want to do something like this then.

{yourcolumn} in Split({column},',')
0
Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

 

Author Comment

by:cpursley1979
ID: 17050538
Yes, I was thinking this:
//StringVar array months = split(sValues, ";");
//months[12];

but I know it is incorrect
0
 
LVL 16

Expert Comment

by:wykabryan
ID: 17050729
well, this appears to work after some rework

split(sValues,';')[12]
0
 

Author Comment

by:cpursley1979
ID: 17053386
How does this work?
0
 
LVL 16

Expert Comment

by:wykabryan
ID: 17053497
split will parse out the column.  The [12] indicated which object in the array you want to use.
0
 

Author Comment

by:cpursley1979
ID: 17053506
does split return a String type or numeric?
0
 
LVL 16

Accepted Solution

by:
wykabryan earned 500 total points
ID: 17053538
split return a string.  The number only indicated the subscript that should be return to the report.  
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question