set myvar=('foo', 'bar')
if [%somevar%]==[] (
Echo content of myvar=%myvar% Starting processing
externalprgm.exe %myvar% ...
....)
At runtime I got an error like :
Starting was unexpected at this time.
Obviously the DOS interpreter gets the closing bracket from %myvar% and closes the whole
"if" statement.
How can I rewrite the code that it works?
Dennis
Try double-quoting it. e.g.:
Echo content of myvar="%myvar%" Starting processing
>> If you are not able to escape the closing brackets then use a sub
>> routine to work around the problem with strings containing closing
>> brackets used within grouping brackets.
>>
>> sample:
>>
>> @echo off
>>
>> set "myvar=('foo', 'bar')"
>> if defined somevar CALL:Launch
>>
>> goto:endLaunch program
>>> Launch program routine
>> Echo content of myvar=%myvar% Starting processing
>> start "" /b "externalprgm.exe" "%myvar%"...
>> goto:eof
>>> endLaunch program
>>
>> \Rems- Tekst uit oorspronkelijk bericht niet weergeven -
>>
>> - Tekst uit oorspronkelijk bericht weergeven -
>
> There is also an alternative option for this variable, you can replace
> the ') with '^)
>
> sample:
>
> @echo off
> set "myvar=('foo', 'bar')"
>
> set "myvar=%myvar:')='^)%"
> If NOT "%myvar%"=="" (
> Echo content of myvar=%myvar% Starting processing
> )
\Rems, your responses are not likely to be reaching the OP because OP set
follow-up to a.m.b.nt but Tim Meddick multiposted his responses so your
posts in a.m.b. are not being sent to the group that OP set. It is a blunder
on OP's part to set follow-ups on a crosspost without indicating such, but
an equal error in judgement on Tim's part to multipost his responses.
For the record, the OP has not responded to anyone asking for further
information to any of his posts over the past 8 months.
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
Todd, thanks for the heads up.
\Rems
Please read this for your own edification.
http://lipas.uwasa.fi/~ts/http/crospost.html
Considering that you are still responding above the quoted text (top
posting), please have another look at this one too.
http://lipas.uwasa.fi/~ts/http/quote.html
HTH
About "Top posting" - As I read your post I find your condescending language
patronizing in the extreme.
I just had a look in one of the most popular groups: <
microsoft.public.windowsxp.general > and found by far and away - the majority of
people reply the way I choose to do at the moment.
I don't have much of an opinion on those who choose to replay after the quoted text.
With people who I count as normal - it's just a small matter of opinion.
But with some people - they can't help but make up petty rules about everything to
the point they want to take all the fun out of everything the five minutes in this
world has to offer...
To be blunt - I don't find you at all polite. I feel that you have had zero respect
for me from the start and don't believe you could ever think me in the right - no
matter what.
==
Cheers, Tim Meddick, Peckham, London. :-)
"Todd Vargo" <tlv...@sbcglobal.netz> wrote in message
news:h4r5s3$1oai$1...@adenine.netfront.net...
> I'm not really interested in your quoted links - if you can't be
> actually bothered to write down your own opinions.
Mr. Vargo isn't stating opinions, he's posting links that explain the
accepted norms of Usenet. (Not quite a standard, but similar.)
> About "Top posting" - As I read your post I find your condescending
> language patronizing in the extreme.
Top posting is a relatively recent problem. Here's a popular quote that
illustrates the problem nicely:
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on Usenet and in e-mail?
> I just had a look in one of the most popular groups: <
> microsoft.public.windowsxp.general > and found by far and away - the
> majority of people reply the way I choose to do at the moment.
People that do so are probably mostly users of Outlook or Outlook Express,
which defaults to placing the cursor at the top of the message... and
Microsoft does things their own way; always have. Since this isn't a
Microsoft group, you should go by the way things are done in this group.
> I don't have much of an opinion on those who choose to replay after the
> quoted text.
But many, many, many others do.
> With people who I count as normal - it's just a small matter of opinion.
Again, it's not. It's the accepted norm, both here and in many (if not
most) groups.
> But with some people - they can't help but make up petty rules about
> everything to the point they want to take all the fun out of everything
> the five minutes in this world has to offer...
They aren't "petty rules". Usenet has been around for nearly 30 years. The
rules have developed in that time, but believe me, they aren't petty or
arbitrary. They are meant to help people "speak" together in ways that make
sense.
> To be blunt - I don't find you at all polite. I feel that you have had
> zero respect for me from the start and don't believe you could ever
> think me in the right - no matter what.
By ignoring the accepted rules and standards of the rest of Usenet, *you*
are the one not being polite.
FWIW, multiposting is the act of posting identical (or nearly so) messages
to multiple groups one at a time, and is widely discouraged. (Excessive
multiposting will get you marked as a spammer.)
Crossposting is the act of entering more than one group in the
"newsgroups" line of a single message, and is acceptable, as long as you
keep it within reason. (Two or three related groups, such as the ones this
message is going into, are fine, but more than that, you really need to ask
yourself if the message really needs to go into all of those groups.)
While I'm at it, the standard for signatures (a few lines of text at the
end of the message, probably unrelated to the actual message) is that they
begin with "-- " (that's dash-dash-space) on a line by itself, then the
signature. Some (many? most?) newsreaders recognize the dashes and
automatically cut the signature out of replies.
For further information, I suggest you run a Wikipedia search for "Usenet
standards". (There's no actual article named as such, but you'll get some
useful info, such as what the "Usenet Death Penalty" is, and what the "Good
Netkeeping Seal of Approval" is.) Also, try googling for "Eternal
September" (but ignore eternalseptember.org; that's just another Usenet
server).
--
We walk a narrow path beneath the smoking skies.
Sorry, I'm to busy to bother with your ill fated rant.
But, in case you totally loose sight of common sense - I should point out to you that
the mere fact that you are successfully having a conversation with me,
notwithstanding that you don't like the way I set out my text, you can still "see"
it, well enough to respond to every little bit of it in detail.
As I really don't think you left anything out.
==
Cheers, Tim Meddick, Peckham, London. :-)
"Auric__" <not.m...@email.address> wrote in message
news:Xns9C58503663185au...@69.16.185.250...
Everyone decides him/herself what kind of an image to convey by
one's postings. An abbreviated extract from
"Why it is sensible to observe the Netiquette"
http://lipas.uwasa.fi/~ts/http/netiquet.html
* If you pay attention to the netiquette, your communication
will succeed better. You will gain more credibility on the Usenet
community for your own views.
* If you pay attention to the netiquette you will in all
probability get help more easily on the net when you have questions
to ask or need help on the net.
* On the Usenet news the majority of the readers will know you
by your messages only. What you write and how you behave will make
your net personality. Think carefully what kind of a picture you
wish to give about yourself. And who knows? Maybe one day you may
have other dealings in real life with a few of the persons who have
formed their picture of you on the net.
* If you repeatedly and deliberately ignore the netiquette you
will soon develop an indelible reputation of a troublemaker, and at
least the more serious users on the net will start avoiding you
altogether.
Followups reset
All the best, Timo
--
Prof. Timo Salmi mailto:t...@uwasa.fi ftp & http://garbo.uwasa.fi/
Hpage: http://www.uwasa.fi/laskentatoimi/english/personnel/salmitimo/
Department of Accounting and Finance, University of Vaasa, Finland
Useful CMD script tricks http://www.netikka.net/tsneti/info/tscmd.htm
> I cannot (will not) engage in this topic any further (it has nothing to
> do with DOS).
...but it has everything to do with netiquette (as pointed out by Prof.
Salmi), which is a general-purpose subject.
> But, in case you totally loose sight of common sense - I should point
> out to you that the mere fact that you are successfully having a
> conversation with me, notwithstanding that you don't like the way I set
> out my text, you can still "see" it, well enough to respond to every
> little bit of it in detail.
>
> As I really don't think you left anything out.
Well, there is one new thing: you have joined the small group of people who
refuses to change their ways after being told calmly and rationally the
reason why the change is needed.
Top-posting is bad because people don't normally read the most recent thing
first. Consider a story written as a series of letters. If the letters were
presented in reverse order, wouldn't that make for a rather confusing
story?
The signature delimiter ("-- ") is mentioned in an actual RFC (which are
the things that set the standards for the Internet) somewhere.
The standards are there to help faciliate communication.
Failing to abide by the standards once or twice will get you anything from
a gentle pointer to the rules (which you refused to read) to flaming (which
I doubt would do any good). Ignoring them after it's been explained will
probably result in you being ignored or being kill-filed (or "plonked") --
meaning that the people who could help you the most might very well be the
ones least likely to see you.
--
I am not a mermaid! My legs were stolen from me.
If you choose to ignore accepted standards, after being asked to do so,
then you must expect that the experts will be unwilling to help you.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)