Hello Everyone
I am writing a script using the hta extension to get a GUI interface. One of my options to do is list the vendor daemon and port number it is using. the sub I use to populate the array is working and fill the array properly. When I call the sub that reads the array is having a problem that I can't seem to figure out. When the for each loop gets to the end of the array I expect it to stop return the variable I filled and write it to my text window, however that does not happen it just keeps looping inside the array and never returns. Any help you can provide will be greatly appreiciated. Thank you for your help. Below is the sub I am using to get the info I wanted.
Sub portuse()
pickvendor()
pickserv()
intNum = 0
intArraySize = UBound(aintPNum)
MsgBox intArraySize
strOutput = "Vendor Daemon" & vbTab & "Port Num" & vbNewLine
For Each strLine In astrVDName
Msgbox "Vendor Daemon" & " " & "Port Num" & vbNewLine & strLine & vbTab & vbTab & aintPNum(intNum)
strOutput = strOutput & strLine & vbTab & vbTab & aintPNum(intNum) & vbNewLine
intNum = intNum + 1
Next
document.forms.licmgr.output.value = strOutput
intNum = 0
End Sub
As you can see I have put variaous message boxes in trying to debug but, I still can't seem to find what is wrong. I was able to confirm that the array does have the correct data in it because as the for loop does it's looping I get the answers I expect howerver if I remove that msgbox from inside the for loop the loop never stops. I was able to get the for loop to stop by adding an "if" statement using the ubound answer to get inside the "if" statement then I said "Exit For" it did exit long enough to write to my text window but, then entered the for loop again. I even tried "Exit Sub" after the code that set the data to the text window but it seemed to ignore the "Exit Sub" statement. I am really confused.
I am writing a script using the hta extension to get a GUI interface. One of my options to do is list the vendor daemon and port number it is using. the sub I use to populate the array is working and fill the array properly. When I call the sub that reads the array is having a problem that I can't seem to figure out. When the for each loop gets to the end of the array I expect it to stop return the variable I filled and write it to my text window, however that does not happen it just keeps looping inside the array and never returns. Any help you can provide will be greatly appreiciated. Thank you for your help. Below is the sub I am using to get the info I wanted.
Sub portuse()
pickvendor()
pickserv()
intNum = 0
intArraySize = UBound(aintPNum)
MsgBox intArraySize
strOutput = "Vendor Daemon" & vbTab & "Port Num" & vbNewLine
For Each strLine In astrVDName
Msgbox "Vendor Daemon" & " " & "Port Num" & vbNewLine & strLine & vbTab & vbTab & aintPNum(intNum)
strOutput = strOutput & strLine & vbTab & vbTab & aintPNum(intNum) & vbNewLine
intNum = intNum + 1
Next
document.forms.licmgr.output.value = strOutput
intNum = 0
End Sub
As you can see I have put variaous message boxes in trying to debug but, I still can't seem to find what is wrong. I was able to confirm that the array does have the correct data in it because as the for loop does it's looping I get the answers I expect howerver if I remove that msgbox from inside the for loop the loop never stops. I was able to get the for loop to stop by adding an "if" statement using the ubound answer to get inside the "if" statement then I said "Exit For" it did exit long enough to write to my text window but, then entered the for loop again. I even tried "Exit Sub" after the code that set the data to the text window but it seemed to ignore the "Exit Sub" statement. I am really confused.