1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.


Discussion in 'Support' started by vefatica, Jun 10, 2010.

  1. vefatica

    May 20, 2008
    Likes Received:
    Unlike many other variable functions that give info about a file, @LINES[] screws up the command it's embedded in when the file doesn't exist. Perhaps it could give the string "-2" in that case.

    v:\> if "%@crc32[idontexist]" eq "" echo foo
    v:\> if "%@md5[idontexist]" eq "" echo foo
    v:\> if "%@filesize[idontexist]" eq "" echo foo
    v:\> if "%@lines[idontexist]" eq "" echo foo
    TCC: (Sys) The system cannot find the file specified.
    Usage : IF [/I] [NOT] condition [.AND. | .OR. | .XOR. [NOT] condition ...] command
  2. rconn

    rconn Administrator
    Staff Member

    May 14, 2008
    Likes Received:

    The error is being returned four levels down in the parser; @LINES has no
    way of knowing what failed or why.

    I'd recommend testing for the existence of the file rather than relying on a
    variable function error message. Since there are several hundred functions
    with a wide variety of possible errors, there's no way for the TCC variable
    expansion to deliver detailed error messages without adding a mini-parser to
    every function. And significantly degrading the performance. And VASTLY
    increasing the code size!

    Rex Conn
    JP Software

Share This Page