CopyBytes

InstallShield 2014 ยป InstallScript Language Reference

The CopyBytes function copies a specified number of bytes from one string to another string. You can specify the offset indices into the source and destination strings. CopyBytes is useful for working with binary files.

Syntax

CopyBytes ( svDest, nIndexDest, svSrc, nIndexSrc, nCount );

Parameters

CopyBytes Parameters

Parameter

Description

svDest

Specifies the destination string.

nIndexDest

Specifies the offset index (starting point) in the destination string at which location the bytes are to be inserted. The first byte in the string is at position 0.

svSrc

Specifies the source string. Do not pass an autosized string whose size is greater than 256 characters. Instead, declare the string with an explicit size. For more information about string sizing, see String Size and Autosize.

nIndexSrc

Specifies the offset index (starting point) in the source string at which location bytes begin to be copied. The first byte in the string is at position 0.

nCount

Specifies the total number of bytes you want to copy from svSrc to svDest. This value must be no larger than the size of svSrc - 1. For example, if svSrc was declared with a size of 512 (giving it a maximum string length of 511), then the value passed in nCount must be 511 or less.

Return Values

CopyBytes Return Values

Return Value

Description

0

CopyBytes successfully copied a specified number of bytes from one string to another.

< 0

CopyBytes was unable to copy the bytes.

See Also