Thread View: alt.irc.ircii
2 messages
2 total messages
Started by Shayde
Fri, 16 Oct 1992 00:32
If structures and Tides. Inevitable change.
Author: Shayde
Date: Fri, 16 Oct 1992 00:32
Date: Fri, 16 Oct 1992 00:32
35 lines
1397 bytes
1397 bytes
*sigh* - just as I think it'll work... something changes :(
Client: 2.2pre7myc6+
I had a script that was working FINE for ever and ever, using the
following structure to check an internal variable. I set it earlier
(called 'hush') - I wanna do some functions, based on whether this
variable is set to 'Yes' or 'No'. Previously, I did it like this:
/^alias bro {
/if ([$hush]==[YES])
{ /msg $0 Can't say anything. Hushed. ;
/assign Ct_Msgs_Sent ${Ct_Msgs_Sent + 1} }
{ /say $1-
/assign Ct_Pub_Sent ${Ct_Pub_Sent + 1} }
}
(I know daemon - i'm still using / statements - so sue me :)
The if structure never runs correctly. The function always executes the
false condition, no matter what the 'hush' variable is set to.
SOO, could someone tell me the correct syntax for comparing a variable
to another string? I thought it was:
if ([$varname] == [value])
{ true structure }
{ false structure }
Thanx for the help!
Dave Shevett - 'Shayde'
shevett@pilot.njin.net
shevett@unipress.com
and points east....
Re: If structures and Tides. Inevitable change.
Author: -=Runaway Daemon=-
Date: Fri, 16 Oct 1992 02:18
Date: Fri, 16 Oct 1992 02:18
53 lines
1633 bytes
1633 bytes
In article <Oct.15.20.32.30.1992.16129@pilot.njin.net> shevett@pilot.njin.net (Shayde) writes:
Let's see if we can work this out.
>/^alias bro {
> /if ([$hush]==[YES])
> { /msg $0 Can't say anything. Hushed. ;
> /assign Ct_Msgs_Sent ${Ct_Msgs_Sent + 1} }
> { /say $1-
> /assign Ct_Pub_Sent ${Ct_Pub_Sent + 1} }
>}
^alias bro {
if (hush == [yes])
{
msg $0 Can't say anything. Hushed.
@ Ct_Msgs_Sent = Ct_Msgs_Sent + 1
}
{
/ $1-
@ Ct_Pub_Sent = Ct_Pub_Sent + 1
}
}
>(I know daemon - i'm still using / statements - so sue me :)
My lawyer will be contacting your lawyer tommorow around 2.
>if ([$varname] == [value])
>{ true structure }
>{ false structure }
Right.. It is however NOT
if ()
{ stuff ;
more stuff }
etc..
The syntax is one of the following three..
if (exp) {true} {false}
if (exp)
{true}
{false}
if (exp)
{
true
}
{
false
}
Notice the symetry. The parser still doesn't always get spacing
right and it gets real confused when it doesn't know where one command
begins and another ends.
>Dave Shevett - 'Shayde'
ian
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads