computing
  • 4

Dos Batch Lang. Env Var Bug

  • 4

I would like to see someone explain this IN DETAIL.

DOS command prompt in Windoze 2000:

set var2=

set /a var1=%var2%+1

(produces a ‘missing operand’ error)

BUT

set /a var1=+1

of course sets var1 equal to 1 with no error

In a windoze command prompt an environment variable that
doesn’t exist is suppose to resolve to null in an expression.

Not sure if this is repeatable in XP
or true DOS. Please comment thanks.

Share

1 Answer

  1. It’s surely not repeatable in DOS because there is no set /a in DOS.


    =====================================
    If at first you don’t succeed, you’re about average.

    M2

    • 0