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

possible bug in SETDOS

Discussion in 'Support' started by grimblefritz, Jul 9, 2009.

  1. grimblefritz

    Joined:
    Feb 25, 2009
    Messages:
    16
    Likes Received:
    0
    Latest TCC version.

    No problems with SETDOS from the command line.

    From within a BTM:

    set XSTR=-245689A
    setdos /x%XSTR
    setdos

    and then later:

    set XSTR=-24689A
    setdos /x%XSTR
    setdos

    After the first setting, setdos will show EXPANSION=245689A

    After the second, setdos will still show EXPANSION=245689A

    If a setdos /x0 is performed prior to the second setting, then the results are as expected.

    The following produces the problem every time.

    Code:
    @echo off
    setlocal
     
    alias safemode=gosub setdosx safe
    alias semisafe=gosub setdosx semi
    alias unsafe=gosub setdosx off
    goto start
     
    :: ---------------------------------------------------------
    :setdosx [mode]
      switch "%mode"
      case "safe"
        set SETDOSX_MODE=-245689A
      case "semi"
        set SETDOSX_MODE=-24589A
      default
        set SETDOSX_MODE=0
      endswitch
      setdos /x%SETDOSX_MODE
    RETURN
     
    :: ---------------------------------------------------------
    :test [mode]
      echo Checking %mode
      %mode
      echo SETDOSX_MODE=%SETDOSX_MODE
      setdos
      echo ----------
      pause
    return
     
    :: ---------------------------------------------------------
    :start
     
    gosub test safemode
    gosub test semisafe
    gosub test unsafe
    gosub test safemode
    gosub test unsafe
    
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    grimblefritz wrote:
    | Latest TCC version.
    |
    | No problems with SETDOS from the command line.
    |
    | From within a BTM:
    |
    | set XSTR=-245689A
    | setdos /x%XSTR
    | setdos
    |
    | and then later:
    |
    | set XSTR=-24689A
    | setdos /x%XSTR
    | setdos
    |
    | After the first setting, setdos will show EXPANSION=245689A
    |
    | After the second, setdos will still show EXPANSION=245689A
    |
    | If a setdos /x0 is performed prior to the second setting, then the
    | results are as expected.

    WAD, exactly as it did from the first time it became available in 4DOS
    decades ago. The reason is that each of the SETDOS /x options is persistent,
    and is retained until cancelled. BTW, there is no difference between SETDOS
    behavior in a batch program and at the command line. Try out the same
    commands from the command line, and you'll observe the same results.
    --
    HTH, Steve
     
  3. grimblefritz

    Joined:
    Feb 25, 2009
    Messages:
    16
    Likes Received:
    0
    That probably should be more clearly documented in the help.

    I've used this since the first Norton version and never understood that behavior -- probably because I never had need until now to shift between multiple modes, only to disable some and then /X0.
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,784
    Likes Received:
    29
    On Thu, 09 Jul 2009 22:13:44 -0500, grimblefritz <> wrote:

    |That probably should be more clearly documented in the help.

    It seems pretty clear. I would not have expected SETDOS /X-24689A to enable 5
    after SETDOS /X-245689A disabled it. I would have expected the unmentioned
    options (1357) to keep their state. Options are enables with /X+N (or /X0 for
    all of them).
    --
    - Vince
     
  5. grimblefritz

    Joined:
    Feb 25, 2009
    Messages:
    16
    Likes Received:
    0
    Sorry, guess I must be reading the help all wrong.
     

Share This Page