VBScript: Multiple Statements on One Line
Many examples have I seen regarding how to break a long statement into multiple lines but only yesterday did I learn how to place two statements on the same line.
DIM strMyName : strMyName = "Chris"
DIM i : For i = 0 to 10
WScript.Echo i
Loop
This is, to me, very cool. If you’re using ‘Option Explicit’ (which you better be using), you can declare and assign a value to a variable, all on the same line… not too exciting, but it makes code much cleaner when used apropriatly.
Posted on August 13th, 2008 | By: Chris | Tags: Coding, Scripting, VBScript
Filed under Coding, Scripting, VBScript
6 Responses to “VBScript: Multiple Statements on One Line”
-
Votey Disciple
Says:
August 14th, 2008 at 10:42 amThis is why VB .NET was so much more useful.
Dim strMyName = “Chris”
For i As Integer = 0 To 10End For
-
Chris
Says:
September 11th, 2008 at 9:05 amMore powerful, yes. More useful, arguably no. The VBScript engine is part of a Windows install these days. VB.Net compilers, on the other hand, are less prevalent.
-
Антон Павлович
Says:
March 24th, 2010 at 8:36 pm…
-
Kylie Batt
Says:
May 3rd, 2010 at 2:09 amУлыбнуло спасибо……
Инженер ……
-
Kylie Batt
Says:
May 19th, 2010 at 9:45 pmНомер не пройдет!…
-
Webmaster
Says:
June 10th, 2010 at 12:03 pmHello! Please e-mail me your contacts. I have a question webmaster@bravto.ru” rel=”nofollow”>……
Thank you!!!…