Hi,
I want to create an array that will hold a fixed amount of character and the options will be presented in a drop down list when a user views it in the webpage.
Here is the code that I created so far:
"
Sub MapDriveSourceDD()
Dim Ret, i
Dim aDrives(6)
aDrives(0) ="T"
aDrives(1) ="U"
aDrives(2) ="V"
aDrives(3) ="W"
aDrives(4) ="X"
aDrives(5) ="Y"
aDrives(6) ="Z"
Ret = "<select name=""MapDriveSource"" id=""MapDriveSource"" class=""dropDownList"">"
Ret = Ret & "<option value='' checked>-none-"
For i = 0 to Ubound(aDrives)
Ret = Ret & "<option value='" & aDrives(i) & "'>" & aDrives(i)
Next
"
This code works fine. But I want to be more efficient with how I write my code. So i want to ger rid of the following code and put all of it in one line:
aDrives(0) ="T"
aDrives(1) ="U"
aDrives(2) ="V"
aDrives(3) ="W"
aDrives(4) ="X"
aDrives(5) ="Y"
aDrives(6) ="Z"
I tried: " aDrives(i) = ("T", "U" .....) ", but it does not work. Can anyone tell me a more efficient way to write the above code?
Thx
I want to create an array that will hold a fixed amount of character and the options will be presented in a drop down list when a user views it in the webpage.
Here is the code that I created so far:
"
Sub MapDriveSourceDD()
Dim Ret, i
Dim aDrives(6)
aDrives(0) ="T"
aDrives(1) ="U"
aDrives(2) ="V"
aDrives(3) ="W"
aDrives(4) ="X"
aDrives(5) ="Y"
aDrives(6) ="Z"
Ret = "<select name=""MapDriveSource"" id=""MapDriveSource"" class=""dropDownList"">"
Ret = Ret & "<option value='' checked>-none-"
For i = 0 to Ubound(aDrives)
Ret = Ret & "<option value='" & aDrives(i) & "'>" & aDrives(i)
Next
"
This code works fine. But I want to be more efficient with how I write my code. So i want to ger rid of the following code and put all of it in one line:
aDrives(0) ="T"
aDrives(1) ="U"
aDrives(2) ="V"
aDrives(3) ="W"
aDrives(4) ="X"
aDrives(5) ="Y"
aDrives(6) ="Z"
I tried: " aDrives(i) = ("T", "U" .....) ", but it does not work. Can anyone tell me a more efficient way to write the above code?
Thx