.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 30th, 2001, 03:15 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Counting number of items in a string - desperately need help!

Originally posted by : Michele (mserafini@spotlighthealth.com)Hi - I am trying to loop through items in a table that are stored like this:Morbid Obesity,Multiple SclerosisMorbid Obesity,Multiple Sclerosis,Arthritis,Breast Cancer,Multiple Sclerosis,Morbid Obesity, Multiple Sclerosis, Heart Failureand I am trying to count the number of items in each record. For some reason everything I am trying is returning an incorrect record set. I am wondering first of all if it is because some records have a few items and end in a comma, where others have the same amount and don't end in a comma - so therefore basing the count on a comma retuns the wrong number of records? If anyone can help me I would appreciate it so much!

Reply With Quote
  #2  
Old July 31st, 2001, 07:31 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Originally posted by : Sarav (krs_sar@hotmail.com)Hi,First you check the last character is a comma. If you do not have a comma as the last character then, append a comma to it and store in a variable. Then loop through every character in that string and find out number of commas. Finally the number of items are 1 less than the count.regardsSarav.------------Michele at 7/30/2001 1:15:30 PMHi - I am trying to loop through items in a table that are stored like this:Morbid Obesity,Multiple SclerosisMorbid Obesity,Multiple Sclerosis,Arthritis,Breast Cancer,Multiple Sclerosis,Morbid Obesity, Multiple Sclerosis, Heart Failureand I am trying to count the number of items in each record. For some reason everything I am trying is returning an incorrect record set. I am wondering first of all if it is because some records have a few items and end in a comma, where others have the same amount and don't end in a comma - so therefore basing the count on a comma retuns the wrong number of records? If anyone can help me I would appreciate it so much!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > Counting number of items in a string - desperately need help!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT