June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -4,4 +4,5 @@ Create another string variable whose value is the original variable concatenated
To illustrate the operation, show the content of the variables.
;Tasks featuring Strings:
{{Template:Strings}}

View file

@ -0,0 +1,13 @@
REPORT string_concatenation.
DATA(var1) = 'Hello'.
DATA(var2) = 'Literal'.
cl_demo_output=>new(
)->begin_section( 'String concatenation using |{ }|'
)->write( 'Statement: |{ var1 } { var2 }|'
)->write( |{ var1 } { var2 }|
)->begin_section( 'String concatenation with new string'
)->write( 'Statement: |{ var1 } world!|'
)->write( |{ var1 } world!|
)->display( ).

View file

@ -0,0 +1,7 @@
/* created by Aykayayciti Earl Lamont Montgomery
April 9th, 2018 */
s = "critical"
> s + " literal"
s2 = s + " literal"
> s2

View file

@ -0,0 +1,9 @@
my $s = 'hello';
say $s ~ ' literal';
my $s1 = $s ~ ' literal';
say $s1;
# or, using mutating concatenation:
$s ~= ' literal';
say $s;

View file

@ -0,0 +1,6 @@
>>str1: "Hello"
>>str2: append str1 " World"
>> print str2
Hello World
>> print str1
Hello World

View file

@ -0,0 +1,14 @@
TEXT PROCEDURE concatenate(head, tail);
TEXT head, tail;
BEGIN TEXT c;
c :- blanks(head.length + tail.length);
c.sub(c.start, head.length) := head; ! putText(), anyone?;
c.sub(c.start + head.length, tail.length) := tail;
concatenate:- c;
END;
TEXT stringVariable, another;
stringVariable :- "head ";
another :- concatenate(stringVariable, "and tail");
OutText("stringVariable: """); OutText(stringVariable);
OutText(""", another: "); OutText(another); Outimage;

View file

@ -0,0 +1,5 @@
sca a = "foo"
sca b = "bar"
sca c = a+b
di c
foobar

View file

@ -0,0 +1,5 @@
a = "foo"
b = "bar"
c = a+b
c
foobar

View file

@ -0,0 +1,11 @@
Option Explicit
Sub String_Concatenation()
Dim str1 As String, str2 As String
str1 = "Rosetta"
Debug.Print str1
Debug.Print str1 & " code!"
str2 = str1 & " code..."
Debug.Print str2 & " based on concatenation of : " & str1 & " and code..."
End Sub