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

Assigning 3 variables to the same value - Undocumented

Discussion in 'CMD' started by Joe Caverly, Sep 14, 2017.

  1. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    680
    Likes Received:
    8
    Code:
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    c:\utils>SET /A "_var1=_var2=_var3=10"
    10
    c:\utils>echo %_var1% %_var2% %_var3%
    10 10 10
    Code:
    TCC  21.01.49 x64   Windows 7 [Version 6.1.7601]
    Copyright 2017 JP Software Inc.  All Rights Reserved
    Your evaluation period expires in 28 days.
    You can buy Take Command, TCC, and CMDebug at https://jpsoft.com
    
    [c:\utils]SET /A "_var1=_var2=_var3=10"
    TCC: Syntax error "_var2_var3=10"
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,855
    Likes Received:
    83
    Dreadful syntax; not surprising that Microsoft was so embarrassed that they refused to document it!

    But it works in TCC 21.01.50.
     
  3. AnrDaemon

    Joined:
    Aug 23, 2010
    Messages:
    45
    Likes Received:
    1
    Actually, this is a common feature for many interpreted languages, and some more traditional ones.
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,855
    Likes Received:
    83
    Yes, and in those cases it's documented.
     

Share This Page