[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Autoexec.nt commands
- Subject: Re: Autoexec.nt commands
- From: Harry Binswanger hb@xxxxxxxx
- Date: Sun, 26 Aug 2007 02:10:57 -0400
Robert wrote:
> because %oui%! performs a concatenation?
I suppose you could say that "y!" is a concatenation -- but only
in the sense that stringing letters together to form words is
concatenation.
Okay. It's kinda funny to me because I'm used to only A$ + B$, or "Hello "
+ "world", and the other permutations thereof. In BASIC, you can't write
A$Hello or A$"Hello".
> I still don't understand the shift between
> %oui% and oui. Why isn't it always %oui%?
> Is it the use/mention thing:
> %oui% refers to the value of the variable. But then
> so does oui in "set oui=Y"--or does it?
Command "SET /?".
Wow, there's a LOT of content there, and it's a little hard to follow. It
looks, to my surprise, like SET can even do some parsing of strings.
Very cool is the %random% "dynamic" variable, which returns a random number
between 0 and 32767--different each time. The second time I tried
commanding echo %random% it output my zip code! The chances of that
happening are 1 in 32768! Since David Auerbach may be reading this, I
concede that that's the same amazing result as the 1 in 32768 the chance of
every other number which appears.
It's exactly the same in XPL: You establish
a XyWrite variable like this: . AFTER Save/Get 01
exists -- and only after -- you can refer to it as . If
you try to use BEFORE it exists, you get an error (in
XPL, you crash; in BATCH, a nonexistent variable is simply
ignored -- treated as if you hadn't written it).
set myvar=Hello
echo %myvar% (returns "Hello")
set myvar=Goodbye
echo %myvar% (returns "Goodbye")
set myvar=
echo %myvar% (returns "ECHO is on" because there ain't no such
thing as %myvar% anymore -- you just nulled it! Therefore, you
are actually just issuing an "ECHO" command, and a bare ECHO
command by itelf polls the current value of ECHO)
Yes, I see all that. Thanks.
Use/mention is misleading in this context. It's define first,
then use. If you don't define, you can't use.
Re the IS versus PV usage, it's simple: IS is for strings, PV
is for values: "InsertString", "PutValue". Both must already
have been defined with, respectively, "SV=SetVariable" or
"SX=SeteXpression". Every computer language distinguishes
between text and math. Fundamental stuff.
But I'm still confused as to the syntax conventions here (if you want to
humor my ignorance):
if %oui%==y set oui=Y
I'd expect it to be:
if %oui%==y set %oui%=Y
Hmmm. Maybe it's because you use: "set oui=Y" not "set %oui%=Y"
Thanks for the tutorial, Robert.
Harry Binswanger
hb@xxxxxxxx