Strset Function

Action

Replaces all characters of a string with the character nCharacter.

Include file

Kernel.bdh

Syntax

Strset( inout sString    : string,
        in    nCharacter : number ): string;

Return value

the altered string

Parameter Description
sString String to be overwritten. This parameter will contain the altered string after the Setset operation
nCharacter Defines the character for the operation

Example

dcltrans
  transaction TStrset
  var
    sString, sResult : string;
    nChar            : number;
  begin
    sString := "Hello world!";
    nChar   := ord('*');
    write("string = "); write(sString); writeln;
    write("char   = "); write(chr(nChar)); writeln;

    sResult := Strset(sString, nChar);
    write("string = "); write(sString); writeln;
    write("result = "); write(sResult); writeln;
  end TStrset;

Output

string = Hello world!
char   = *
string = ************
result = ************