The 4DOS command processor for MS-DOS

4dos, batch commands, grub 4 dos, dos 4, ms dos 4

Am I blind – why does this alias not work

I wrote the following fairly simple alias:

netstatus=iff ".%1." == ".."  THEN ^ netstat -?  ELSE ^ netstat
%1& ENDIFF

whose purpose is to detect running without parameters and give
help.  It always
executes "netstat -?" twice with no parameters, and never gets to
running netstat with a supplied parameter.

The "^"s are for 4dos only.


     Chuck Falconer (cbfalco…@my-deja.com)
     http://www.qwikpages.com/backstreets/cbfalconer
     (Remove "NOSPAM." from reply address. Above works unmodified)

.
posted by admin in Uncategorized and have Comments (5)

5 Responses to “Am I blind – why does this alias not work”

  1. admin says:

    You’re simply missing a CommandSep after the "THEN" clause.  Try

      netstatus=iff ".%1." == ".."  THEN ^ netstat -? ^ ELSE ^ netstat
    %1& ENDIFF

    For a more concise version, try

      netstatus=netstat %@if[%# eq 0,-?]

    If you need more details, ask on the Forum

    CBFalconer wrote:

    > I wrote the following fairly simple alias:

    > netstatus=iff ".%1." == ".."  THEN ^ netstat -?  ELSE ^ netstat
    > %1& ENDIFF

    > whose purpose is to detect running without parameters and give
    > help.  It always
    > executes "netstat -?" twice with no parameters, and never gets to
    > running netstat with a supplied parameter.

    > The "^"s are for 4dos only.

     ——————————————————
     Mike Bessy                    JP Software, Inc.
     email supp…@jpsoft.com      web http://jpsoft.com/
     ______________________________________________________

  2. admin says:

    CBFalconer <cbfalco…@my-deja.com> wrote in message

    news:3A1291B7.5F9A9D3E@my-deja.com…
    > ArtId: 3404

    > I wrote the following fairly simple alias:

    missed some ^, here replaced with %+
     netstatus=iff ".%1." == ".."  THEN %+ netstat -? %+ ELSE %+ netstat
    %1& %+ ENDIFF

    Peruch Emiliano
    SoftWay S.r.l.

  3. admin says:

    - Hide quoted text — Show quoted text -

    Mike Bessy wrote:
    > CBFalconer wrote:
    > > I wrote the following fairly simple alias:

    > > netstatus=iff ".%1." == ".."  THEN ^ netstat -?  ELSE ^ netstat
    > > %1& ENDIFF

    > > whose purpose is to detect running without parameters and give
    > > help.  It always
    > > executes "netstat -?" twice with no parameters, and never gets to
    > > running netstat with a supplied parameter.

    > > The "^"s are for 4dos only.

    > You’re simply missing a CommandSep after the "THEN" clause.  Try

    >   netstatus=iff ".%1." == ".."  THEN ^ netstat -? ^ ELSE ^ netstat
    > %1& ENDIFF

    > For a more concise version, try

    >   netstatus=netstat %@if[%# eq 0,-?]

    > If you need more details, ask on the Forum

    Thanks Mike.  That works.  However (I just rechecked) the 4dos
    (6.01a) help shows no such separator, implying (to me) that the
    ELSE was parsed to serve the function.  On further thought that is
    obviously not possible to implement.


         Chuck Falconer (cbfalco…@my-deja.com)
         http://www.qwikpages.com/backstreets/cbfalconer
         (Remove "NOSPAM." from reply address. Above works unmodified)

  4. admin says:

    Please, PLEASE use our Support Forum when you wish to contact us.
    This unofficial and unmoderated "4dos" newsgroup is _not_
    monitored on a regular basis.

    In any case, I don’t have an old 6.01A help file on hand, but I
    strongly suggest you update to the current 4DOS 6.02B

    CBFalconer wrote:

    > Thanks Mike.  That works.  However (I just rechecked) the 4dos
    > (6.01a) help shows no such separator, implying (to me) that the
    > ELSE was parsed to serve the function.  On further thought that is
    > obviously not possible to implement.

     ——————————————————
     Mike Bessy                    JP Software, Inc.
     email supp…@jpsoft.com      web http://jpsoft.com/
     ______________________________________________________

  5. admin says:

     C> netstatus=iff ".%1." == ".."  THEN ^ netstat -?   ELSE ^ netstat %1&
     C> ENDIFF                                          |                    |
                                                        |                    |
                         add another ^ in there ——–’ and there ———’

      but something like this might be easier to follow

      netstatus=netstat %@if[ %# == 0, -? ]

     -=> Bye <=-


     * Origin: umop apisdn :zO palle> puel ay+ ui ajaymawoS (3:640/531.42)