Prev: Reminder - Microsoft Responds to the Evolution of Community
Next: vbs script to list files in a directory and email results
From: Bill Murphy on 20 May 2010 11:21 i could not find anything either in the docs. There is currently 42 continuation OR's in the IF..THEN statement. We will be adding more. I want to make sure, until i get time to rewrite the whole scipt, that i don't run into some sort of limit. The actual script, the IF..THEN is used for server and database names, relating to which get backed up, which have log backups, etc. i just showed a simplified example. i did make a dummy script and put well over 100 continuation lines and it still worked. But i would still like to know. i hope this makes sense. -- Thanks, Bill "Dave "Crash" Dummy" wrote: > Mayayana wrote: > > > | | question is: how long can this IF..THEN statement be? > > | | it is > currently 42 lines. | > > > Look up Select Case > > Can you be more specific? I can't find anything in the Select Case or > If...Then...Else documentation that answers the question. > -- > Crash > > "Patriotism is the last refuge of a scoundrel." > ~ Samuel Johnson ~ > . >
From: Mayayana on 20 May 2010 15:54
|I wasn't looking for ways of cleaning up the script. sorry if i gave that | idea. i am looking for the limit of how big an IF..THEN statement can be, | espcecially when using the continuation syntax. | It just doesn't make sense to do it that way. If...Then is not designed for that. If that's really what you want to do then you'll just have to write it and see if it works. Select Case srvname Case "a", "b", "c" Case "d", "e". "f" End Select If Select Case doesn't seem ideal then you could do what Pegasus suggests, or even put them into an array: For i = 0 to UBound(ArrayList) If ArrayList(i) = srvname then ' do something Exit For End If Next | -- | Thanks, | Bill | | | "Mayayana" wrote: | | > Look up Select Case | > | > | | > | question is: how long can this IF..THEN statement be? | > | | > | it is currently 42 lines. | > | | > | > | > . | > |