這是一個批處理文件(在Windows 7中)。 我嘗試了一些組合和更改,但確切的輸出未實現。請檢查下面。循環出錯
setlocal enableDelayedExpansion
set c=
for %i in (1 2 3 4) do (
set b=%c% %i,2013/
call echo %b%
set c=%b%
)
我想輸出象下面這樣:
1,2013/
1,2013/2,2013/
1,2013/2,2013/3,2013/
1,2013/2,2013/3,2013/4,2013/
但它是未來像下面。
C:\用戶\ Ashutosh說PC> SETLOCAL enableDelayedExpansion
C:\用戶\ Ashutosh說PC>集合C =
C:\用戶\ Ashutosh說PC>爲%I(1 2 3 4 ?)DO( 更多設定b =%C%%I,2013/ 多個呼叫回波%b% 更多集合C =%b% 更多 更多)
C:???\ Users \用戶Ashutosh PC>( set b =%c%1,2013/ call echo%b% 組C =%B% ) %C%1,2013/
C:\用戶\ Ashutosh說PC>( 集B =%C%2,2013/ 呼叫回波%B% 集合C =%b% ) %C%2,2013/
C:\用戶\ Ashutosh說PC>( 集b =%C%3,2013/ 呼叫回波%b% 集合C =%b % ) %c%3,2013/
C:\ Users \ Ashutosh PC>( set b =%c %4,2013/ 呼叫回波%B% 集合C =%B% ) %C%4,2013/
C:\用戶\ Ashutosh說PC>
這是什麼語言? –
你真的得到了什麼輸出? –
它是Windows @RobinGreen中的批處理文件 – KD333