mIRC Homepage
Posted By: ScatMan /sockread help - 27/07/03 11:15 AM
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
Posted By: starbucks_mafia Re: /sockread help - 27/07/03 11:23 AM
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.
Posted By: ScatMan Re: /sockread help - 27/07/03 11:35 AM
anyone ?
Posted By: LocutusofBorg Re: /sockread help - 27/07/03 02:03 PM
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.
Posted By: tomalak16 Re: /sockread help - 27/07/03 04:34 PM
Quote:
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 ..
Posted By: LocutusofBorg Re: /sockread help - 27/07/03 06:07 PM
typo on my part. for me it set %a to $+ b 1. missed a /
Posted By: ScatMan Re: /sockread help - 27/07/03 06:19 PM
do u know how it works in /sockread ?
Posted By: starbucks_mafia Re: /sockread help - 27/07/03 06:54 PM
I still don't have a clue what kind of answer you're looking for.
Posted By: LocutusofBorg Re: /sockread help - 27/07/03 07:40 PM
/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
Posted By: ScatMan Re: /sockread help - 27/07/03 07:43 PM
yes.. but the question was 'how the evaluation there works' and that's all i want to know
Posted By: LocutusofBorg Re: /sockread help - 27/07/03 09:32 PM
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.
Posted By: ScatMan Re: /sockread help - 27/07/03 09:41 PM
u don't know what i meant.. nevermind, thx anyway
if someone else know what i meant so plz help me

Posted By: codemastr Re: /sockread help - 27/07/03 11:57 PM
No, we don't know what you meant, thats why he said to restate your question in a way people can understand it!
Posted By: LocutusofBorg Re: /sockread help - 28/07/03 06:56 AM
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.....
Posted By: ScatMan Re: /sockread help - 28/07/03 08:54 AM
/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 ?

Posted By: LocutusofBorg Re: /sockread help - 28/07/03 09:08 AM
You already said that. No one understood that. Therefor it is only logical to assume no one will understand it now.
Posted By: ScatMan Re: /sockread help - 28/07/03 09:22 AM
what is so hard to understand ??????????????????
Posted By: LocutusofBorg Re: /sockread help - 28/07/03 09:24 AM
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.
Posted By: ScatMan Re: /sockread help - 28/07/03 09:34 AM
ok,
sockread %a $+ b
it won't work, why ?

Posted By: guesseyder Re: /sockread help - 28/07/03 10:20 AM
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.

Code:
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)
Posted By: ScatMan Re: /sockread help - 28/07/03 12:41 PM
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


Posted By: pheonix Re: /sockread help - 28/07/03 02:17 PM
sockread $eval(%a $+ b,2)
© mIRC Discussion Forums