There seems to be nothing wrong with the syntax yet it keeps giving me the "loop" without "do" error.
VBScript Error 800A040E("loop" without "do" error)
Code:
set shell = createobject ("wscript.shell")
' Specify length of names.
intMax = inputbox("Length of text")
' Specify number of names to generate.
intNum = inputbox("Amount of text")
Dim intMax, iLoop, k, intValue, strChar, strName, intNum
' Specify the alphabet of characters to use.
Const Chars = "abcdefghijklmnopqrstuvwxyz"
If intMax="" Then
msgbox "Please specify length of names"
Elseif intNum="" Then
msgbox "Please specify number of names to be generated"
End If
Do
Randomize()
For iLoop = 1 To intNum
strName = ""
For k = 1 To intMax
' Retrieve random digit between 0 and 25 (26 possible characters).
intValue = Fix(26 * Rnd())
' Convert to character in allowed alphabet.
strChar = Mid(Chars, intValue + 1, 1)
' Build the name.
strName = strName & strChars
wscript.sendkeys (strname & "{space}")
Next
returnvalue=MsgBox ("Do you want to generate some more text?",36)
If returnvalue=6 Then
Msgbox "Ok, Generator will activate again"
Elseif returnvalue=7 Then
msgbox "Generator is shutting down"
wscript.quit
End IF
loop
Comment