Hi ,
i try to figured out, how to set in VBSCRIPT some data to variables. I know, how to use basic variables and how to set them, but i need something other.
My situation:
I have table and there are some data in rows. We can tell, that there are CITYs.
I have variable Data and i want to fill this CITYs to my variable data.
Something like
Data1 = NewYork
Data2 = London
Data3 = Praha
...
And i want only define Data and using Do or For i want to set it. But i was not succsesfull. Pls. can you help me? I googled a lot, but it doesnt worked for me. I found something about array and also about collection but e.g. this doesnt worked because it return error "Company1 is undefined"
thx for help
i try to figured out, how to set in VBSCRIPT some data to variables. I know, how to use basic variables and how to set them, but i need something other.
My situation:
I have table and there are some data in rows. We can tell, that there are CITYs.
I have variable Data and i want to fill this CITYs to my variable data.
Something like
Data1 = NewYork
Data2 = London
Data3 = Praha
...
And i want only define Data and using Do or For i want to set it. But i was not succsesfull. Pls. can you help me? I googled a lot, but it doesnt worked for me. I found something about array and also about collection but e.g. this doesnt worked because it return error "Company1 is undefined"
Code:
Sub Macro_Master()
' create an array with a fixed size
dim companies(2)
' fill the array with the companies
set companies(0) = Company1
set companies(1) = Company2
set companies(2) = Company3
' iteration example 1
dim company
for each company in companies
response.write company.CompanyName
next
' iteration example 2
dim i
for i = 0 to ubound(companies)
response.write companies(i).CompanyName
next
end sub
thx for help