String prepend: Difference between revisions
simplify →Pascal
No edit summary |
(simplify →Pascal) |
||
Line 862:
String prepend
</pre>
Free Pascal supports everything shown in [[#Pascal|§ Pascal]] (except the <tt>string</tt> schema data type, <tt>string(20)</tt> must be written like here).
Furthermore, using the compiler directive <tt>{$COperators}</tt> the following is possible, too:
<lang delphi>var
line: string[20];
begin
line := 'Hello ';
{$COperators on}
line += 'world!';
writeLn(line)
end.</lang>
=={{header|Gambas}}==
Line 1,197 ⟶ 1,209:
=={{header|Pascal}}==
''See also [[#Free Pascal|Free Pascal]]''
{{works with|Extended Pascal}}
<lang pascal>program stringPrepend(output);
▲{{works with|Free Pascal|2.6.2}}
var
line: string(20);
begin
line := line + 'world!';
writeLn(line);
line := 'Hello ';
writeStr(line, line, 'world!');
writeLn(line)
end.</lang>
{{out}}
<pre>Hello
Hello world!</pre>
=={{header|Perl}}==
|