Project

General

Profile

$bvar » History » Version 12

Paul Janson, 04/09/2022 04:45 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 11 Per Amundsen
.sword - Outputs decimal value of a 2-byte word, seeing bytes in little-endian byte order (low value first, signed 16 bit, *AdiIRC only*)
22
.nsword - Outputs decimal value of a 2-byte word, seeing bytes in big-endian byte order (high value first, signed 16 bit, *AdiIRC only*)
23 10 Per Amundsen
24
.long - Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in little-endian byte order (low value first, unsigned 32 bit)
25
.nlong - Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in big-endian byte order (high value first. unsigned 32 bit)
26 11 Per Amundsen
.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*)
27
.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*)
28 10 Per Amundsen
29 12 Paul Janson
.uint64 - Outputs decimal value of an 8-byte qword (unsigned long), seeing bytes in little-endian byte order (low value first, unsigned 64 bit *AdiIRC only*)
30
.nuint64 - Outputs decimal value of an 8-byte qword (unsigned long), seeing bytes in big-endian byte order (high value first. unsigned 64 bit *AdiIRC only*)
31
.sint64 - Outputs decimal value of an 8-byte qword (unsigned long), seeing bytes in little-endian byte order (low value first, signed 64 bit, *AdiIRC only*)
32
.nsint64 - Outputs decimal value of an 8-byte qword (unsigned long), seeing bytes in big-endian byte order (high value first. signed 64 bit *AdiIRC only*)
33 1 Per Amundsen
34
*Example*
35
36
<pre>
37 3 Per Amundsen
; Returns the length of the binary variable.
38 1 Per Amundsen
//echo -ag $bvar(&binvar,0)        
39
40 4 Per Amundsen
; Returns ASCII value at position N.
41 1 Per Amundsen
//echo -ag $bvar(&binvar,1)
42 4 Per Amundsen
43 1 Per Amundsen
; Returns ASCII values from 5 to 8.
44 6 Per Amundsen
//echo -ag $bvar(&binvar,5,3)
45
46
; Returns ASCII values from 5 to end.
47
//echo -ag $bvar(&binvar,5-)
48 1 Per Amundsen
49 3 Per Amundsen
; Returns plain text from 5 to 8 up to the first zero character.
50 1 Per Amundsen
//echo -ag $bvar(&binvar,5,3).text
51 5 Per Amundsen
52
; Returns &binvar if the binvar exists.
53
//echo -ag $bvar(&binvar)
54 1 Per Amundsen
</pre>