Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

possible bug in SETDOS

Feb
16
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
 
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
 
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.
 
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
 

Similar threads

D
Replies
0
Views
2K
drrob1
D
Back
Top