National Instruments 320682C Musical Toy Instrument User Manual


 
Formatting and I/O Library Chapter 2
LabWindows/CVI Standard Libraries 2-10 © National Instruments Corporation
Parameter Discussion
Both sourceIndex and targetIndex are zero-based.
You can use this function even when sourceBuffer and targetBuffer overlap.
CopyString
void CopyString (char targetString[], int targetIndex, char *sourceString,
int sourceIndex, int maximum#Bytes);
Purpose
Copies the string starting at position sourceIndex of sourceString to position targetIndex of
targetString until an ASCII NUL is copied or maximum#Bytes bytes have been copied.
Appends an ASCII NUL if no ASCII NUL was copied.
Parameters
Input
targetIndex
integer
Starting position in targetString.
sourceString
string Source buffer.
sourceIndex
integer
Starting position in sourceString.
maximum#Bytes
integer Number of bytes to copy, excluding the ASCII
NUL.
Output
targetString
string Destination buffer.
Return Value
None
Parameter Discussion
Both sourceIndex and targetIndex are zero-based. If you want to use maximum#Bytes to
prevent from writing beyond the end of targetString, make sure that you allow room for the
ASCII NUL. For example, if maximum#Bytes is 40, the destination buffer should contain at
least 41 bytes.
If you do not want to specify a maximum number of bytes to copy, use -1 for maximum#Bytes.
You can use this function even when sourceString and targetString overlap.
Note: The value of maximum#Bytes must not exceed one less than the number of bytes in
the target variable.