how the evaluation of the variable /sockread works ?
it seems that it doesn't work like /set, for example:
/sockread %a $+ b
/set %a $+ b 1
Was there really a need to post this twice? Besides, what kind of answer are you expecting here? codemastr gave the answer most people would've in the other thread and you started bitching. If you want to know why they evaluate differently then you should probably email Khaled, I don't think anyone here can give you a definitive answer.
There you go with the lame attention grabbing again. Ask a question, then wait. Don't post follow ups asking for answers or anything.
Then -- go read /help /sockread to see how something works. And if a code you tried didn't work, did you ever consider the possibility that it's not possible? You are trying to do something here that makes no sense whatsoever. /sockread just reads info that a socket receives.
PS: /set %a $+ b 1 is complete nonsense too.
PS: /set %a $+ b 1 is complete nonsense too.
Actually.. it's not. It sets %ab to 1. You'll find that mIRC does NOT evaluate the first parameter of:
/set
/unset
/var
/inc
/dec
ScatMan was wondering why /sockread isn't included in that list, given that the first parameter has the same purpose as in /set. I wonder about /bset ..
typo on my part. for me it set %a to $+ b 1. missed a /
do u know how it works in /sockread ?
I still don't have a clue what kind of answer you're looking for.
/sockread %varname
using /sockread %varname $+ b to create a new variablename by appending the letter b to %varname is pointless, just put the b in %varname and use
/sockread %varnameb
after that you can do whatever you want with %varname/%varnameb
yes.. but the question was 'how the evaluation there works' and that's all i want to know
sign.
"how the evaluation of the variable /sockread works ?"
/sockread is NOT variable - it's an alias. You can see this because it begins with a / and not with a % (or sometimes a &). Therefor you can not evaluate it, since that is limited to variables and identifiers (those thingies that start with a $)
If you had read the helpfile or read a tutorial, you would know that /sockread %varname dumps the information the socket receives into the variable by the name %varname. From there on, it's a normal variable and you can do whatever the heck you want with it.
Now if this still isn't the answer you want, then think long and hard about how you phrase your questions, as quite obviously -- judging from the lack of response -- none of the scripters on this board understand what you mean then.
u don't know what i meant.. nevermind, thx anyway
if someone else know what i meant so plz help me
No, we don't know what you meant, thats why he said to restate your question in a way people can understand it!
I quote myself:
Now if this still isn't the answer you want, then think long and hard about how you phrase your questions, as quite obviously -- judging from the lack of response -- none of the scripters on this board understand what you mean then.
-- try that. Consider how long this has been going on, and if all you hear are people saying the don't klnow what you mean and people giving you not the answer you look for, the problem is obviously in the way the question is asked.....
/set %a $+ b 1
will first add %a to b (without evaluating %a) and then put '1' in %ab, so how it works in /sockread ?
You already said that. No one understood that. Therefor it is only logical to assume no one will understand it now.
what is so hard to understand ??????????????????
Your inability to comprehend that no one understands your question. And considering there is one of you saying the question, and three of us saying we don't understand, the problem is not with us but with you. Now either rephrase the question, or stop wasting your time.
ok,
sockread %a $+ b
it won't work, why ?
WHY it evaluates it differently is probably something only khaled can answer. What has been said earlier is that /sockread is a function call instead of a variable declaration. I've run a little test (below) and that does kinda confirm this.
alias test {
%ab = 1
test1 %a $+ b
}
alias test1 {
echo -a $1
}
the above code echo's "b" to the screen which tells us that %a is evaluated before the letter b is attached to it, meaning $null $+ b which gives b. This is probably similar to what /sockread does although this actually uses the passed variable to store data (hardcoded i assume). If this answer and the above answers do not satisfy you then i suggest you really do email khaled for the reasoning behind this behaviour since he knows the sourcecode of mirc and we do not (or at least i don't)
it's not work like that becuz if it were so:
sockread %a
will make it
sockread $null
which is not true becuz //sockread %a works fine
sockread $eval(%a $+ b,2)