Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
6
Task/Optional-parameters/Phix/optional-parameters-1.phix
Normal file
6
Task/Optional-parameters/Phix/optional-parameters-1.phix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
function increment(integer i, integer inc=1)
|
||||
return i+inc
|
||||
end function
|
||||
|
||||
?increment(5) -- shows 6
|
||||
?increment(5,2) -- shows 7
|
||||
1
Task/Optional-parameters/Phix/optional-parameters-2.phix
Normal file
1
Task/Optional-parameters/Phix/optional-parameters-2.phix
Normal file
|
|
@ -0,0 +1 @@
|
|||
printf(1,"%d records sorted in %3.2s\n",{records,time()-t0})
|
||||
22
Task/Optional-parameters/Phix/optional-parameters-3.phix
Normal file
22
Task/Optional-parameters/Phix/optional-parameters-3.phix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
integer sortcol = 0
|
||||
integer sortdir = 1
|
||||
|
||||
function by_column(integer i, integer j)
|
||||
return sortdir*compare(data[i][sortcol],data[j][sortcol])
|
||||
end function
|
||||
|
||||
sequence tags = tagset(table_size) -- {1,2,..table_size}
|
||||
|
||||
function click_cb(Ihandle self, integer l, integer c, atom pStatus)
|
||||
string sortc
|
||||
...
|
||||
sortc = sprintf("SORTSIGN%d",c)
|
||||
sortdir = iff(IupGetAttribute(self,sortc)="DOWN"?-1:1)
|
||||
IupSetAttribute(self,sortc,iff(sortdir=-1?"UP":"DOWN"))
|
||||
sortcol = c
|
||||
tags = custom_sort(routine_id("by_column"),tags)
|
||||
|
||||
function value_cb(Ihandle /*self*/, integer l, integer c)
|
||||
l = tags[l]
|
||||
return data[l][c]
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue