Quantcast
Channel: Take Command / TCC
Viewing all articles
Browse latest Browse all 1689

LEAVE appears to affect command-line arguments

$
0
0
LEAVE inside an argument-acquisition loop seems to make a subsequent test for empty argument fail, as well as cause a spurious error message:
Code:
[C:\batch]type foo.btm
@ echo off
  do until (%1) == ()
    iff (%1) == (trap) then
      shift
      leave
    endiff
    shift
  enddo

:PASTEND
  iff (%1) ne () then
    echo (%1):  too many parms!
  endiff

[C:\batch]foo a b c trap x
(x):  too many parms!

[C:\batch]foo a b c trap
():  too many parms!
TCC: C:\batch\foo.btm [13]  Unknown command...

Read more

Viewing all articles
Browse latest Browse all 1689

Trending Articles