possible bug in SETDOS

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Feb 25, 2009
16
0
#1
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
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
 
Feb 25, 2009
16
0
#3
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
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