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

Variable setting regression in tcc17 ?

Discussion in 'Support' started by Juppycmd, Dec 10, 2014.

  1. Juppycmd

    Joined:
    Dec 10, 2014
    Messages:
    63
    Likes Received:
    1
    I'm currently using TCC/LE, but as it's getting outdated I tried to test-drive the newest and fanciest version 17 (probably the very reason why there's no new LE anymore :-)).

    Problem is: My batch files don't work no more :-( ... here's what happens:

    TCC/LE 13:
    Code:
    [C:\Program Files\JPSoft\TCCLE13x64]set x=y
    [C:\Program Files\JPSoft\TCCLE13x64]set %x%=z
    [C:\Program Files\JPSoft\TCCLE13x64]echo %y%
    z
    
    TCC 17:
    Code:
    [C:\Program Files\JPSoft\TCMD17x64]set x=y
    [C:\Program Files\JPSoft\TCMD17x64]set %x%=z
    TCC: Not in environment "yz*"
    [C:\Program Files\JPSoft\TCMD17x64]echo %y%
    ECHO is OFF
    
    Am I doing something wrong, or is nested var setting unsupported as of the last version?
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,129
    Likes Received:
    33
    OK here.
    Code:
    v:\> type ifftest.btm
    set x=y
    set %x%=z
    echo %y%
    
    v:\> ifftest.btm
    z
     
  3. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,374
    Likes Received:
    40
    I can reproduce it.

    I think the issue almost certainly has to do with recent kludges to support pseudovariables. It'll work as expected if you either (A) disable pseudovariables, or (B) omit the (unnecessary) trailing percent sign after the variable name.
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,092
    Likes Received:
    85
    Charles is right - the %= is being interpreted as a pseudovar. If you don't use pseudovariables, it's much safer to turn them off in OPTION / Advanced.
     
  5. Juppycmd

    Joined:
    Dec 10, 2014
    Messages:
    63
    Likes Received:
    1
    Thanks! The reason I use the trailing percent is that my editor (Notepad++) does nice color highlighting of the vars this way, and only this way. I didn't expect this to cause any trouble, or the Spanish Inquisition to arrive :-> ... but I'll be on my guard if similar errors show up.
     
  6. WavSlave

    Joined:
    May 29, 2008
    Messages:
    47
    Likes Received:
    0
    NO ONE expects the Spanish Inquisition! (Sorry, I couldn't resist.)
     

Share This Page