Can you provide me with an example? If it's not too much of trouble for you.
VBS - GOTO Do Loop
Started by
IO-error
, Nov 22 2006 03:24 AM
#16
Posted 18 December 2006 - 06:10 AM
Can you provide me with an example? If it's not too much of trouble for you.
#17
Posted 18 December 2006 - 09:05 AM
It looks as though what you are trying to do is run a default file name if you don't get input from the user. If that's the case then you really don't need to even have a loop. I don't write a lot of asp and all of my code is on another machine so fill in with the asp terms as needed.
You could do something like this.
An example of recursion would be the following where GetFileName is called from within GetFileName
You could do something like this.
Function GetFileName(Prompt as string) as string GetFileName = InputBox(Prompt, "Name Entry") End Function Dim sPrompt as string Dim sFileName as string sPrompt = "Enter a file name to process" sFileName = GetFileName(sPrompt) If sFileName = "" then sPrompt = "File Name cannot be empty. PLease enter a file name" sFileName = GetFileName(sPrompt) If sFileName = "" then sFileName = DefaultfileName end if end if ProcessFile
An example of recursion would be the following where GetFileName is called from within GetFileName
Function GetFileName(Prompt) as string Dim sFileName as string Dim index as integer index = 0 sFileName = "" Do while sFileName = "" or index < 5 sFileName = InputBox(Prompt, "Name Entry") index = index + 1 Loop End Function
#18
Posted 11 January 2007 - 07:51 AM
Thank you for the help.
It's really helpfull for my future scripts.
I'm not using it in this taskbooter program, because it's now finished in a different way.
It's really helpfull for my future scripts.
I'm not using it in this taskbooter program, because it's now finished in a different way.
Similar Topics
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users