just as an after thought;
instead of playing around with several unsynched arrays why not write a class for your data, then create an array of [class] to hold everything.
It isn't as difficult as you would think.
ASP VBScript code for a simple class holding two properties.
Extend this by adding more local variables.
Add more LET & GET property functions to suit the array names you currently have and you will have a method which will keep your values in sync.
BTW. The m_sName notation is the way I declare variables m_ indicates it's scope is Module level and the s is a string value.
Code:
<SCRIPT LANGUAGE=vbscript RUNAT=Server>
Class clsUDT
' declare the local variables to hold the data value
private m_sProp1
private m_sProp2
' a GET property is the function used to return the value back to the calling routine
' eg response.write clsObject.stringOne
public property GET stringOne()
stringOne = m_sProp1
end property
' a LET property is the function used to set the property
' eg clsObject.stringOne = "some value for this"
public property LET stringOne(value)
m_sProp1 = value
end property
public property GET stringTwo()
stringTwo = m_sProp2
end property
public property LET stringTwo(value)
m_sProp2 = value
end property
end class
</script>
Sample code to instantiate, set, use and destroy the objects
Code:
dim UDTtest(2)
for i = 0 to ubound(UDTtest)
' instantiate an array of the class
set UDTtest(i) = new clsUDT
next
' set some values
UDTtest(0).stringone = "1: "
UDTtest(1).stringone = "2: "
UDTtest(2).stringone = "3: "
UDTtest(0).stringtwo = "test string ONE"
UDTtest(1).stringtwo = "test string TWO"
UDTtest(2).stringtwo = "test string THREE"
' show the values in the browser
for i = 0 to ubound(UDTtest)
response.write UDTtest(i).stringone
response.write UDTtest(i).stringtwo
response.write "<br>"
next
for i = 0 to ubound(UDTtest)
' destroy all instances
set UDTtest(i) = nothing
next
The class code can be in the asp page or in a seperate included file but must be surrounded by the <script> tags
and there you are, OOP with ASP (almost) 
Have fun 
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|