mIRC Home    About    Download    Register    News    Help

Print Thread
#82072 06/05/04 05:15 AM
Joined: Aug 2003
Posts: 325
W
Wolfie Offline OP
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Instead of "%x == $null" be able to do "%x isnull" just because it might make it easier to script some grin

If not, then a reminder of that other suggestion I made about being able to write your own operators like...
Code:
OPERATOR isnull { return $iif($1 == $null,$true,$false) }


smile

#82073 07/05/04 12:15 AM
Joined: Nov 2003
Posts: 228
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Nov 2003
Posts: 228
How about just using !%x?

#82074 07/05/04 05:01 AM
Joined: Dec 2002
Posts: 266
Z
Fjord artisan
Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
That'll react when %x is 0, 0 != $null.


You won't like it when I get angry.
#82075 07/05/04 05:03 AM
Joined: Dec 2002
Posts: 266
Z
Fjord artisan
Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
Making your own operators would be so handy. Really, REALLY, handy.

* zack pleads to Khaled.


You won't like it when I get angry.
#82076 07/05/04 09:09 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hi,

I don't see why you need to create your own operators when you can create custom identifiers.

Typing if %x isnull doesn't seem to be more convenient than typing if $isnull(%x)

So just make the custom identifier (which you would also have to do if creating operators was enabled), and then simply use it in the if condition, like if $myidentifier(...) { do stuff }

Note that even though I replied to you, it doesn't necessarily mean it was directed to you, just a general comment.


Greetz

Last edited by FiberOPtics; 07/05/04 09:34 AM.

Gone.
#82077 07/05/04 10:57 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Well I don't really agree with %x isnull over %x == $null since it doesn't change anything, however the difference between using an operator and an identifier is that with an operator you can use $ifmatch later.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#82078 07/05/04 11:06 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hello,

no, you can perfectly use $ifmatch, just by making the custom identifier return the v1 in a case where it matches.

As a (stupid) example:
Code:
  

alias test { if $checklol($1) { echo -a $ifmatch } }

alias checklol { if $1 == lol { return matched lol } }

When typing /test lol, it will echo: matched lol


Greetz



Last edited by FiberOPtics; 07/05/04 11:09 AM.

Gone.
#82079 07/05/04 02:28 PM
Joined: Aug 2003
Posts: 325
W
Wolfie Offline OP
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
The idea is more for readability than for thinking that it can't be done as an identifier, because personally, I think it looks easier to read...
Code:
if ($v1 isnull) { }
if ($isnull($v1)) { }
if ($v1 != $null)) { }

...shorter (not the point though) and is a lot easier to read. Making identifiers isn't hard at all, I'll admit that, however, for readability, it would be nice...and I'm sure that others would find other uses in it (besides readability) or at least like that idea.

Still isnull would be a nice simple addition. cool

#82080 07/05/04 02:37 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hehe,

just lose the brackets, that'll give more readability :tongue:
Code:
 
if v1 isnull {
if $isnull(v1) {
if v1 != $null {
 


Anyway, I'm not against it, as for me it wouldnt make a difference, but if it helps other people to read it better, well then who am I to oppose that?

Greetz @Wolfie



Gone.
#82081 07/05/04 03:56 PM
Joined: Aug 2003
Posts: 325
W
Wolfie Offline OP
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
I actually like the ()'s and {}'s - to me that's easier to read because things are grouped off.
cool

And I know you weren't being opposed to it. Just responding to why I didn't like the identifier idea as a solution.

#82082 08/05/04 04:53 AM
Joined: Dec 2002
Posts: 266
Z
Fjord artisan
Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
Having something like:

if ($1 isbad) { } - For perhaps a bad word kicker.

Or:

if ($chan notalkie) {} - For a custom /amsg

Then it'll be beneficial because it's not only easier to read, but looks cool too!


You won't like it when I get angry.

Link Copied to Clipboard