1. another error i can't figure
In the following code:
if equal(sign,'+') then
if equal('o',newmodes[1]) then on_op(nicks[1])
elsif equal('v',newmodes[1]) then on_voice(nicks[1])
elsif equal('b',newmodes[1]) then on_ban(nicks[1])
end if
end if
Why do i get this error?:
Syntax error - expected to see possibly 'end', not a function
if equal('o',newmodes[1]) then on_op(nicks[1])
^
Kat
2. Re: another error i can't figure
- Posted by a.tammer at hetnet.nl
May 28, 2002
Hi Kat,
send me the full code and I'll look into it. It's all too=
familiar with me. Your either nesting loops incorrectly, or=
forgetting to match braces girl.
antoine
3. Re: another error i can't figure
Kat wrote:
> Syntax error - expected to see possibly 'end', not a function
> if equal('o',newmodes[1]) then on_op(nicks[1])
> ^
If on_op() is a function (and not a procedure), you need to assign the
return value to something. Euphoria isn't like some other languages and
can't discard return values if there's no preceding assignment operator.
It took me a while before I realised that this is probably what's going on.
I was going to suggest putting an 'end' there to see what happened... :)
HTH,
Carl
4. Re: another error i can't figure
- Posted by a.tammer at hetnet.nl
May 28, 2002
Hi Kat,
Could it be you accidentally hit single or double quote between=
end and if, in my editor they don't show up, they're dead=
keys influencing your next entry with an accent. I use an=
personalised version of Context.
Antoine
5. Re: another error i can't figure
- Posted by alexione at EUnet.yu
May 30, 2002
>The standard work
>arounds on offer are:
>
> object VOID (or junk)
> if equal('o',newmodes[1]) then VOID = on_op(nicks[1]) ...
>
>or
>
> procedure o_op_proc(object x)
> end procedure
> if equal('o',newmodes[1]) then on_op_proc(nicks[1]) ...
>
>both are not pretty.
Or, another way:
procedure ignore (object x)
x = x -- just to avoid warning about unused parameter
end procedure
So, you just do
if equal ('o', newmodes[1]) then ignore (on_op (nicks[1]))
You can, than, put procedure 'ignore' in, say, miscx.e:
---- miscx.e ----
include misc.e
global procedure ingore ...
...
end procedure
---- end of miscx.e ----
And, instead of misc.e, you always use miscx.w
Regards...
Alexa