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

Option to always CALL?

Discussion in 'Support' started by noahcoad, Nov 2, 2012.

  1. noahcoad

    Joined:
    Apr 29, 2009
    Messages:
    35
    Likes Received:
    0
    Is there an option to always CALL batch files without having to specify CALL? The default behavior for running an executable from a batch is to run the process, then continue executing the batch file. But it's different for batch files where running a batch from within a batch by default exits the first batch (unless you use CALL). It becomes a pain when there are a lot of batch files and you never really know if what you're calling is a batch or exec. It sure would help if there was a global option to always imply CALL to keep the behavior consistent.

    == a.btm ==
    b
    echo continued

    == b.btm ==
    echo b

    In this example "continued" wouldn't be shown. If b was an executable then "continue" would be shown. If there was an "Always CALL" option, then it wouldn't matter if b was an exec or batch, the behavior would be consistent. Not a big deal if you control b as well, but sometimes the whole point is that b can be switched out by someone else, may be a batch to today an exec tomorrow.

    p.s. This option may already exist, if so it'd help for it to be mentioned in the CALL help section. If it doesn't exist, what do you think about adding it?
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,813
    Likes Received:
    82
    There isn't any option in TCC to do this -- it would be highly unpopular with people running legacy batch files!

    TCC's current batch file chaining / calling handling is identical to CMD's. If you want to suggest it as a new feature for a future version, click on the orange "feedback" button .
     
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    OTOH, IIRC, you can CALL an external, which make identical calling code possible, e.g.,
    call winword.exe file
     
  4. noahcoad

    Joined:
    Apr 29, 2009
    Messages:
    35
    Likes Received:
    0
    well good point, if I'd be calling any other batch files that depend on not returning from chaining another batch, turning on an option like this would break those, thanks for comment
     
  5. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    Perhaps an option could be added which always defaults to OFF whenever a batch file is started. If you had to turn it on, say with AUTOCALL ON, in every batch file which uses that feature, then it shouldn't cause compatibility issues.
     

Share This Page