Scol standard library package
0.3.1
Common and usefull functions for all Scol applications
|
Functions | |
std_tabClear (tab) | |
Clear all values of a table to nil. More... | |
std_tabCmp (tab, index, value) | |
Compare a value of an index with a given value. All types are supported except S (string). For the last case,. More... | |
std_tabCmpStr (tab, index, string) | |
Compare a string of an index with a given string. More... | |
std_tabCmpUntil (tab1, tab2, from, len) | |
Compare all values from an index until a lenght between two tables. The first index is always 0 in a table. All types are supported except S (string). For the last case,. More... | |
std_tabCmpUntilStr (tab1, tab2, from, len) | |
Compare all strings from an index until a lenght between two tables. Function case-sensitive. The first index is always 0 in a table. More... | |
std_tabCmpUntilStri (tab1, tab2, from, len) | |
Compare all strings from an index until a lenght between two tables. Function case-insensitive. The first index is always 0 in a table. More... | |
std_tabCopy (tab, size) | |
Copy values of a table in a new table If the size of the table is smaller than the size of the new table, all other indexes are nil. More... | |
std_tabCreate (size, f, x) | |
Create an array and fill it. More... | |
std_tabFind (tab, value, from) | |
Searches a value in a table from a position. To find all results, this function can be called from a loop/recursive function. The first index is always 0 in a table. All types are supported except S (string). For the last case,. More... | |
std_tabFindStr (tab, str, from) | |
Searches a string in a table from a position. To find all results, this function can be called from a loop/recursive function. The first index is always 0 in a table. More... | |
std_tabFindStri (tab, str, from) | |
Searches a string in a table from a position. To find all results, this function can be called from a loop/recursive function. The first index is always 0 in a table. More... | |
std_tabGet (tab, index) | |
Get the appropriate value to an index. The function verify if the index is not out of range. More... | |
std_tabReset (tab, f, x) | |
Reset all values of a table. More... | |
std_tabSet (tab, index, value) | |
Set the value to an index. The function verify if the index is not out of range. More... | |
Package to load : lib/std/tab.pkg
std_tabCreate | ( | size | , |
f | , | ||
x | |||
) |
Create an array and fill it.
Prototype: fun [I fun [I u0] u1 u0] tab u1
I | : the size of the array |
fun | [I u0] u1 : function called to fill each element (the integer is the index) |
u0 | : an user parameter to fill the array |
std_tabGet | ( | tab | , |
index | |||
) |
Get the appropriate value to an index. The function verify if the index is not out of range.
Prototype: fun [tab u0 I] u0
tab | u0 : a table |
I | : an index |
std_tabSet | ( | tab | , |
index | , | ||
value | |||
) |
Set the value to an index. The function verify if the index is not out of range.
Prototype: fun [tab u0 I u0] u0
tab | u0 : a table |
I | : an index |
u0 | : the value |
std_tabCmp | ( | tab | , |
index | , | ||
value | |||
) |
Compare a value of an index with a given value. All types are supported except S (string). For the last case,.
Prototype: fun [tab u0 I u0] I
tab | u0 : a table |
I | : an index |
u0 | : the value to compare |
std_tabCmpStr | ( | tab | , |
index | , | ||
string | |||
) |
Compare a string of an index with a given string.
Prototype: fun [tab S I S] I
tab | S : a table |
I | : an index |
S | : the value to compare |
std_tabCmpUntil | ( | tab1 | , |
tab2 | , | ||
from | , | ||
len | |||
) |
Compare all values from an index until a lenght between two tables. The first index is always 0 in a table. All types are supported except S (string). For the last case,.
Prototype: fun [tab u0 tab u0 I I] I
tab | u0 : a table |
tab | u0 : another table |
I | : an index to start |
I | : a length to the end |
std_tabCmpUntilStr | ( | tab1 | , |
tab2 | , | ||
from | , | ||
len | |||
) |
Compare all strings from an index until a lenght between two tables. Function case-sensitive. The first index is always 0 in a table.
Prototype: fun [tab S tab S I I] I
tab | S : a table |
tab | S : another table |
I | : an index to start |
I | : a length to the end |
std_tabCmpUntilStri | ( | tab1 | , |
tab2 | , | ||
from | , | ||
len | |||
) |
Compare all strings from an index until a lenght between two tables. Function case-insensitive. The first index is always 0 in a table.
Prototype: fun [tab S tab S I I] I
tab | S : a table |
tab | S : another table |
I | : an index to start |
I | : a length to the end |
std_tabFind | ( | tab | , |
value | , | ||
from | |||
) |
Searches a value in a table from a position. To find all results, this function can be called from a loop/recursive function. The first index is always 0 in a table. All types are supported except S (string). For the last case,.
Prototype: fun [tab u0 u0 I] I
tab | u0 : a table |
u0 | : a value to find |
I | : an index to start |
std_tabFindStr | ( | tab | , |
str | , | ||
from | |||
) |
Searches a string in a table from a position. To find all results, this function can be called from a loop/recursive function. The first index is always 0 in a table.
Prototype: fun [tab S S I] I
tab | S : a table |
S | : a value to find |
I | : an index to start |
std_tabFindStri | ( | tab | , |
str | , | ||
from | |||
) |
Searches a string in a table from a position. To find all results, this function can be called from a loop/recursive function. The first index is always 0 in a table.
Prototype: fun [tab S S I] I
tab | S : a table |
S | : a value to find |
I | : an index to start |
std_tabClear | ( | tab | ) |
Clear all values of a table to nil.
Prototype: fun [tab u0] tab u0
std_tabReset | ( | tab | , |
f | , | ||
x | |||
) |
Reset all values of a table.
Prototype: fun [tab u1 fun [I u0] u1 u0] tab u1
tab | u1 : a table already created |
fun | [I u0] u1 : function called to fill each element (the integer is the index) |
u0 | : an user parameter to fill the array |
std_tabCopy | ( | tab | , |
size | |||
) |
Copy values of a table in a new table If the size of the table is smaller than the size of the new table, all other indexes are nil.
Prototype: fun [tab u0 I] tab u0
tab | u0 : a table already created |
I | : the size of the new table |