Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Start script again from beginning

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,46845
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Start script again from beginning
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Start script again from beginning - 5/9/2007 1:13:51 AM   
  markmcrobie

 

Posts: 314
Score: 0
Joined: 12/12/2006
Status: offline
The first thing my user sees is an InputBox where they can enter a string.

The script then searches a folder full of text files for this string, and returns the results.

What I'd like is after all this, the script runs again, offering them a new search.

I can't think of a way of saying "Goto Line 1".
 
 
Post #: 1
 
 RE: Start script again from beginning - 5/9/2007 1:25:19 AM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
Is that not the same question as http://www.visualbasicscript.com/m_46693/mpage_1/key_Input/tm.htm#46693

(in reply to markmcrobie)
 
 
Post #: 2
 
 RE: Start script again from beginning - 5/9/2007 1:33:43 AM   
  markmcrobie

 

Posts: 314
Score: 0
Joined: 12/12/2006
Status: offline
No, it's a different InputBox.

My script runs.  An input box pops up.  User types a string to search for.  The script then searches all the text file, and returns which text files the string was found on, in an InputBox.  User can then type any of these file names into the InputBox, and the script will open that text file.  It's this 2nd InputBox I keep open, so if the user opens a text file and sees it's not the one they're looking for, they can go back to the InputBox and try the next one, and so on, till they click cancel.

The question in THIS thread is about the very 1st InputBox.  In other words once the user is done with the 2nd InputBox, if they click Cancel (or if there were no matches to their string in InputBox 1), they get taken back to the 1st InputBox, so they can search for something else.

In other words, the only way for the script to exit should be clicking Cancel at the 1st InputBox

(in reply to gdewrance)
 
 
Post #: 3
 
 RE: Start script again from beginning - 5/9/2007 1:47:41 AM   
  ebgreen


Posts: 5250
Score: 31
Joined: 7/12/2005
Status: offline
Off the cuff:

bOuterDone = False

Do While Not bOuterDone
strRet = InputBox("Outer")
If strRet = "" Then exit Do

bInnerDone = False

Do While Not bInnerDone
   strRet = InputBox("Inner")
   If strRet = "" Then Exit Do
Loop
Loop

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to markmcrobie)
 
 
Post #: 4
 
 RE: Start script again from beginning - 5/9/2007 1:48:36 AM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
So could you not ceate them as Subs/Functions then Call that Sub/Function once the second InputBox exits

(in reply to markmcrobie)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Start script again from beginning Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts