Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1 @@
"" var, str

View file

@ -0,0 +1 @@
str @ s:len 0 n:= if ... then

View file

@ -0,0 +1,2 @@
String.isBlank(record.txt_Field__c);
--Returns true if the specified String is white space, empty (''), or null; otherwise, returns false.

View file

@ -0,0 +1,6 @@
""→Str1
!If length(Str1)
Disp "EMPTY",i
Else
Disp "NOT EMPTY",i
End

View file

@ -0,0 +1,17 @@
' FB 1.05.0 Win64
Sub IsEmpty(s As String)
If Len(s) = 0 Then
Print "String is empty"
Else
Print "String is not empty"
End If
End Sub
Dim s As String ' implicitly assigned an empty string
IsEmpty(s)
Dim t As String = "" ' explicitly assigned an empty string
IsEmpty(t)
Dim u As String = "not empty"
IsEmpty(u)
Sleep

View file

@ -0,0 +1,13 @@
include "ConsoleWindow"
dim as Str255 s
s = ""
if s == "" then print "String is empty"
if s[0] == 0 then print "String is empty"
if len(s) == 0 then print "String is empty"
s = "Hello"
if s <> "" then print "String not empty."
if s[0] then print "String not empty."
if len(s) > 0 then print "String not empty."

View file

@ -0,0 +1,11 @@
software {
var s = ""
if len(s) = 0
print("Empty string!")
end
if s != ""
print("Not an empty string!")
end
}

View file

@ -0,0 +1,24 @@
> (set str "")
()
> (length str)
0
> (=:= 0 (length str))
true
> (=:= 0 (length "apple"))
false
> (=:= "apple" "")
false
> (=/= "apple" "")
true
> (=:= str "")
true
> (=:= "apple" '())
false
> (=/= "apple" '())
true
> (=:= str '())
true
> (case str ('() 'empty) ((cons head tail) 'not-empty))
empty
> (case "apple" ('() 'empty) ((cons head tail) 'not-empty))
not-empty

View file

@ -0,0 +1,12 @@
//Demonstrate how to assign an empty string to a variable.
local(str = string)
local(str = '')
//Demonstrate how to check that a string is empty.
#str->size == 0 // true
not #str->size // true
//Demonstrate how to check that a string is not empty.
local(str = 'Hello, World!')
#str->size > 0 // true
#str->size // true

View file

@ -0,0 +1,5 @@
str = EMPTY -- same as: str = ""
put str=EMPTY
-- 1
put str<>EMPTY
-- 0

View file

@ -0,0 +1,5 @@
my_empty_string = "";
% To make sure it is empty, we can ask whether its length is equal to zero. %
#my_empty_string == 0;

View file

@ -0,0 +1,12 @@
var x = ""
if x == "":
echo "empty"
if x != "":
echo "not empty"
# Alternatively:
if x.len == 0:
echo "empty"
if x.len > 0:
echo "not empty"

View file

@ -0,0 +1,2 @@
"" isEmpty
"" isEmpty not

View file

@ -0,0 +1,9 @@
string s
s = "" -- assign an empty string
if length(s)=0 then -- string is empty
if s="" then -- string is empty
if length(s)!=0 then -- string is not empty
if s!="" then -- string is not empty

View file

@ -0,0 +1,6 @@
cStr = NULL # empty string
if cStr = NULL
see "cstr is an empty string!" + nl
else
see "cstr is not empty string!" + nl
ok

View file

@ -0,0 +1,2 @@
var s = "";
var s = String.new;

View file

@ -0,0 +1,5 @@
s == "";
s.length == 0;
s.is_empty;
s ~~ /^\z/;
s ~~ /\A\z/;

View file

@ -0,0 +1,4 @@
s != "";
s.length > 0;
s ~~ /./s;
s !~ /^\z/;

View file

@ -0,0 +1,6 @@
var s = ""
if s.isEmpty { // alternately, s == ""
println("s is empty")
} else {
println("s is not empty")
}

View file

@ -0,0 +1,8 @@
decl string s
set s ""
if (= s "")
out "empty" endl console
else
out "not empty" endl console
end if

View file

@ -0,0 +1 @@
"" as $x

View file

@ -0,0 +1,3 @@
s == ""
# or:
s|length == 0

View file

@ -0,0 +1,3 @@
s != ""
# or:
s.length != 0 # etc.