STARGÅTE wrote:oke, you will not a realtime base, but a frame base.
And you will "define" your procedures before.
Here your code:
if you need more parameters, define it in Prototype and RegisterTask and in the "; execute task"-Line
That's it!! Thank you
that is exactly what I ment!!
Let us yet see if I've understood everything clearly... If we have more procedures with different number of parameters, we have to declare all of them in the prototype and to pass
#false for the parameters which the procedure doesn't use? For example, if the procedures are declared like this:
Code: Select all
Procedure create_explosion(type.b, x.w, y.w, vx.b, vy.b, anim_speed.b) ; 6 parameters
;something
EndProcedure
Procedure create_new_enemies(enemy_ID.b, number.b, formation_type.b, AI_level.b) ; 4 parameters
;something
EndProcedure
we would declare a prototype similar to:
Code: Select all
Prototype.i TaskFunction(param_1.w, param_2.w, param_3.w, param_4.w, param_5.w, param_6.w) ; 6 parameters
so it could handle both of the procedures (
word is to handle both
word and
byte)?
What if one or more of the procedures would need one or more
float parameters? Would we then be forced to declare all parameters as
float and use type casting?
It's not really necessary, but is there a way to handle the more complicated situation, for example if we would have these procedures:
Code: Select all
Procedure create_explosion(type.b, x.w, y.w, vx.b, vy.b, anim_speed.b) ; 6 parameters
;something
EndProcedure
Procedure create_new_enemies(enemy_ID.b, number.b, formation_type.b, AI_level.b) ; 4 parameters
;something
EndProcedure
Procedure display_data(Data.d, command_ID.b) ; double
;something
EndProcedure
Procedure delayed_message(output_screen_ID.b, message.s) ; string
;something
EndProcedure