Project

General

Profile

Sockread » History » Version 2

Per Amundsen, 02/16/2023 03:17 PM

1 1 Per Amundsen
_Added in 1.9.0_
2
3
*/sockread [-fn] [numbytes] <%var|&binvar>*
4
5
Reads bytes from the receive buffer into the specified variable.
6
7
If you specify a %var variable, a line of text ending with a Carriage Return/LineFeed is read into %var. The [[$crlf]] are stripped off (this may result in %var being [[$null]] if the line only consisted of [[$crlf]]).
8
9
If you specify a &binvar then [numbytes] of info is read into the binary variable. If no [numbytes] is specified it defaults to 4096 bytes.
10
11
*Switches*
12
13 2 Per Amundsen
table(ktable).
14
|*Switch*|*Description*|
15
| -f | Forces AdiIRC to fill the %var variable with whatever text is in the receive buffer, even if it does not end in a [[$crlf]]. |
16
| -n | allows you to read a [[$crlf]] terminated line into a &binvar. If the incoming line does not contain a $crlf, no bytes will be read into &binvar, unless you specify the -f switch, which forces the read (same as when reading into %vars). |
17 1 Per Amundsen
18
*Parameters*
19
20 2 Per Amundsen
table(ktable).
21
|*Parameter*|*Description*|
22
| [numbytes] | Number of bytes to read into &binvar. |
23
| &lt;%var<notextile>|</notextile>&binvar&gt; | %var or &binvar to read the data into. |