Batch for語法內運算優先權 - Windows

Table of Contents

Hi all, 我的bat語法如下:

for /L %%i in (%a% %b% %c%) do (
....
...
..
.
set /a end_uid=(uid/30+1)*30
)

假設變數uid在前面已宣告且給定某值
set end_uid的運算因考慮優先順序想加上()
但放在for()內會導致語法錯誤
請問在for()內有替代括號的符號嗎

以上,謝謝!

--

All Comments

Rachel avatarRachel2011-12-18
set /a "end_uid=(uid/30+1)*30" 這樣子呢?
Enid avatarEnid2011-12-23
wow! 好方法 已解決! 感謝~