Export to GitHub

grub4dos-chenall - issue #83

% in BATCH SCRIPT


Posted on Mar 18, 2012 by Happy Bear

What steps will reproduce the problem? !BAT .. set /a a=10 set /a b=2 set /a c=%a%%%%b%

What is the expected output? What do you see instead? c=102

What version of the product are you using? On what operating system? 0.4.6a

Please provide any additional information below. set /a c=%a%+0%%%b% #c=0 OK!

Comment #1

Posted on Mar 19, 2012 by Happy Hippo

In batscript '%%' will expand as '%' %a%%%%b% = %a%%b% = 102

%a%+0%%%b% = %a%+0%%b% = 10+0%2 and current grub4dos calc is no priority, directly from left to right calculation.

10+0%2=(10+0)%2 = mod(10,2) = 0

Comment #2

Posted on Mar 26, 2012 by Happy Hippo

(No comment was entered for this change.)

Status: Done

Labels:
Type-Defect Priority-Medium