Project

General

Profile

$bvar » History » Version 13

Per Amundsen, 02/16/2023 09:09 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 13 Per Amundsen
table(ktable).
13
|*Parameter*|*Description*|
14
| &binvar | The &binvar to use. |
15
| N | Position to start retrieving bytes. |
16
| M | Numbers of bytes to get. |
17 1 Per Amundsen
18
*Properties*
19
20 13 Per Amundsen
table(ktable).
21
|*Property*|*Description*|
22
| .text | Returns plain text instead of "ASCII":http://www.asciitable.com/ values. |
23
| .word | Outputs decimal value of a 2-byte word, seeing bytes in little-endian byte order (low value first, (unsigned 16 bit) |
24
| .nword | Outputs decimal value of a 2-byte word, seeing bytes in big-endian byte order (high value first, unsigned 16 bit) |
25
| .sword | Outputs decimal value of a 2-byte word, seeing bytes in little-endian byte order (low value first, signed 16 bit, *AdiIRC only*) |
26
| .nsword | Outputs decimal value of a 2-byte word, seeing bytes in big-endian byte order (high value first, signed 16 bit, *AdiIRC only*) |
27
| .long | Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in little-endian byte order (low value first, unsigned 32 bit) |
28
| .nlong | Outputs decimal value of a 4-byte dword (unsigned long), seeing bytes in big-endian byte order (high value first. unsigned 32 bit) |
29
| .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*) |
30
| .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*) |
31
| .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*) |
32
| .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*) |
33
| .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*) |
34
| .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*) |
35 1 Per Amundsen
36
*Example*
37
38
<pre>
39 3 Per Amundsen
; Returns the length of the binary variable.
40 1 Per Amundsen
//echo -ag $bvar(&binvar,0)        
41
42 4 Per Amundsen
; Returns ASCII value at position N.
43 1 Per Amundsen
//echo -ag $bvar(&binvar,1)
44 4 Per Amundsen
45 1 Per Amundsen
; Returns ASCII values from 5 to 8.
46 6 Per Amundsen
//echo -ag $bvar(&binvar,5,3)
47
48
; Returns ASCII values from 5 to end.
49
//echo -ag $bvar(&binvar,5-)
50 1 Per Amundsen
51 3 Per Amundsen
; Returns plain text from 5 to 8 up to the first zero character.
52 1 Per Amundsen
//echo -ag $bvar(&binvar,5,3).text
53 5 Per Amundsen
54
; Returns &binvar if the binvar exists.
55
//echo -ag $bvar(&binvar)
56 1 Per Amundsen
</pre>