#
# Dos9 Manual pages, The Dos9 project
# Copyright (C) 2012-2014 Romain Garbi (DarkBatcher)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
{{CALL command}}
The {CALL} command enables label or command file execution within the current
command promp context (e.g. the command executed can change
{spec/var|environment variables} values of calling script).
{{Synopsis}}
${CALL [/e] [file] [:label] [parameters ...]}
Call either the file {file} or the label {:label} within the current {Dos9}
context.
- {file} : A path to the file to be executed. If the label name {:label} and
the {/e} switch have been specified, then {Dos9} will serach the given label
in {file}.
- {:label} : A label where the command file execution will be started. If
neither {file} nor {/e} have been specified, then {:label} is to be searched
on the current file.
- {/e} : Indicate that both {file} and {:label} have been specified. This switch
avoid ambiguous behaviour toward parameter. By default, {Dos9} will only take
in account the very firs parameter. This switch has no effect if not specified
in first or second position, it will be considered as a parameter to be passed
in {parameters}.
- {parameters ...} : The parameters to be passed to the called script. The
parameters will be passed through {%1} - {%9}. You can give at most 9 parameters,
that is largely sufficient.
The specified script will be executed in the current {Dos9} context. That means,
it will be able to modify {spec/var|environment variables} but not
{spec/xvar|special variables}/
The ability to provide either {file} and {:label} are a {Dos9} extension. You
can get a {cmd.exe} compatible behavior by setting the option
{CMDLYCORRECT} from the command {setlocal|SETLOCAL}.
{{Compatibility}}
Compatible with {cmd.exe}, exception made for the {/e} switch.
Available since version {2014.0.9}.
{{See also}}
{for|FOR command}, {if|IF command}, {goto|GOTO command}