mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2011
Posts: 8
L
lcrzoex Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Jun 2011
Posts: 8
sockread $+(&,%variable)
$bvar($+(&,%variable),0) = 0

sockread $+(&prefix,%variable)
$bvar($+(&prefix,%variable),0) = data length, its ok.

i used /sockread to dynamic $+(&,%variable), without any prefix, but $bvar($+(&,%variable),0) is $null

solve - using $eval(%variable,2) first:
sockread $+(&,$(,%variable))
$bvar($+(&,%variable),0) = data length, its ok.

but i think this is bug. smile

Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
this is probably a consequence of its special handling of variable names. much like the variable related commands, /sockread needs to be able to prevent evaluation of a %var if it appears as the first token of the <%var|&binvar> parameter. however, what we see here is that the tendency to not evaluate variables extends to the last potential evaluation of a variable in that token, even if it is contained within an identifier (except $eval() or $iif() to name a couple). i don't see why this extra handling exists, but it could just be due to recycling of code - who knows :P

you shouldn't evaluate the variable twice with $eval(%variable, 2), a simple $eval(%variable) or $(%variable) will suffice. it also appears that mIRC will evaluate the variable it's been 'saving' to leave escaped if there is a token after the <%var|&binvar> parameter, so 'sockread & $+ %var a' works as you need. but stick to the first solution ;P


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde

Link Copied to Clipboard