EasyManua.ls Logo

Commodore PC 20 - Shift

Commodore PC 20
494 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
I
1116 MS-DOS User's Reference
Shift
Shifting
replaceable
IJarameters
Shift
Purpose:
Lets you change
the
position
of
replaceable
parameters
in
batch
file processing.
Syntax:
shift
Comments:
You can use
the
shift
command
to
change
the
positions
of
(replaceable)
command line parameters.
Usually
command
files are limited
to
handling
ten
parameters, % 0
through %Q. But
by
using
shift,
you can access
more
than
ten
parameters. This means that
if
there
are
more
than
ten
parameters
given
on
a
command
line, those that appear after
the
tenth
(%9)
will
be
shifted
one
at a time into %9.
You can use
the
shift
command
even
if
you have less than
ten
parameters.
Warning
There
is
no
backward
shift
command.
Once
you have
executed
shift,
you cannot recover
the
first
parameter
(%
0)
that
existed before
the
shift.
Example:
The following file mycopy.
bat
shows
how
to
use
the
shift
com-
mand
with
any
number
of
parameters.
It
copies a list
of
files
to
a specific directory.
rem
mycopy.bat
copies
rem
any
number
of
files
rem
to
a
directory.
rem
The
command
is
rem
mycopy
dir
files
:one
if
"%1"
= ., .,
goto
two
set
todir
=
%1
shift
copy
%1
%todir%
goto
one
:two
set
todir=
echo
All
done
[
[
[
[
[
[
[
[
[
[
[
[
[

Table of Contents

Related product manuals