Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.msdos.programmer > #1057 > unrolled thread

Batch file replaceable parameters

Started by"Ed" <invalid@invalid.com>
First post2013-11-14 14:09 +1100
Last post2013-11-17 12:41 +1100
Articles 15 — 5 participants

Back to article view | Back to comp.os.msdos.programmer


Contents

  Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-14 14:09 +1100
    Re: Batch file replaceable parameters Sjouke Burry <burrynulnulfour@ppllaanneett.nnll> - 2013-11-14 05:18 +0100
      Re: Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-14 15:35 +1100
        Re: Batch file replaceable parameters pete@nospam.demon.co.uk - 2013-11-14 07:30 +0000
          Re: Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-14 19:19 +1100
        Re: Batch file replaceable parameters "R.Wieser" <address@not.available> - 2013-11-18 10:53 +0100
          Re: Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-19 20:00 +1100
            Re: Batch file replaceable parameters "R.Wieser" <address@not.available> - 2013-11-19 19:31 +0100
              Re: Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-21 23:07 +1100
                Re: Batch file replaceable parameters "R.Wieser" <address@not.available> - 2013-11-21 17:39 +0100
        Re: Batch file replaceable parameters Sjouke Burry <burrynulnulfour@ppllaanneett.nnll> - 2013-11-18 11:48 +0100
          Re: Batch file replaceable parameters pete@nospam.demon.co.uk - 2013-11-18 20:19 +0000
          Re: Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-19 20:02 +1100
    Re: Batch file replaceable parameters Herbert Kleebauer <klee@unibwm.de> - 2013-11-14 09:39 +0100
      Re: Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-17 12:41 +1100

#1057 — Batch file replaceable parameters

From"Ed" <invalid@invalid.com>
Date2013-11-14 14:09 +1100
SubjectBatch file replaceable parameters
Message-ID<l61eus$cmi$1@speranza.aioe.org>
Is it possible to pass the following string as a replaceable parameter in a Batch file?

    STUFF=8

Batch appears to treat  =  as a delimiter and the result is two parameters - "STUFF" and "8".
Is there any way to circumvent this?


[toc] | [next] | [standalone]


#1058

FromSjouke Burry <burrynulnulfour@ppllaanneett.nnll>
Date2013-11-14 05:18 +0100
Message-ID<52844f28$0$9303$703f8584@textnews.kpn.nl>
In reply to#1057
On 14.11.13 4:09, Ed wrote:
> Is it possible to pass the following string as a replaceable parameter in a Batch file?
>
>      STUFF=8
>
> Batch appears to treat  =  as a delimiter and the result is two parameters - "STUFF" and "8".
> Is there any way to circumvent this?
>
>
>
Maybe try   "stuff=8"    with the quotes?

[toc] | [prev] | [next] | [standalone]


#1059

From"Ed" <invalid@invalid.com>
Date2013-11-14 15:35 +1100
Message-ID<l61k03$lqc$1@speranza.aioe.org>
In reply to#1058
Sjouke Burry wrote:
> On 14.11.13 4:09, Ed wrote:
> > Is it possible to pass the following string as a replaceable parameter in a Batch file?
> >
> >      STUFF=8
> >
> > Batch appears to treat  =  as a delimiter and the result is two parameters - "STUFF" and
> > "8". Is there any way to circumvent this?
> >
> >
> >
> Maybe try   "stuff=8"    with the quotes?

Tried that (MS-DOS 7).  Didn't help.

It's not a big issue since, if need be, I can create multiple versions of the
batch file and hard-code the string into the one's I wanted.  Just curious
whether there was a way to input such strings.


[toc] | [prev] | [next] | [standalone]


#1060

Frompete@nospam.demon.co.uk
Date2013-11-14 07:30 +0000
Message-ID<1384414228snz@nospam.demon.co.uk>
In reply to#1059
On 14th Nov 2013 at 15:35 "Ed" <invalid@invalid.com> wrote:

> Sjouke Burry wrote:
> > On 14.11.13 4:09, Ed wrote:
> > > Is it possible to pass the following string as a replaceable parameter in 
> a Batch file?
> > >
> > >      STUFF=8
> > >
> > > Batch appears to treat  =  as a delimiter and the result is two parameters 
> - "STUFF" and
> > > "8". Is there any way to circumvent this?
> > >
> > >
> > >
> > Maybe try   "stuff=8"    with the quotes?
> 
> Tried that (MS-DOS 7).  Didn't help.
> 
> It's not a big issue since, if need be, I can create multiple versions of the
> batch file and hard-code the string into the one's I wanted.  Just curious
> whether there was a way to input such strings.

Looking at Timo Salmi's BATFAQ (TSBAT71.ZIP from garbo if it's still 
there) it seems that this simply isn't possible in batch without help 
from an auxilliary program.

Incidentally, while I was experimenting in dos 6.22 before remembering 
about Timo's bat utils, I also discovered that batch does a similar 
thing with commas.  So "1,2" as a parameter to the batch file arrives 
as 2 parameters (though curiously you can set an env var with a comma 
in it, e.g. set "stuff=1,2" behaves as you would think).

Pete
-- 
Believe those who are seeking the truth.
Doubt those who find it.  -  André Gide

[toc] | [prev] | [next] | [standalone]


#1061

From"Ed" <invalid@invalid.com>
Date2013-11-14 19:19 +1100
Message-ID<l6213a$fvt$1@speranza.aioe.org>
In reply to#1060
pete@nospam.demon.co.uk wrote:
> On 14th Nov 2013 at 15:35 "Ed" <invalid@invalid.com> wrote:
>
> > Sjouke Burry wrote:
> > > On 14.11.13 4:09, Ed wrote:
> > > > Is it possible to pass the following string as a replaceable parameter in a Batch file?
> > > >
> > > >      STUFF=8
> > > >
> > > > Batch appears to treat  =  as a delimiter and the result is two parameters - "STUFF"
> > > > and "8". Is there any way to circumvent this?
> > > >
> > > >
> > > >
> > > Maybe try   "stuff=8"    with the quotes?
> >
> > Tried that (MS-DOS 7).  Didn't help.
> >
> > It's not a big issue since, if need be, I can create multiple versions of the
> > batch file and hard-code the string into the one's I wanted.  Just curious
> > whether there was a way to input such strings.
>
> Looking at Timo Salmi's BATFAQ (TSBAT71.ZIP from garbo if it's still
> there) it seems that this simply isn't possible in batch without help
> from an auxilliary program.
>
> Incidentally, while I was experimenting in dos 6.22 before remembering
> about Timo's bat utils, I also discovered that batch does a similar
> thing with commas.  So "1,2" as a parameter to the batch file arrives
> as 2 parameters (though curiously you can set an env var with a comma
> in it, e.g. set "stuff=1,2" behaves as you would think).
>
> Pete

Thanks for that.  I suspected as much.

> --
> Believe those who are seeking the truth.
> Doubt those who find it.  -  André Gide

Good quote!

Here's one from a music album along similar lines:

    Constantly searching
    not wishing an end
    prefer a surprise
    not everything planned
    so you'll always be
    in the new age of earth.

'New Age of Earth' - Ashra  (LP)



[toc] | [prev] | [next] | [standalone]


#1064

From"R.Wieser" <address@not.available>
Date2013-11-18 10:53 +0100
Message-ID<5289e2d7$0$15882$e4fe514c@news2.news.xs4all.nl>
In reply to#1059
Hello Ed,

> > Maybe try   "stuff=8"    with the quotes?
>
> Tried that (MS-DOS 7).  Didn't help.

That phrase isn't really helpfull you know.  I'm pretty sure you got an
error message back, why didn't you include it ?

> I'm using TASM in a batch file

Although TASM is a very well-known word with me (as in "Borlands TASM",
which is what I use regulary) I also know that there are more assemblers out
there being referred to with TASM.  Could you please be more specific ?

You see, part of your problem is with BATCH files (it recognising "=" and
"," as argument delimiters, part of it is with TASM (it not accepting
(double)quotes around "/d" arguments)

As for the problem ?  Sjouke Burry's solution would be the best a good one,
if only you could strip those (double)quotes from the batch argument ...

Well, under XP that seems to be very easy: just put a tilde ("~") between
the percentage sign and the argument index-number: /d%~1

One problem though:  On my machine using a "/d" on itself (no actual
argument provided ) caused my TASM v5.0 to crash.
A solution to that would be to, in the batchfile, combine all those "/d"
arguments into a single string (including the "/d" prefixes), skipping the
empty ones.

Hope that helps.
Rudy Wieser


-- Origional message:
Ed <invalid@invalid.com> schreef in berichtnieuws
l61k03$lqc$1@speranza.aioe.org...
> Sjouke Burry wrote:
> > On 14.11.13 4:09, Ed wrote:
> > > Is it possible to pass the following string as a replaceable parameter
in a Batch file?
> > >
> > >      STUFF=8
> > >
> > > Batch appears to treat  =  as a delimiter and the result is two
parameters - "STUFF" and
> > > "8". Is there any way to circumvent this?
> > >
> > >
> > >
> > Maybe try   "stuff=8"    with the quotes?
>
> Tried that (MS-DOS 7).  Didn't help.
>
> It's not a big issue since, if need be, I can create multiple versions of
the
> batch file and hard-code the string into the one's I wanted.  Just curious
> whether there was a way to input such strings.
>
>
>

[toc] | [prev] | [next] | [standalone]


#1067

From"Ed" <invalid@invalid.com>
Date2013-11-19 20:00 +1100
Message-ID<l6f9e6$50j$1@speranza.aioe.org>
In reply to#1064
R.Wieser wrote:
> Hello Ed,
>
> > > Maybe try   "stuff=8"    with the quotes?
> >
> > Tried that (MS-DOS 7).  Didn't help.
>
> That phrase isn't really helpfull you know.  I'm pretty sure you got an
> error message back, why didn't you include it ?

There was no error message.  TASM sees  /d"stuff=8"  and swallowed it without
any effect that I could ascertain.

> > I'm using TASM in a batch file
>
> Although TASM is a very well-known word with me (as in "Borlands TASM",
> which is what I use regulary) I also know that there are more assemblers out
> there being referred to with TASM.  Could you please be more specific ?

I would have had been using one of the lesser-known TASM.

> As for the problem ?  Sjouke Burry's solution would be the best a good one,
> if only you could strip those (double)quotes from the batch argument ...

There's the rub

> Well, under XP that seems to be very easy: just put a tilde ("~") between
> the percentage sign and the argument index-number: /d%~1

Interesting.  Tried this under Win98SE.  TASM sees  /d~1  and reports
"unknown character"

> One problem though:  On my machine using a "/d" on itself (no actual
> argument provided ) caused my TASM v5.0 to crash.
> A solution to that would be to, in the batchfile, combine all those "/d"
> arguments into a single string (including the "/d" prefixes), skipping the
> empty ones.

That's curious as I haven't noticed the problem.  My batch file has provision
for 6 such parameters i.e. /d%1 /d%2 /d%3 /d%4 /d%5 /d%6
Usually they're passed empty to TASM.  At the moment I have TASM 3.1
installed but I'm reasonably certain I've tested with other versions
including 5.0.


[toc] | [prev] | [next] | [standalone]


#1069

From"R.Wieser" <address@not.available>
Date2013-11-19 19:31 +0100
Message-ID<528bad9a$0$15885$e4fe514c@news2.news.xs4all.nl>
In reply to#1067
Hello Ed,

> There was no error message.  TASM sees  /d"stuff=8"  and
> swallowed it without any effect that I could ascertain.

I take it you also checked the .LST file to see if it maybe contained a
mangeled version of the above argument ?

> I would have had been using one of the lesser-known TASM.

I take it you mean by that a non-Borland one.   In that case ofcourse 'all
bets are off' as they say.

> Interesting.  Tried this under Win98SE.  TASM sees  /d~1
> and reports "unknown character"

Yep, that is why I specifically named XP as the OS.  W98se does have a less
powerfull batch environment.

> That's curious as I haven't noticed the problem.

>... but I'm reasonably certain I've tested with other versions
> including 5.0.

Not curious at all.  As I said, that problem popped up with Borlands TASM
v5.0 (32bit).  Other (non-Borland) TASM products could well respond quite
differently.

And I must admit that I took it for granted that you would be using a 32-bit
assembler when from your current post I get the feeling that you are
actually working with a 16-bit version.

So, I retried with both Borlands TASM v4.1 and v1.01 , and those did accept
/d without a problem.  But when provided with something the same followed by
something between (double)quotes they both threw an error.

But back to the problem: you could maybe use a bit of a cludge like the
below

- - - - - - - -
set arg1=
set arg2=
if '%1'=='' goto Done
if '%2'=='' goto Done
set arg1=%1=%2
shift
shift
if '%1'=='' goto Done
if '%2'=='' goto Done
set arg2=%1=%2
shift
shift
rem etc. etc. etc.
:Done
tasm  /l  /t  /d%arg1%  /d%arg2% source.asm
set arg1=
set arg2=
- - - - - - - -

Its a cludge because you need to be sure that you always provide the extra
'variables' correctly.   Using a single argument where double argument
(resulting from the"x=y" format) is expected will throw everything off.

Hope it helps
Rudy Wieser


-- Origional message
Ed <invalid@invalid.com> schreef in berichtnieuws
l6f9e6$50j$1@speranza.aioe.org...
> R.Wieser wrote:
> > Hello Ed,
> >
> > > > Maybe try   "stuff=8"    with the quotes?
> > >
> > > Tried that (MS-DOS 7).  Didn't help.
> >
> > That phrase isn't really helpfull you know.  I'm pretty sure you got an
> > error message back, why didn't you include it ?
>
> There was no error message.  TASM sees  /d"stuff=8"  and swallowed it
without
> any effect that I could ascertain.
>
> > > I'm using TASM in a batch file
> >
> > Although TASM is a very well-known word with me (as in "Borlands TASM",
> > which is what I use regulary) I also know that there are more assemblers
out
> > there being referred to with TASM.  Could you please be more specific ?
>
> I would have had been using one of the lesser-known TASM.
>
> > As for the problem ?  Sjouke Burry's solution would be the best a good
one,
> > if only you could strip those (double)quotes from the batch argument ...
>
> There's the rub
>
> > Well, under XP that seems to be very easy: just put a tilde ("~")
between
> > the percentage sign and the argument index-number: /d%~1
>
> Interesting.  Tried this under Win98SE.  TASM sees  /d~1  and reports
> "unknown character"
>
> > One problem though:  On my machine using a "/d" on itself (no actual
> > argument provided ) caused my TASM v5.0 to crash.
> > A solution to that would be to, in the batchfile, combine all those "/d"
> > arguments into a single string (including the "/d" prefixes), skipping
the
> > empty ones.
>
> That's curious as I haven't noticed the problem.  My batch file has
provision
> for 6 such parameters i.e. /d%1 /d%2 /d%3 /d%4 /d%5 /d%6
> Usually they're passed empty to TASM.  At the moment I have TASM 3.1
> installed but I'm reasonably certain I've tested with other versions
> including 5.0.
>
>
>

[toc] | [prev] | [next] | [standalone]


#1070

From"Ed" <invalid@invalid.com>
Date2013-11-21 23:07 +1100
Message-ID<l6kt48$4dg$1@speranza.aioe.org>
In reply to#1069
R.Wieser wrote:
> Hello Ed,
>
> > There was no error message.  TASM sees  /d"stuff=8"  and
> > swallowed it without any effect that I could ascertain.
>
> I take it you also checked the .LST file to see if it maybe contained a
> mangeled version of the above argument ?

I did - nowhere to be found.  TASM (tasmx 3.1) appears to treat quoted argument
as a no-op.

> And I must admit that I took it for granted that you would be using a 32-bit
> assembler when from your current post I get the feeling that you are
> actually working with a 16-bit version.

Yes, it's a 16-bit application.  In fact it's the only real use I have for TASM.
The majority of my 'asm' work is done with a Forth (RPN) assembler.

> So, I retried with both Borlands TASM v4.1 and v1.01 , and those did accept
> /d without a problem.  But when provided with something the same followed by
> something between (double)quotes they both threw an error.

Ok.  Currently I have TASMX 3.1 installed.  IIRC the 16-bit TASM supplied
with the TASM 5 package actually signs on as version 4.

> But back to the problem: you could maybe use a bit of a cludge like the
> below
>
> - - - - - - - -
> set arg1=
> set arg2=
> if '%1'=='' goto Done
> if '%2'=='' goto Done
> set arg1=%1=%2
> shift
> shift
> if '%1'=='' goto Done
> if '%2'=='' goto Done
> set arg2=%1=%2
> shift
> shift
> rem etc. etc. etc.
> :Done
> tasm  /l  /t  /d%arg1%  /d%arg2% source.asm
> set arg1=
> set arg2=
> - - - - - - - -
>
> Its a cludge because you need to be sure that you always provide the extra
> 'variables' correctly.   Using a single argument where double argument
> (resulting from the"x=y" format) is expected will throw everything off.

Didn't work for me.  The resulting command seen by TASM was:

    tasm  /l  /t  /d  /d  source.asm

Not to worry.  I can always type the command by hand on the few occasions
it is required.  Thanks for the interest.



[toc] | [prev] | [next] | [standalone]


#1071

From"R.Wieser" <address@not.available>
Date2013-11-21 17:39 +0100
Message-ID<528e3665$0$15920$e4fe514c@news2.news.xs4all.nl>
In reply to#1070
Hello Ed,

> IIRC the 16-bit TASM supplied with the TASM 5 package
> actually signs on as version 4.

Yep, exactly that one. :-)

> Didn't work for me.  The resulting command seen by TASM was: [snip]

Argh!  I tested it on my XP machine and fully forgot to retest on the w98se
one. I just did (to see what would be going wrong) and it threw a
syntax-error. Because of the "=" inbetween the %1 and %2 no less. :-(

In that case I do not know of a simple solution/hack, sorry.

> Not to worry.  I can always type the command by hand on
> the few occasions it is required.  Thanks for the interest.

You're welcome.
Rudy Wieser


-- Origional message:
Ed <invalid@invalid.com> schreef in berichtnieuws
l6kt48$4dg$1@speranza.aioe.org...
> R.Wieser wrote:
> > Hello Ed,
> >
> > > There was no error message.  TASM sees  /d"stuff=8"  and
> > > swallowed it without any effect that I could ascertain.
> >
> > I take it you also checked the .LST file to see if it maybe contained a
> > mangeled version of the above argument ?
>
> I did - nowhere to be found.  TASM (tasmx 3.1) appears to treat quoted
argument
> as a no-op.
>
> > And I must admit that I took it for granted that you would be using a
32-bit
> > assembler when from your current post I get the feeling that you are
> > actually working with a 16-bit version.
>
> Yes, it's a 16-bit application.  In fact it's the only real use I have for
TASM.
> The majority of my 'asm' work is done with a Forth (RPN) assembler.
>
> > So, I retried with both Borlands TASM v4.1 and v1.01 , and those did
accept
> > /d without a problem.  But when provided with something the same
followed by
> > something between (double)quotes they both threw an error.
>
> Ok.  Currently I have TASMX 3.1 installed.  IIRC the 16-bit TASM supplied
> with the TASM 5 package actually signs on as version 4.
>
> > But back to the problem: you could maybe use a bit of a cludge like the
> > below
> >
> > - - - - - - - -
> > set arg1=
> > set arg2=
> > if '%1'=='' goto Done
> > if '%2'=='' goto Done
> > set arg1=%1=%2
> > shift
> > shift
> > if '%1'=='' goto Done
> > if '%2'=='' goto Done
> > set arg2=%1=%2
> > shift
> > shift
> > rem etc. etc. etc.
> > :Done
> > tasm  /l  /t  /d%arg1%  /d%arg2% source.asm
> > set arg1=
> > set arg2=
> > - - - - - - - -
> >
> > Its a cludge because you need to be sure that you always provide the
extra
> > 'variables' correctly.   Using a single argument where double argument
> > (resulting from the"x=y" format) is expected will throw everything off.
>
> Didn't work for me.  The resulting command seen by TASM was:
>
>     tasm  /l  /t  /d  /d  source.asm
>
> Not to worry.  I can always type the command by hand on the few occasions
> it is required.  Thanks for the interest.


[toc] | [prev] | [next] | [standalone]


#1065

FromSjouke Burry <burrynulnulfour@ppllaanneett.nnll>
Date2013-11-18 11:48 +0100
Message-ID<5289f091$0$6875$703f8584@textnews.kpn.nl>
In reply to#1059
On 14.11.13 5:35, Ed wrote:
> Sjouke Burry wrote:
>> On 14.11.13 4:09, Ed wrote:
>>> Is it possible to pass the following string as a replaceable parameter in a Batch file?
>>>
>>>       STUFF=8
>>>
>>> Batch appears to treat  =  as a delimiter and the result is two parameters - "STUFF" and
>>> "8". Is there any way to circumvent this?
>>>
>>>
>>>
>> Maybe try   "stuff=8"    with the quotes?
>
> Tried that (MS-DOS 7).  Didn't help.
>
> It's not a big issue since, if need be, I can create multiple versions of the
> batch file and hard-code the string into the one's I wanted.  Just curious
> whether there was a way to input such strings.
>
>
>
strange. I tried a batchfile named a.bat containing
echo %1     1
echo %2     2
and when typing a "aa=bb"
I get an output of:
"aa=bb"   1
           2
This works both in "cmd" and "command" window,
and the argument is not split in two
When not using quotes:
aa      1
bb      2

[toc] | [prev] | [next] | [standalone]


#1066

Frompete@nospam.demon.co.uk
Date2013-11-18 20:19 +0000
Message-ID<1384805979snz@nospam.demon.co.uk>
In reply to#1065
On 18th Nov 2013 at 11:48 "Sjouke Burry" <burrynulnulfour@ppllaanneett.nnll> wrote:

> On 14.11.13 5:35, Ed wrote:
> > Sjouke Burry wrote:
> >> On 14.11.13 4:09, Ed wrote:
> >>> Is it possible to pass the following string as a replaceable parameter in 
> a Batch file?
> >>>
> >>>       STUFF=8
> >>>
> >>> Batch appears to treat  =  as a delimiter and the result is two parameters 
> - "STUFF" and
> >>> "8". Is there any way to circumvent this?
> >>>
> >>>
> >>>
> >> Maybe try   "stuff=8"    with the quotes?
> >
> > Tried that (MS-DOS 7).  Didn't help.
> >
> > It's not a big issue since, if need be, I can create multiple versions of the
> > batch file and hard-code the string into the one's I wanted.  Just curious
> > whether there was a way to input such strings.
> >
> >
> >
> strange. I tried a batchfile named a.bat containing
> echo %1     1
> echo %2     2
> and when typing a "aa=bb"
> I get an output of:
> "aa=bb"   1
>            2
> This works both in "cmd" and "command" window,
> and the argument is not split in two
> When not using quotes:
> aa      1
> bb      2

I don't doubt that for a moment.  But using MSDOS 6.22 (I think the OP 
was using 7.0) that doesn't work; real MSDOS batch is a bit more 
limited :-(

Pete
-- 
Believe those who are seeking the truth.
Doubt those who find it.  -  André Gide

[toc] | [prev] | [next] | [standalone]


#1068

From"Ed" <invalid@invalid.com>
Date2013-11-19 20:02 +1100
Message-ID<l6f9gt$53t$1@speranza.aioe.org>
In reply to#1065
Sjouke Burry wrote:
> ...
> >
> strange. I tried a batchfile named a.bat containing
> echo %1     1
> echo %2     2
> and when typing a "aa=bb"
> I get an output of:
> "aa=bb"   1
>            2

It didn't help in passing the string  stuff=8  to an application








[toc] | [prev] | [next] | [standalone]


#1062

FromHerbert Kleebauer <klee@unibwm.de>
Date2013-11-14 09:39 +0100
Message-ID<l622d8$j6f$1@speranza.aioe.org>
In reply to#1057
On 14.11.2013 04:09, Ed wrote:
> Is it possible to pass the following string as a replaceable parameter in a Batch file?
> 
>     STUFF=8
> 
> Batch appears to treat  =  as a delimiter and the result is two parameters - "STUFF" and "8".
> Is there any way to circumvent this?



if [%1]==[stuff] set stuff=%2
if [%1]==[stuff] shift

[toc] | [prev] | [next] | [standalone]


#1063

From"Ed" <invalid@invalid.com>
Date2013-11-17 12:41 +1100
Message-ID<l696ui$ssl$1@speranza.aioe.org>
In reply to#1062
Herbert Kleebauer wrote:
> On 14.11.2013 04:09, Ed wrote:
> > Is it possible to pass the following string as a replaceable parameter in a Batch file?
> >
> >     STUFF=8
> >
> > Batch appears to treat  =  as a delimiter and the result is two parameters - "STUFF" and
> > "8". Is there any way to circumvent this?
>
>
>
> if [%1]==[stuff] set stuff=%2
> if [%1]==[stuff] shift

This doesn't produce the desired effect (?)

I'm using TASM in a batch file and sometimes need to enter/modify a symbol
from the command-line e.g.

    C:> asm stuff

where ASM.BAT contains the line:

    tasm  /l  /t  /d%1  /d%2  /d%3  /d%4  /d%5  source.asm

and the desired effect would be:

    tasm  /l  /t  /dstuff  filename.asm

That works.  However in order to pass a symbol and value to TASM

    tasm  /l  /t  /dstuff=8  filename.asm

Batch would need to insert 'stuff=8' as one item.




[toc] | [prev] | [standalone]


Back to top | Article view | comp.os.msdos.programmer


csiph-web