mIRC Home    About    Download    Register    News    Help

Topic Options
#184030 - 24/08/07 07:49 PM Bugs already reported but not fixed
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3515
Loc: France
1) When you trying to stick some text with $N like $1's, if text contain number, mirc cut the text :

Code:
//tokenize 32 Ga is Ga | echo -a $1_some_text /// $1_some1text


2) There is another strange thing :

Code:
//Echo -a $mid(text,1,2)Ga


This will echo "te" but i think it should return $mid(text,1,2)Ga since the $mid shouln't be evaluate and here :
Code:
//echo -a Ga$mid(text,1,2)

the $mid isn't evaluate.
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#184031 - 24/08/07 08:10 PM Re: Bugs already reported but not fixed [Re: Wims]
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
I think the second thing you've shown should give an error.

Top
#184040 - 24/08/07 10:06 PM Re: Bugs already reported but not fixed [Re: hixxy]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3515
Loc: France
Why ? this can be reproduced with any $identifier that use bracket ().

Code:
$mid(text,1,2)Ga

Where is the error ?
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#184042 - 24/08/07 10:40 PM Re: Bugs already reported but not fixed [Re: Wims]
Horstl Offline
Hoopy frood

Registered: 03/11/06
Posts: 1559
Loc: Germany
Originally Posted By: Wims

Code:
//Echo -a $mid(text,1,2)Ga

This will echo "te" but i think it should return $mid(text,1,2)Ga

It's returning "te" as mIRC evaluates the $mid* thingie (you're using "//" in your echo command). If you want it to return "$mid(text,1,2)Ga", use /echo, not //echo.

But I think this should return an error, too:
Everything appending a text token identifier (don't know how to call this, like the example "$1's") is appended, but not everything appending the return of an alias/command, like $mid().
"$me's" never worked: how shall mIRC now whether to call "$me" and append "'s", or call a custom alias named "$me's"
The return of a nonexistent alias is $null, and //echo -a $null returns an error: * /echo: insufficient parameters smile

Top
#184046 - 24/08/07 11:10 PM Re: Bugs already reported but not fixed [Re: Horstl]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3515
Loc: France
Quote:
It's returning "te" as mIRC evaluates the $mid part (you're using "//" in your echo command). If you want it to return "$mid(text,1,2)Ga", use /echo, not //echo.


I'm not sure but i think you misundestood what i trying to show, i don't want to return anything, there is just a problem, if 1$mid(text,1,2) return 1$mid(text,1,2), so $mid(text,1,2)1 should return $mid(text,1,2)1.

Quote:
The return of a nonexistent alias is $null, and //echo -a $null returns an error smile

I agree but it's not the case here, $mid()Ga can't be a name of an alias (custom or not) because there is bracket.
If mirc parsed it as an alias, i'll should have in echo :
Quote:
no such identifier $mid()Ga

_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#184049 - 24/08/07 11:53 PM Re: Bugs already reported but not fixed [Re: Wims]
Horstl Offline
Hoopy frood

Registered: 03/11/06
Posts: 1559
Loc: Germany
Ok - now I get your point, thanks for clarification.

Regarding the error message: I have "identifier warning" disabled.

This might be regarded as a bug, but also I can imagine it's acting this way by design.
For me it is some "syntax gray area" - and I'm not dropping my own "should return $null/error" rating for the issue...yet smile


Top
#184055 - 25/08/07 12:20 AM Re: Bugs already reported but not fixed [Re: Horstl]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3515
Loc: France
Quote:
This might be regarded as a bug, but also I can imagine it's acting this way by design.


I agree but if it was a normal behavior (like $1's) the text after the $identifier should be returned too.
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#184056 - 25/08/07 12:21 AM Re: Bugs already reported but not fixed [Re: Wims]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
I'd imagine the reason that it doesn't give an error when you append text to the end of an identifier is because of props. If a prop is invalid, the identifier will still return the value as if there wasn't a prop.

//echo -a $chan(#channelname).topic2

That will return the channel name rather than an error. If the prop isn't valid, it's removed. Of course, you could make it throw and error if there's no "." there. I'm just showing why it probably doesn't give an error.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#184064 - 25/08/07 01:11 AM Re: Bugs already reported but not fixed [Re: Riamus2]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3515
Loc: France
Good point, I don't think about that before, but $mid doesn't support .props (it's the same for other identifiers like $asc, $chr etc...), so if the text isn't a props (event invalid), mirc should return the text as a "plain text" :

Code:
//echo -a $chan(#channelname).topic2 < return channel name
//echo -a $chan(#channelname).topic  < return the topic of the channel
//echo -a $chan(#channelname)text    < imo, should return $chan(#channelname)text

_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#184067 - 25/08/07 02:09 AM Re: Bugs already reported but not fixed [Re: Wims]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
I disagree about it displaying plain text. It should give an error message, not display the code. Yes, if you put text before the identifier, it will display as plain text, but that's because there's no way to know if it's supposed to be an identifier if there isn't a $ as the first character.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#184070 - 25/08/07 02:36 AM Re: Bugs already reported but not fixed [Re: Riamus2]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3515
Loc: France
Hum i don't care in fact, but which error mirc can be returns ?

* $ident() invalid format ?
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#184074 - 25/08/07 04:13 AM Re: Bugs already reported but not fixed [Re: Wims]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Whatever Khaled feels like using would be fine, I'm sure.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#189391 - 07/11/07 05:36 AM Re: Bugs already reported but not fixed [Re: Wims]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3515
Loc: France
The first bug concerning the behavior of $N'text with text that contain number is still present is 6.31

_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#189450 - 07/11/07 08:38 PM Re: Bugs already reported but not fixed [Re: Wims]
argv0 Offline
Planetary brain

Registered: 13/10/03
Posts: 3918
Loc: Montreal, QC, Canada
None of these are bugs, they're a reality of the mIRC parser.. that's why they were never "fixed". You really shouldn't be nitpicking about silly things like how mIRC reacts with code that violates the language syntax since the expected result is *UNDEFINED*. The invalid identifier warning you get is a convenience, not a requirement or guarantee. If you do something mIRC can't understand, that's your bug, not mIRC's.

As far as $1XYZ goes, that's a specific *feature* of the language, the same way the parser allows "//echo -a $mircdirSUBDIRECTORY" without using $+ for convenience. Not a bug.
_________________________
- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Top