Copies a string at a specified position into a string.
Kernel.bdh
SetString( inout sDest : string, in nPosition : number, in sSource : string, in nMaxLen : number optional, in sFillChar : string optional ):boolean;
true if successful
false if string to copy terminated or failure
Parameter | Description |
---|---|
sDest | Identifies the destination string |
nPosition | Specifies the position to copy to in aSrcString, where the first position in a string is 1 (not 0) |
sSource | Identifies the string to copy |
nMaxLen | Maximum number of characters to copy (optional). If this parameter is omitted, the whole source string is copied to the destination string |
sFillChar | Specifies a character sequence used to fill the remaining bytes if the copied string is shorter than nMaxLen (optional). If this parameter is passed to the function, no NULL termination is inserted into the destination string |
dcltrans transaction TSetString const SIZE_STRUCT := 32; var myBDLstring : string(SIZE_STRUCT); sString, sDest : string; begin // Copy a string from sString into myBDLstring starting // at position 22 and thereby (through mapping)set // the element myString in Struct1 sString := "Holidays"; SetString(myBDLstring, 22, sString); SetString(sDest, 1, sString, 20, "_"); write(sDest); end TSetString;
Holidays____________