473,383 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Comparison help...suggestions

I have results from a database for the ROOMS field that look something
like this:
Dining,Master,FormalDining

I need some comparison help BUT without creating an array. I really need
someone like:
if rs("rooms") LIKE "dining" then DINING="YES" end if

I know you can't use the LIKE command this way.

If this is not possible without an array, then how do I do this in an
array? My current code would be:
roomarray=rs("ROOMS")
roomsplit=split(roomarray,",")
For i = 1 to UBound(allsplit)
**What would go here for the comparison?
Next


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
2 1157

Ok. So I have decided to use the SPLIT method.
Here is what I have for testing:

energyarray="heat,ac,gas"
energysplit=split(energyarray,",")
For iLoop=0 to UBound(energysplit)-1
Response.write "<li>" & energysplit(iLoop) & "</li>"
Next
GAS is not being displayed. I assume because there is no comma after it.
So, how do I fix this so all of them are displayed?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #2
Joey Martin wrote on 20 dec 2003 in
microsoft.public.inetserver.asp.general:
Ok. So I have decided to use the SPLIT method.
Here is what I have for testing:

energyarray="heat,ac,gas"
energysplit=split(energyarray,",")
For iLoop=0 to UBound(energysplit)-1
Response.write "<li>" & energysplit(iLoop) & "</li>"
Next
GAS is not being displayed. I assume because there is no comma after
it. So, how do I fix this so all of them are displayed?


Ubound gives the top index, not the arraylength like in Javascript.

Your string is a comma delimited list, the split makes an array:

============================
'' Set Response = document '' for clientside IE test use

energylist="heat,ac,gas"
energyarray=split(energylist,",")

Response.write "UBound(energyarray) = " & UBound(energyarray)
Response.write "<ol>"
For iLoop=0 to UBound(energyarray)
Response.write "<li>" & energyarray(iLoop) ''' & "</li>"
Next
Response.write "</ol>"

=============================

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bill W. | last post by:
I'm teaching myself VB6. As a first project, I've decided to work on a Window's version of the Unix command, "diff" -- with a few twists. But being unfamiliar with VB, I am unsure as to how to...
2
by: Dave | last post by:
Hello all, I would like to solicit suggestions on how to most efficiently accomplish something. I have profiled the project I'm working on and have found that calls to fabs() are taking a very...
0
by: Tim Brooks | last post by:
All, I'm hoping one of you Xml or Data gurus can offer an opinion. I'm working on an app to basically compare two semi-structured data files (e.g. Excel / CSV) to one another. But I need to...
3
by: Chandu | last post by:
Hi, I am working on awk programming which is similar to C programming and have got a doubt about time function returning a float value. Ex: 01:01:30 should return 61.5 when i have tried my way i...
6
by: Tom Kelleher | last post by:
Folks, I have a client who will likely be looking at ASP.NET in the near future. They have an internal developer who is convinced there are "scalability problems" with ASP.NET. This client has...
43
by: michael.f.ellis | last post by:
The following script puzzles me. It creates two nested lists that compare identically. After identical element assignments, the lists are different. In one case, a single element is replaced. In...
4
by: almurph | last post by:
Hi, Hope you can help me with this one. I'm looking for some nice string comparison algorithms. I want to be able to compare 2 strings (fairly smallish, less than 50 characters) and return a %...
7
by: bcutting | last post by:
I am looking for a way to take a large number of images and find matches among them. These images may not be exact replicas. Images may have been resized, cropped, faded, color corrected, etc. ...
7
by: matt | last post by:
hello, i have been given a challenging project at my org. i work on an inventory management web application -- keeping tracking of parts assigned to projects. in the past, i built an in-house...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.