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

Problem with calls in TCC batch file

Discussion in 'TCC/LE Support' started by rnwolf, Oct 29, 2008.

  1. rnwolf

    Joined:
    Oct 29, 2008
    Messages:
    2
    Likes Received:
    0
    Hi All

    I've encountred a problem running jruby on my WinXP computer when attempting to start jruby in the TCC/Lite shell. I am using TCC LE 9.02.152.

    I have created a test batch file which I run in TCC and in CMD shells.

    CMD SHELL

    C:\Test>test_class_path.bat
    TEST_CP=start;C:\Test\somefile1.jar;C:\Test\somefile2.jar

    TCC SHELL

    [C:\Test]test_class_path.bat
    TEST_CP=start;:setcp C:\Test\somefile1.jar;:setcp C:\Test\somefile2.jar


    Notice the ":setcp" text

    Here are the two batch files that are used to generate the above results. There are also two files named somefile1.jar and somefile2.jar in the test directory.

    @echo off
    rem test_class_path.bat
    rem Run this batch file to see how TCC processes add data to environment var
    SET TEST_CP=start
    @call "_make_class_path.bat"
    echo TEST_CP=%TEST_CP%
    SET TEST_CP


    @echo off
    rem _make_class_path.bat
    rem Test batch file to demo problem with batch file differences in TCC vs standard CMD.exe
    SET TEST_CP=%TEST_CP%
    rem ----- Set Up The Test Classpath ----------------------------------------
    for %%i in ("C:\Test\*.jar") do @call :setcp %%i
    goto :EOF

    rem setcp subroutine
    :setcp
    if not "%TEST_CP%" == "" goto add
    set TEST_CP=%*
    goto :EOF

    :add
    set TEST_CP=%TEST_CP%;%*
    goto :EOF


    Is this a bug in TCC?

    Thanks
    Rudi
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,280
    Likes Received:
    38
    Quite possibly. It looks like the name of the subroutine is getting into %*, which doesn't seem correct to me.

    As a workaround, I think you can do the same thing more simply via something like:

    set test_cp=
    for %f in ( c:\test\*.jar ) set test_cp=%test_cp;%f
    set test_cp=%@right[-1,%test_cp]

    (Suggestion to Rex for future versions: an option to @EXPAND for user-specified separator characters?)
     

Share This Page