473,657 Members | 2,366 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 3051
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
3009
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 Advanced server. IIS5.0 Database: Oracle (Using ADODB to connect to the Database) App server running on the same machine (COM+)
0
1753
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 occurred. An error was returned without an error message" and the properties screen does not appear.
3
1329
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
1196
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 that my web application has no asp errors, but randomly and sometimes on one of these server Microsoft Script Debugger opens without an error inside.
3
14770
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 Will McGugan
1
9512
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 internal error has occurred in the compiler. c:\program files\microsoft visual studio 8\vc\include\xmemory 155
8
18757
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 MySearchButtonClick() If gcfHandleErrors Then On Error GoTo PROC_ERR PushCallStack "MySearchButton" If Me.AllowFlexibility = True Then If Me.UseSpecialism = True And Me.UseCountryExperience = True Then If Me.Active = True...
1
2028
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 compile the project I get the following: Error 13 Unknown build error, 'The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.'
6
7380
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, My form comes up. Then Another message comes up saying: "The expression On Timer you entered as the event property setting produced the following error: Return without GoSub" On my form I do have a Testbox that shows the Time and Date. I named it...
3
2805
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
8399
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8504
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7337
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6169
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.