GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Five — General Functions (continued)
Overview
The BinaryCopySegment function copies a binary segment of data (raw memory) from a specified area of a variable or another specified variable.
Syntax/Parameters
Syntax
int = BinaryCopySegment ( param source, param destination,
[int
s_pos], [int d_pos], [int size] );
Parameters
source
A parameter as literal or variable data or a handle. If a string type is supplied, the zero terminating byte is not included in the size. If a handle, it must be to a Data Object.
destination
A parameter as a variable or a handle. The binary content of which will be altered. If a handle, it must be to a Data Object.
s_pos
An optional int specifying the zero-based position in bytes to copy from source. If omitted, the value is 0.
d_pos
An optional int specifying the zero-based position in bytes to copy to dest. If omitted, the value is 0.
size
An optional int specifying the size of of the data to copy in bytes. If omitted, the available size of destination is used. Note that if a string type is used as the destination parameter, the size of the current string content will be used, less the zero terminator.
Return Value
Returns an int as ERROR_NONE on success or a formatted error code on failure.
Remarks
If source and destination are the same variable, BinaryCopySegment will compensate for the overlap. The function will not allow data to be copied from or to an area outside the scope of the specified variable.
When a string or wstring is a source or a destination, the size is calculated by using an internal string length function. For the source, this can make running off the end of the string easy, even as it is allocated to larger buffer than the length of the string. For the destination, the size should be specified to avoid the function stopping as a result of a buffer overrun.
BinaryCopySegment differs from BinaryPutSegment in that data can be copied within a variable and it works strictly with variables.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.