Welcome!

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

SignUp Now!

Documentation SETDOS /F is pushed/popped by SETLOCAL/ENDLOCAL

Jan
1,189
25
SETDOS /F is pushed/popped by SETLOCAL/ENDLOCAL.

I can find that in the help for SETLOCAL but not in the help for SETDOS /F.
 
Okay, but it's still being used anyway. It would just be good, IF something is documented, if it's also completely documented. Just my opinion.
 
SETDOS is obsolete (for about the last 25 years), and its documentation will never be updated.
What about SETDOS /X? Are there new-fangled ways to turn off the special meanings of characters?
 
Blue-skying here: If users could attach comments to pages in the web help, and make them publicly viewable, then... you might have even more documentation.
 
I'm already doing that for myself, @Charles Dye

I have the TCC Help file saved as a RightNote file,
and when I find an error,
I edit the local web page in my RightNote file.

For example,
there is no such file as TakeCommand.Plugin.SDK.dll

It should be TC-DotNetPluginHost64.dll

1786130340197.webp


I also have added notes to select TCC Help Pages,
with information from forum posts,
that I know will never make it into the TCC Help File,
but are immensly helpful to me.

Joe
 
Blue-skying here: If users could attach comments to pages in the web help, and make them publicly viewable, then... you might have even more documentation.
User-contributed notes were a major feature of PHP's documentation and remain to this day. I was a PHP programmer for a few years, and I think it was the expandable documentation and the involvement of the user community that helped to give PHP the edge over other web languages like ASP and Cold Fusion.
 
The special meanings were for 4DOS, and have been deprecated forever for 4NT / TCC.
Arent these things and the ability to disable them still very relevant? I use them in situations where I know no other way.

1 All alias expansion
2 Nested alias expansion only
3 All variable expansion (includes environment variables, batch file parameters, variable function evaluation, and alias parameters)
4 Nested variable expansion only
5 Multiple commands, conditional commands, and piping (affects the command separator, ||, &&, |, and |&)
6 Redirection (affects < , >, >&, >&>, etc.)
7 Quoting (affects back quotes [`] and double quotes ["]) and square brackets)
8 Escape character
9 Include lists
A User-defined functions
 
SETDOS /X is recommended for many uses throughout the help file.

Examples;
DO varname IN @file executes the commands between DO and ENDDO once for every line in file, setting varname to the content of each one in turn.
Beware of characters with special meaning to TCC, such as redirection and piping symbols, within the file (use SETDOS /X as needed).


SETLOCAL will save :

•the default disk drive and directory
•the environment,
•the alias list
•the user-defined function list
•The directory stack (PUSHD)
•the special character set (command separator, escape character, parameter character, decimal separator, and thousands separator)
•the SETDOS /X setting
•the SETDOS /F setting

You can disable aliases temporarily with the SETDOS /X command.

One way to overcome these potential problems is to use the SETDOS /X command to temporarily disable redirection symbols and other special characters. The two-line batch file above would be a lot more likely to produce the expected results if it were rewritten this way:

setdos /x-15678
input Enter a string: %%str
echo %str
setdos /x0

The first line turns off alias processing and disables several special symbols, including the command separator and all redirection symbols. Once the string has been processed, the last line re-enables the features that were turned off in the first line.

When manipulating strings returned by @FUNCTION you may need to disable certain special characters with SETDOS /X.

At this stage, any remaining Escape Characters are processed. However, this might also already have taken place inside some of the variable functions (such as @IF) that are likely to pass escaped strings in their parameters. If you are referencing one of those in an ECHO or similar command, you need to escape twice ("^^") or use SETDOS /X to avoid premature evaluation. Carefully test those situations to make sure the results are as you intended.

The example below uses TEXT to display or append to a file (specified as the optional parameter of the batch file):

@echo off
setlocal
setdos /x-6
set dest=%@if[%# GT 0,>> %1,]
setdos /x+6
set repeat=0
on error (unset dest & goto PROBLEM)
:PROBLEM
iff %repeat GT 1 then
echo Repeated problems - quitting
quit
endiff
set repeat=%@inc[%repeat]
text %dest
+----------------+
| Logical Drives |
+----------------+
endtext
subst %dest
echo. %dest
if %_transient eq 1 .and. %# EQ 0 pause
endlocal

Those are just a few of the several times in the help file that SETDOS /X is recommended to be used.

Joe
 
Alternatively: Any change of resurrecting the wiki? Maybe making it invitation-only, at least to start?
 
Anyway: I don't think that "normal" users (like myself) know what is actually deprecated or not. That's why they miss such things, and it isn't pleasant when the help is incomplete. After all, it is not even stated by SETDOS itself that SETDOS itself is deprecated ...
 
What does "deprecated" mean? 1) It won't be improved. 2) There are better options, so don't use it in new stuff. 3) It sometimes doesn't work, so stop using it. 4) It will be removed in a future version.
 
Back
Top