473,504 Members | 13,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VBScript Error 800A040E("loop" without "do" error)

1 New Member
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)


Expand|Select|Wrap|Line Numbers
  1. set shell = createobject ("wscript.shell")
  2.  
  3. ' Specify length of names.
  4. intMax = inputbox("Length of text")
  5.  
  6. ' Specify number of names to generate.
  7. intNum = inputbox("Amount of text")
  8.  
  9. Dim intMax, iLoop, k, intValue, strChar, strName, intNum
  10. ' Specify the alphabet of characters to use.
  11. Const Chars = "abcdefghijklmnopqrstuvwxyz"
  12.  
  13. If intMax="" Then
  14. msgbox "Please specify length of names"
  15. Elseif intNum="" Then
  16. msgbox "Please specify number of names to be generated"
  17. End If
  18.  
  19. Do
  20.  
  21. Randomize()
  22. For iLoop = 1 To intNum
  23.     strName = ""
  24.     For k = 1 To intMax
  25.         ' Retrieve random digit between 0 and 25 (26 possible characters).
  26.         intValue = Fix(26 * Rnd())
  27.         ' Convert to character in allowed alphabet.
  28.         strChar = Mid(Chars, intValue + 1, 1)
  29.         ' Build the name.
  30.         strName = strName & strChars
  31.  
  32.     wscript.sendkeys (strname & "{space}")
  33.  
  34. Next
  35.  
  36. returnvalue=MsgBox ("Do you want to generate some more text?",36)
  37. If returnvalue=6 Then
  38. Msgbox "Ok, Generator will activate again"
  39. Elseif returnvalue=7 Then
  40. msgbox "Generator is shutting down"
  41. wscript.quit
  42. End IF
  43. loop
Jun 13 '13 #1
2 3042
Frinavale
9,735 Recognized Expert Moderator Expert
Is this VB.NET?
Or is it VBA?
Or maybe it is VB classic?

-Frinny
Jun 13 '13 #2
Rabbit
12,516 Recognized Expert Moderator MVP
You never close your first for loop.
Jun 13 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2999
by: Sam | last post by:
Guys facing a strange problem any clue would really rescue me.. i am using a ASP application with following things Server : Intel Xeon (TM) CPU 2GHz, 2GB RAM, 136GB HDD OS : Windows 2000...
0
1744
by: Geraint Evans | last post by:
Hi All, I am trying to access a Transform Data Task in a DTS by double clicking it. When I do, I get a message similar to "HResult of 0x80004005 (-2147467259) returned Unexpected error...
3
1318
by: Daylor | last post by:
hi. i want to destroy the application when i catch some exception. i have multithread app. how can i destroy the application and exit immedietly ?
0
1189
by: lambu76 | last post by:
Hi all, I've this strange problem. I've deployed a big and complicated ASP web application on different web server, all of them installed with Win 2000 Advanced Server SP3. I'm completly sure...
3
14762
by: Will McGugan | last post by:
Hi, Can anyone suggest a likely cause for the following exception... Exception exceptions.SystemError: 'error return without exception set' in <generator object at 0x0345CF30ignored Thanks...
1
9490
by: Anonymous | last post by:
My code has suddenly stopped compiling after some refactoring I carried out last week. I am using VC8 on W2K professional I get the following cryptic error: Error 77 fatal error C1001: An...
8
18745
by: pelicanstuff | last post by:
Hi - Was wondering if anybody could tell me why this rather crappy code is giving me an 'Else without If' error on compile? All the Elses and Ifs look ok to me but there's a few. Private Sub...
1
2012
by: eljainc | last post by:
Hello, I have a problem when working with a program that uses XAML in one of the modules. I copied some XAML code from another working project into an existing project, then when trying to...
6
7367
anoble1
by: anoble1 | last post by:
When I click and open my database I get the following error: "The expression On Load you entered as the event property setting produced the following error: Return without GoSub." I click OK, ...
3
2800
by: dowlingm815 | last post by:
I am receiving a Do While Syntax Error - Loop without Do - Can't See it. I would appreciate any fresh eyes? Mary Private Sub Create_tblNJDOC() On Error GoTo Err_Hndlr
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.