Overwrites the beginning of a string with nCount characters.
Kernel.bdh
Strnset( inout sString : string, in nCharacter : number, in nCount : number ): string;
the altered string
Parameter | Description |
---|---|
sString | String to be overwritten. This parameter will contain the altered string after the Strnset operation |
nCharacter | Defines a character that the function uses to overwrite a section of sString |
nCount | Defines the number of characters to overwrite in sString |
dcltrans transaction TStrnset var sString, sResult : string; nChar : number; begin sString := "Hello world!"; nChar := ord('*'); write("string = "); write(sString); writeln; write("char = "); write(chr(nChar)); writeln; sResult := Strnset(sString, nChar, 5); write("result = "); write(sResult); writeln; end TStrnset;
string = Hello world! char = * result = ***** world!