Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extract values in an array at a stretch-Suggestion plz!!

Status
Not open for further replies.

varavoorvishnu

Programmer
Sep 9, 2002
45
0
0
Hi All,
Is it possible to loop an array value..
For instance i have an array declared "a" which holds the values of string from
"Monday" to "Sunday" stored in the array..
Incase i need to print all the values from the array at a time,what should i do??
I dont want to give hard corded way like a[1],a[2]..and so on.
Please suggest me..

Vishnu





 
Have you tried this:

whileprintingrecords;
global stringvar array weekdaynames;
join(weekdaynames,",") Christine
Crystal Training and Consulting
crosenbaum@Strafford.com
 
Vishnu,

Why've you started a new thread which says exactly what an existing thread posted by you says? If you can possibly avoid doing this, please do - as it's confusing for people to keep track of issues. Because alley211 hasn't seen the information turned up in your previous posts in the other thread, she has given you a solution that will only work with version 8 and above, not knowing that you're working with version 7.

How do you want this array split and displayed? When you say the array holds 'values of string from
"Monday" to "Sunday"', do you mean that the array is made up of literal strings of the days of the week, or of perhaps numerical values attributed to each day?

If you're refering to literal day of the week strings, then you can use nested Ifs. Loops (both kinds), splits, joins, and ubounds are unavailable to you in version 7.

WhilePrintingRecords;
StringVar Display;
StringVar Array YourArrayHere;

If "Monday" in YourArrayHere
Then Display := "Monday";
If "Tuesday" in YourArrayHere
Then Display := Display + ", Tuesday";
If "Wednesday" in YourArrayHere
Then Display := Display + ", Wednesday";
...etcetera etcetera etcetera...
If "Sunday" in YourArrayHere
Then Display := Display + ", Sunday";
Display;

I haven't tested that with your situation, so you'll be guinea pigging it, I'm afraid.

Naith
 
Dear Naith..For ur kind information,I knew the method if it is a from "Monday" till "Sunday"..But it is not fixed.I just gave a sample and asked for the solution.I have 1 lakh records which cannot be hardcoded as u say.
Regarding creating new thread,
I would like to justify that sometimes the session of the web page expires immediately when i click any hyperlink.
Moreover the webpage was giving an error message that the
"Handle" already exists.So inorder to prevent it ,i went to a thread whose requirement was much similar to me and so i posted it there thinking that i would get some response out of it.That was the core idea behind it.



Dear Christine,
JOIN is not supported in Crystal Reports 7.0 and that is where i faced the problem.Plz give me some other solution.
Thanx in advance,
Vishnu

Vishnu
 
Dear Naith..>:-<
For ur kind information,I knew the method if it is a from &quot;Monday&quot; till &quot;Sunday&quot;..But it is not fixed.I just gave a sample and asked for the solution.I have 1 lakh records which cannot be hardcoded as u say.
Regarding creating new thread,
I would like to justify that sometimes the session of the web page expires immediately when i click any hyperlink.
Moreover the webpage was giving an error message that the
&quot;Handle&quot; already exists.So inorder to prevent it ,i went to a thread whose requirement was much similar to me and so i posted it there thinking that i would get some response out of it.That was the core idea behind it.



Dear Christine,%-)
JOIN is not supported in Crystal Reports 7.0 and that is where i faced the problem.Plz give me some other solution.
Thanx in advance,
Vishnu

Vishnu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top