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 09:26 Hi, i have an IF..THEN statment in a VBS script that uses the underscore as a continuation so that the conditions for the IF are on separate lines, for readability. eg: IF srvname = "A" or _ srvname = "B" or _ etc. question is: how long can this IF..THEN statement be? it is currently 42 lines. -- Thanks, Bill
From: Mayayana on 20 May 2010 09:46 Look up Select Case | | question is: how long can this IF..THEN statement be? | | it is currently 42 lines. |
From: "Dave "Crash" Dummy" on 20 May 2010 10:31 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: Pegasus [MVP] on 20 May 2010 10:40 "Bill Murphy" <BillMurphy(a)discussions.microsoft.com> wrote in message news:91082FAD-5911-404C-8579-099826BAD3D8(a)microsoft.com... > Hi, > > i have an IF..THEN statment in a VBS script that uses the underscore as a > continuation so that the conditions for the IF are on separate lines, for > readability. eg: > > IF srvname = "A" or _ > > srvname = "B" or _ > > etc. > > question is: how long can this IF..THEN statement be? > > it is currently 42 lines. > > -- > Thanks, > Bill You could probably code this much more elegantly and speed up execution at the same time like so: const sServers = "/Server1/Server2/Server3/Server4/. . ./LastServer/" if instr(1, sServers, "/" & srvname & "/", 1) > 0 then . . .
From: Bill Murphy on 20 May 2010 11:11
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. -- Thanks, Bill "Mayayana" wrote: > Look up Select Case > > | > | question is: how long can this IF..THEN statement be? > | > | it is currently 42 lines. > | > > > . > |