From Clomosy Docs

Revision as of 18:39, 12 February 2024 by ClomosyManager (talk | contribs)

function Copy(Source string; StartChar, Count Integer):string;

The copy function provides copying of a value. Creates a new array from part of an existing array.

String copy:

The index of the first character of a string is = 1. Count characters are copied from the StartChar of the Source string to the returned string. Less than Count characters if the end of the Source string is encountered before the Count characters are copied.

Example:

Base Syntax
 var
   Source, Target : string;
 
 begin
   Source := '12345678';
   Target := Copy(Source, 3, 4);
   ShowMessage('Target : '+Target);
 end;
TRObject Syntax
 var
   Source, Target : string;
 
 {
   Source = '12345678';
   Target = Copy(Source, 3, 4);
   ShowMessage('Target : '+Target);
 }

Output:

Target : 3456