【发布时间】:2016-08-31 14:49:24
【问题描述】:
我正在尝试打印从 1 到 150 的 2 个数字范围以及一些文本。 也就是说,第一个范围是从 1 到 150 的升序,第二个是从 150 到 1 的降序。 我可以打印升序,但我不确定如何使用降序。
Set xml = CreateObject("Microsoft.XMLHTTP")
For i = 1 to 150
TL1( "HELLO"&i&"INCRESING"&i&";" ) // In both the statement i should increment from 1 to 150 and
TL1( "HELLO"&n&"INCRESING_I"&i&"DECRESING_N"&n&";" ) // n should decrement from 150 to 1
Next
Set xml = Nothing
Function TL1( cmd )
xml.Open "GET", "http://127.0.0.1:2024/TL1?"&cmd, False
xml.Send
TL1 = xml.responseText
WScript.Stdout.Write cmd & vbCrLf
End Function
所以基本上在 for 语句之后。 i 应该增加,n 应该减少。有没有办法可以在同一个 forloop 中添加这个 n ?
【问题讨论】:
-
在第二个 TL1() 中不要只使用 i,而是使用 150 - i
-
@RobertAltman,实际上应该是
151 - i,因为i以1开头 -
@VictorMoraes 触摸先生。好收获!
-
@RobertAltman 将此作为答案发布,因为您是第一个在这里发表评论的人 :)
标签: for-loop vbscript increment decrement