Project

General

Profile

$bvar » History » Version 6

Per Amundsen, 02/25/2017 04: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
&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 1 Per Amundsen
.word - TODO
20
.nword - TODO
21
.long - TODO
22
.nlong - TODO
23
24
*Example*
25
26
<pre>
27 3 Per Amundsen
; Returns the length of the binary variable.
28 1 Per Amundsen
//echo -ag $bvar(&binvar,0)        
29
30 4 Per Amundsen
; Returns ASCII value at position N.
31 1 Per Amundsen
//echo -ag $bvar(&binvar,1)
32 4 Per Amundsen
33 1 Per Amundsen
; Returns ASCII values from 5 to 8.
34 6 Per Amundsen
//echo -ag $bvar(&binvar,5,3)
35
36
; Returns ASCII values from 5 to end.
37
//echo -ag $bvar(&binvar,5-)
38 1 Per Amundsen
39 3 Per Amundsen
; Returns plain text from 5 to 8 up to the first zero character.
40 1 Per Amundsen
//echo -ag $bvar(&binvar,5,3).text
41 5 Per Amundsen
42
; Returns &binvar if the binvar exists.
43
//echo -ag $bvar(&binvar)
44 1 Per Amundsen
</pre>