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

caret or ampersand

Discussion in 'Support' started by rayandrews, May 18, 2010.

  1. rayandrews

    Joined:
    Apr 4, 2010
    Messages:
    57
    Likes Received:
    0
    Seems that whereas in 4DOS a caret was used to separate commands in a long alias, that's now done with the ampersand, is that right? If so, and if the answer isn't too complecated, I'm curious as to why the change. Also, since the ampersand had lots of uses before, I'm wondering if the above change has impacted any of the other uses of the ampersand.

    Geez, I wish there was a 'moving from 4DOS to TCC' doc.
    But that's what I get for being so far behind the times.
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    | Seems that whereas in 4DOS a caret was used to separate commands in
    | a long alias, that's now done with the ampersand, is that right? If
    | so, and if the answer isn't too complecated, I'm curious as to why
    | the change. Also, since the ampersand had lots of uses before, I'm
    | wondering if the above change has impacted any of the other uses of
    | the ampersand.

    Since COMMAND.COM did not have such a mechanism, when Microsoft followed in
    JPsoft's footsteps in CMD.EXE, they used a different character for the same
    purpose, to wit, the ampersand, hence when JPsoft introduced 4NT, it was
    made the DEFAULT command separator. But JPsoft software is always more
    flexible. There was already in 4DOS, and surviving to this day, a method to
    specify your command separator symbolically ( %+ ) and two methods to change
    the definition to any arbitrary character (instead of the default): the /C
    option of the SETDOS command, and the CommandSep directive in the .INI file
    (now preferrably set using the OPTION dialog). The first method (using %+)
    allows you to write batch files and aliases that work on anyone's system,
    regardless of their choice of command separator. The other two methods allow
    you to make to select the same special characters you are already used from
    4DOS, without the need to edit all your batch files. I as well as many other
    TCC users continue to use the 4DOS defaults for ParameterChar and
    EscapeChar, as well as for CommandSep.

    |
    | Geez, I wish there was a 'moving from 4DOS to TCC' doc.
    | But that's what I get for being so far behind the times.

    There was, in early versions of 4NT. Besides some DOS-only commands,
    directives, environment functions and internal variables, which became
    obsolete, the biggest issue is the different default mechanism for piping:
    the standard pipe, specified by the vertical bar | symbol, the right side of
    the pipe is performed in a separate instance of the command interpreter (if
    you pipe the output of a pipe to another command, you'll have 3 concurrent
    instances, etc.). Environment variables are inherited by the right side of a
    pipe, but variables created or modified on the right side are not passed
    back to the left. In the most recent versions there is a new symbol |! for
    the 4DOS-style pipe, formally known as "in process pipe". That's about it!
    --
    HTH, Steve
     
  3. rayandrews

    Joined:
    Apr 4, 2010
    Messages:
    57
    Likes Received:
    0
    Steve,

    Thanks, yes. But I see that my Separator is now Escape, Parameter is now the Separator and Parameter itself no longer exists in my .BTMs.
    I've seen how I can set it all back to my 4DOS defaults and that works fine but I could use some advice:

    Am I better off reworking all my BTMs to use the modern defaults or should I reconfigure to use my 4DOS settings? The reason I ask is that whereas converting all my BTMs might be a lot of work, but it guarantees future compatibility and might save future headaches -- or is reconfiguring really no big deal and not likely to give me future trouble?
    I have many very complecated BTMs that I use as a sort of VC system for programming and I want to start off on the right foot here.
     
  4. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    605
    Likes Received:
    0

    There are two reasons you might reconfigure to use the old 4DOS settings
    that I can think of. 1) You are still using 4DOS and can't control the
    configuration there. 2) The number of batch files, or unknown locations of
    batch files, makes the conversion job prohibitive.

    Unless you _really_ need to keep the old characters, I'd say to modify the
    batch files. It also will give you any possibility of using a .BAT in both
    cmd and tcc.


    --
    Jim Cook
    2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Monday.
     
  5. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    | There are two reasons you might reconfigure to use the old 4DOS
    | settings that I can think of. 1) You are still using 4DOS and can't
    | control the configuration there. 2) The number of batch files, or
    | unknown locations of batch files, makes the conversion job
    | prohibitive.

    When I started to use 4nt and TCMD (16-bit), I was also using 4DOS, and
    all my batch files were shared (and my aliases and my functions and even my
    .INI files). Just setting the 4DOS defaults was trivial, and everything
    (well, almost everything) worked "out of the box". I used TCMD back then
    because it had implemented most of the X3.64 color escape sequences, a
    feature added to 4NT much later.
    I had also converted all my files to use the symbolic form of the
    command line escape (%=) and the compound command separator (%+) so that I
    only use the "regular" forms when I am in a hurry at the interactive command
    prompt. I always wished that there were a symbolic form to represent the
    ParameterChar as well, which would make my code completely independent of
    what characters are used.
    There are two issues that not converting cause.
    1/ Most code in these fora use the TCC defaults without warning, you may
    need to convert them before using;
    2/ Rex chose the 4DOS command line escape character (ctrl-X) as the default
    VariableExpand character (pressing this character while editing the command
    line expands ALL variables AND variable functions to their current value). I
    had to add the directives NormalKey=Ctrl-X" and "VariableExpand=ctrl-Y", in
    that order, so that ctrl-X would have its 4DOS meaning, and I would have a
    keystroke (ctrl-Y) available to expand command line variables.

    | Unless you _really_ need to keep the old characters, I'd say to
    | modify the batch files. It also will give you any possibility of
    | using a .BAT in both cmd and tcc.

    That last issue never came up for me. Since I bought my first copy to
    4DOS I never used COMMAND.COM or CMD.EXE, although on rare occasion I do
    utilize some of CMD's "external commands", i.e., MS command line utility
    software. The two I use frequently are FC.EXE and SORT.EXE.
    In conclusion: whether or not you "bite the bullet" of converting your
    existing code (and your aliases, function definitions and batch files are
    CODE) is something only you can decide.
    --
    Steve
     
  6. rayandrews

    Joined:
    Apr 4, 2010
    Messages:
    57
    Likes Received:
    0
    Jim, Steve,

    Tx. for feedback. Compatibility with CMD won't be an issue for me and I will be using 4DOS back and forth with TCC, thus I guess I'll keep the 4DOS characters, at least for now. I can always convert them to the modern characters once I get everything running smoothly, but there's so much to learn in the mean time, I'll bite that off later.
     
  7. jmcm

    Joined:
    Jun 11, 2008
    Messages:
    26
    Likes Received:
    0
    On 19/05/2010 1:52 PM, Steve F����������������������������� wrote:


    Wow! I missed that one. Thanks Steve and Ray for the discussion.


    --
    Regards
    John McMahon
    lists@jspect.fastmail.fm
     

Share This Page