This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathbyteOffset.lcdoc
More file actions
69 lines (47 loc) · 2.21 KB
/
byteOffset.lcdoc
File metadata and controls
69 lines (47 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Name: byteOffset
Type: function
Syntax: byteOffset(<bytesToFind>,<binaryStringToSearch> [,<bytesToSkip>])
Summary:
<return|Returns> the <byte> position of the first occourence of the
specified string of <binary data> within container of <binary data>.
Introduced: 7.0
OS: mac, windows, linux, ios, android
Platforms: desktop, server, mobile
Example:
byteOffset("c","abcde") -- returns 3
Example:
byteOffset("b","abacadabra",2) -- returns 6
Example:
byteOffset("bark","embarking") -- returns 3
Example:
byteOffset(null & numberToByte(255),"End" & null & numberToByte(255)) -- returns 4
Parameters:
bytesToFind (data): a string of <binary data> to find
binaryStringToSearch (data): a container with <binary data>
bytesToSkip:
A non-negative integer. If you don't specify how many <bytesToSkip>, the
<byteOffset> <function> does not skip any bytes and starts at the beginning of
the <binaryStringToSearch>.
Returns:
The <byteOffset> <function> <return|returns> a <non-negative> <integer>.
Description:
Use the <byteOffset> <function> to find where a string of <binary data>
occurs within a container of <binary data>.
The value returned by the <byteOffset> <function> is the number of the
<bytes> where <bytesToFind> appears in <binaryStringToSearch>. If the
<bytessToFind> is not in <binaryStringToSearch>, the <byteOffset> <function>
<return|returns> zero.
If the <bytesToFind> contains more than one <byte>, and the entire
<bytesToFind> appears in the <bytesToSearch>, the <byteOffset> <function>
<return|returns> the <byte> number where the <bytesToFind> starts.
If you specify how many <bytesToSkip>, the <byteOffset> <function> skips the
specified number of <bytes> in the <binaryStringToSearch>. The <value>
<return|returned> is relative to this starting <point> instead of the
beginning of the <binaryStringToSearch>.
References: find (command), sort container (command),
function (control structure), offset (function), wordOffset (function),
itemOffset (function), lineOffset (function), length (function),
value (function), binary data (glossary), return (glossary),
non-negative (glossary), character (keyword), characters (keyword),
integer (keyword), string (keyword), point (keyword), begins with (operator)
Tags: data processing