Welcome!

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

SignUp Now!

OPTION //directive=value is a ENDLOCAL

Sep
134
1
that means, it destroy the local Aliases and Functions and switch to global.

This was not the case last week, so it must have been installed with the last 3 or 4 builds.
I've wonder, that an Local defined Alias in my script suddenly never worked.

The following script demonstrate the problem, it defines Aliases in the SETLOCAL / ENDLOCAL block
wich will not more present after the OPTION Command, but the next alias definition after the
OPTION command will store in global Memory.
Code:
OPTION //ErrorColors=Bright Yellow on Bright Red

Color Black on Bright Yellow
Ver /R

Function /G
Function IsFunction=%%@IF[ISFUNCTION %%1,TRUE,FALSE]
Function IsAlias=%%@IF[ISALIAS %%1,TRUE,FALSE]
::
Alias PrintLineW=`Echo %@REPEAT[%1,%@DEC[%_COLUMNS]]`
::
Echo Alias PrintLineW ist %@ISALIAS[printlinew]
EchoS Alias PrintLineW: & Alias PrintLineW
PrintLineW *
::
Echo Aliaslist: & Alias
Echo Functionslist: & Function
:::::::::::::::::::::::::::::::::::::::
Setlocal
  UnAlias *
  UnFunction *
  Alias localPrintLineW=Echo %%@REPEAT[%%1,%%@DEC[%%_COLUMNS]]
  Function localIsFunction=%%@IF[IsFUNCTION %%1,TRUE,FALSE]
  Function localIsAlias=%%@IF[IsALIAS %%1,TRUE,FALSE]
  Echo Alias localPrintLineW ist %@localISALIAS[localprintlinew]
  EchoS Alias localPrintLineW: & Alias localprintlinew
  localPrintLineW +
  Echo Aliaslist: & Alias
  Echo Functionslist: & Function
  Memory | TAIL /N+16
    OPTION //BatchEcho=No & OPTION BatchEcho
  Memory | TAIL /N+16
  Echo Aliaslist: & Alias
  Echo Functionslist: & Function

  Echo Alias localPrintLineW ist %@localISALIAS[localprintlinew]
  EchoS Alias localPrintLineW: & Alias localprintlinew
  localPrintLineW #
  Alias localPrintLineW=Echo %%@REPEAT[%%1,%%@DEC[%%_COLUMNS]]
EndLocal
Echo Aliaslist: & Alias Local*
Echo Functionslist: & Function Local*
localPrintLineW !
 
Last edited:
This will do it too. (What is ZoneId anyway?).

Code:
v:\> type test.btm
setlocal
unalias *
alias foo=bar
echo Before:
alias
option //ZoneId=0
echo ========^r^nAfter:
alias | head /n2

Code:
v:\> test.btm
Before:
foo=bar
========
After:
hexe=d:\HWorks6\HWorks32.exe %$
e=textpad
 
(What is ZoneId anyway?).
I think that controls emulation of the Explorer feature which marks files downloaded from the internet as having been downloaded from the internet, so Explorer can refuse to run them. But I could be mistaken.
 

Similar threads

Back
Top