mIRC Home    About    Download    Register    News    Help

Print Thread
#191837 16/12/07 05:26 PM
Joined: Apr 2004
Posts: 755
M
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 755
This is a rather silly shortcut suggestion.

With COM's one has to do

Code:
var %x = $com(com).result
.comclose com
return %x


I would love to be able to do something like:
Code:
return $com(com).return

Instead.

which returns the result and silently closes the com.

I can imagine this being rather simple to add but it would make me a happier scripter smile

T
Trashlord_
Trashlord_
T
what if you need to use the object for more than just one call?
with that method, you would have to reopen it.

in fact, you would never get there, because it'd always get closed before it gets the second call.

#191858 17/12/07 02:59 AM
Joined: Dec 2002
Posts: 3,015
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,015
He knows that, which is why he's suggesting a new property called .return rather than changing the current .result.

C
Champagne
Champagne
C
That's a very lovely suggestion in my opinion Mpdreamz. Although I understand your calling it silly, I think it's a perfectly valid idea as it is often the case (when returning one value) that we must place a COM's result in a variable, close the object, and then proceed to return the variables value. That's just plain annoying to you (assumption) and I and possibly others who like to explore COM objects. It would make me happy too <3

#191884 17/12/07 03:49 PM
Joined: Mar 2006
Posts: 392
T
Pan-dimensional mouse
Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 392
I like this idea myself... Every time I use $com I wonder why its not there allready.


[02:16] * Titanic has quit IRC (Excess Flood)
#191903 17/12/07 10:46 PM
Joined: Apr 2004
Posts: 755
M
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 755
-I've cooked up a hack method to do this but i have to refrain from posting it due to a challenge :p

Nonetheless (and challenge or not) i'd still love this wink

Last edited by Mpdreamz; 17/12/07 11:09 PM.
C
Champagne
Champagne
C
Oh ? I'd be very interested in learning what it is you did when such information becomes available :P

Joined: Oct 2003
Posts: 3,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
Please don't tell me it's

Code:
alias comresult { var %x = $com($1).result | .comclose $1 | return %x }

echo -a $comresult(x)


Joined: Apr 2004
Posts: 755
M
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 755
I won't because it's not,

Please tell me if I'm wrong arv0, but your tone comes off very belittling. Though i can understand your reply, I would not suggest "hacks" to anyone which is why i suggested a valid shortcut.

If its just me not having had my coffee yet and your just joking then i guess i can laugh at it when i have had my coffee smile

Last edited by Mpdreamz; 18/12/07 10:15 AM.

Link Copied to Clipboard