473,395 Members | 2,689 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,395 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 1158

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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.