Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
You can not call cbTick with its "normal" type from another part of code in a given environment.
that's a point I will try to remember...
Offline
This code is incorrect. The VM will crash :
typeof tmrMain = Timer;;
typeof tmrMainOther = Timer;;
fun cbTick(tmr, pri_param, tupleParams) =
// any code
fun main() =
_showconsole;
_fooS "***********************************";
set tmrMain = _starttimer _channel 100;
set tmrMainOther = _starttimer _channel 500;
_rfltimer tmrMain mkfun3 @cbTick "primary_param" ["secondary_param_3" "secondary_param_2" "secondary_param_1"];
_rfltimer tmrMainOther @cbTick "other_param";
_fooS "***********************************";
0;;
I create two timers, it's ok. But i define the same callback : for the first timer with mkfun3, for the second, without mkfun3.
In the first case, cbTick must have this type : fun [Timer S [S S S]] u0
In the second case, cbTick must have the type : fun [Timer S] u0
In Scol, a function can not have two different types, you can not overload a function.
Offline
About this (to call a function, mkfun, ...), i've written that on the wiki, i've forgotten ...
http://redmine.scolring.org/projects/tu … ct_in_Scol
http://redmine.scolring.org/projects/tu … ion_object
Offline