Re: #if command
Joshua Berne <berne-7iHiS5+6wm7SUeElwK9/[email protected]> Tue, 14 Dec 2004 08:35:47 -0500 (EST)
| Newsgroups | gmane.comp.games.mud.client.lyntin |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 13 Dec 2004, David Clymer wrote:
> On Mon, 2004-12-13 at 22:52, Bartosz wrote:
> > Hi,
> > What I am doing wrong?
> >
> > #if {$$x == 145 && $$y == 5} {#showme AAAAAAAA}
> > if: invalid syntax / syntax error.
> >
>
> your first $ is escaping the second $, resulting in a comparison between
> the string $x and the number 145, which lyntin can't do.
It's not quite escaping, it's delaying evaluation. This is the syntax you
would use if you were putting the expression into an alias, so that the
values of the variables would get evaluated when the alias was called, not
when the alias was input.
> > #if {$myhpvar < 100 && $myspvar < 100} {#showme PANIC!}
> > if: invalid syntax / syntax error.
> >
>
> You have no variable defined by the name of $myhpvar, or it is empty. As
> stated in the help for the #if command, variables are expanded before
> the command is executed. So, if $myhpvar is empty, you would be
> executing the following command:
>
> #if { < 100 && < 100} {#showme PANIC!}
Yup, or it's the && thing. && is invalidin python. Lyntin used to do a
replace on the string of && with and and || with or, but i guess that was
removed at some point in the past.
- Josh
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/