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,20 @@
' FB 1.05.0 Win64
Dim i As Integer
Dim l As Long
Dim s As Short
Dim b As Byte
Print "An integer occupies "; SizeOf(i); " bytes"
Print "A long occupies "; SizeOf(l); " bytes"
Print "A short occupies "; SizeOf(s); " bytes"
Print "A byte occupies "; SizeOf(b); " byte"
' or use type directly rather than a variable
Print "A boolean occupies "; SizeOf(Boolean); " byte"
Print "A single occupies "; SizeOf(Single); " bytes"
Print "A double occupies "; SizeOf(Double); " bytes"
Print
Print "Press any key to quit"
Sleep

View file

@ -0,0 +1,22 @@
local(
mystring = 'Hello World',
myarray = array('one', 'two', 3),
myinteger = 1234
)
// size of a string will be a character count
#mystring -> size
'<br />'
// size of an array or map will be a count of elements
#myarray -> size
'<br />'
// elements within an array can report size
#myarray -> get(2) -> size
'<br />'
// integers or decimals does not have sizes
//#myinteger -> size // will fail
// an integer can however be converted to a string first
string(#myinteger) -> size

View file

@ -0,0 +1 @@
echo "An int contains ", sizeof(int), " bytes."

View file

@ -0,0 +1,11 @@
list1 = list(2)
list2 = list(4)
list3 = list(6)
list4 = list(7)
list5 = list(5)
see "Size of list1 is : " + len(list1) + nl
see "Size of list2 is : " + len(list2) + nl
see "Size of list3 is : " + len(list3) + nl
see "Size of list4 is : " + len(list4) + nl
see "Size of list5 is : " + len(list5) + nl

View file

@ -0,0 +1 @@
sizeofValue(x)

View file

@ -0,0 +1,9 @@
// sizeof and sizeofValue return the size in bytes.
println(sizeof(Int))
var i: Int = 42
println(sizeofValue(i))
// The size returned is that of the top level value and does not
// include any referenced data. A type like String always returns
// the same number, the size of the String struct.
println(sizeofValue("Rosetta"))
println(sizeofValue("Code"))}