Up |
tabcmpS
Compare two strings arrays. The two arrays can have differents sizes. This
function compare the string of each index while this value is the same between the
two arrays.
The return value is the last same index.
Example :
"France" | "Italy" | "China" | "Chile" | "Egypt" | "Iceland" | "Canada"
array 1
"France" | "Italy" | "China" | "Chile" | "Russia" | "USA" | "Sweden" | "Swiss"
array 2
the return value between array 1 and array 2 is 3 ("France" = "France", "Italy" = "Italy", "China" = "China", "Chile" = "Chile" but "Egypt" != "Russia")
Prototype :
fun [tab S tab S] I
- tab S : a string array
- tab S : another string array
Return : I the last same index, nil if the first index (0) is already different.
See also
Example
fun main ()=
_showconsole;
let mktab 3 nil -> t in
let mktab 4 nil -> T in
(
set t.0 = set T.0 = "France";
set t.1 = set T.1 = "Italy";
set t.2 = "German";
set T.2 = "Spain";
set T.3 = "Greece";
_fooId tabcmpS t T; // 1
);
0;;
Note
Don't forget that the first index is 0, not 1 !