SetWideChars Function

Action

Copies a sequence of wide characters to a specified position within a buffer.

Include file

tuxedo.bdh

Syntax

SetWideChars(
   in nBuffer    : number,
   in nStartPos  : number,
   in sSource    : string,
   in nMaxChars  : number,
   in nCharWidth : number,
   in nFillChar  : number optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
nBuffer Address of the destination buffer to which the sequence of wide characters should be copied.
nStartPos Offset within the destination buffer to which the sequence of wide characters should be copied.
sSource Sequence of characters that is to be copied to the destination buffer.
nMaxChars Number of wide characters that should be copied to the destination buffer.
nCharWidth Width of a wide character.
nFillChar Character for filling the rest of the destination buffer (optional). This parameter is relevant if the amount of data you pass to the function is less than the number of wide characters you specify should be copied to the destination buffer.

Example

dcltrans
  transaction TMain
  var
    sSource, sDest, sResult : string;
    i : number;
  begin
    sSource := "Hello world!";
    SetWideChars(Adr(sDest),1, sSource,12,1);
    writeln(sDest);
    SetWideChars(Adr(sDest),1, sSource,12,2);
    sResult := "";
    for i := 1 to 24 do
      if sDest[i] = chr(0) then
        sResult := sResult + "_";
      else
        sResult := sResult + sDest[i];
      end;
    end;    writeln(sResult);
  end TMain;