Project

General

Profile

$bvar » History » Version 9

Per Amundsen, 01/05/2019 12:19 PM

1 1 Per Amundsen
_Added in 1.9.0_
2
3
*$bvar(&binvar,N,M)*
4
5 2 Per Amundsen
Returns M "ASCII":http://www.asciitable.com/ values from a &binvar starting from the Nth byte.
6 1 Per Amundsen
7 6 Per Amundsen
_N-N2 can be used to get a range of ASCII values._
8
_N- can be used to get all ASCII values from position N._
9
10 1 Per Amundsen
*Parameters*
11
12
&binvar - The &binvar to use.
13
N - Position to start retrieving bytes.
14
M - Numbers of bytes to get.
15
16
*Properties*
17
18 2 Per Amundsen
.text - Returns plain text instead of "ASCII":http://www.asciitable.com/ values.
19 9 Per Amundsen
.word - Outputs decimal value of a 2-byte word, seeing bytes in little-endian byte order (low value first, (unsigned 16 bit)
20
.nword - Outputs decimal value of a 2-byte word, seeing bytes in big-endian byte order (high value first, unsigned 16 bit)
21
.long - Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in little-endian byte order (low value first, unsigned 32 bit)
22
.nlong - Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in big-endian byte order (high value first. unsigned 32 bit)
23
.sword - Outputs decimal value of a 2-byte word, seeing bytes in little-endian byte order (low value first, signed 16 bit, AdiIRC only)
24
.nsword - Outputs decimal value of a 2-byte word, seeing bytes in big-endian byte order (high value first, signed 16 bit, AdiIRC only)
25
.slong - Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in little-endian byte order (low value first, signed 32 bit, AdiIRC only)
26
.nslong - Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in big-endian byte order (high value first. signed 32 bit AdiIRC only)
27
.uint64 - Outputs decimal value of a 8-byte dword (unsigned long), seeing bytes in little-endian byte order (low value first, unsigned 64 bit AdiIRC only)
28
.nuint64 - Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in big-endian byte order (high value first. unsigned 64 bit AdiIRC only)
29
.sint64 - Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in little-endian byte order (low value first, signed 64 bit, AdiIRC only)
30
.nsint64 - Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in big-endian byte order (high value first. signed 64 bit AdiIRC only)
31 1 Per Amundsen
32
*Example*
33
34
<pre>
35 3 Per Amundsen
; Returns the length of the binary variable.
36 1 Per Amundsen
//echo -ag $bvar(&binvar,0)        
37
38 4 Per Amundsen
; Returns ASCII value at position N.
39 1 Per Amundsen
//echo -ag $bvar(&binvar,1)
40 4 Per Amundsen
41 1 Per Amundsen
; Returns ASCII values from 5 to 8.
42 6 Per Amundsen
//echo -ag $bvar(&binvar,5,3)
43
44
; Returns ASCII values from 5 to end.
45
//echo -ag $bvar(&binvar,5-)
46 1 Per Amundsen
47 3 Per Amundsen
; Returns plain text from 5 to 8 up to the first zero character.
48 1 Per Amundsen
//echo -ag $bvar(&binvar,5,3).text
49 5 Per Amundsen
50
; Returns &binvar if the binvar exists.
51
//echo -ag $bvar(&binvar)
52 1 Per Amundsen
</pre>