I'm having trouble working out how to pass a type instance as a paramter to a function. Prior to doing this, this is what I achieve right now
; I call the function like this
start_gearchange_timer()
; this is what the function looks like
Function start_gearchange_timer()
player(1)\gearchange_timer = Millisecs()
End Function
...now I have lots of timers, so I don't want to have lots of functins that essentially do the same thing so I wanted a simple function that could be passed paramters to do the same job eg.
;call the NEW function like this
start_timer( paramters eg. player(1)\gearchange_timer )
; the NEW function would look like this
Function start_timer ( paramters )
paramaters = Millisecs()
End Function
Can anyone help ? Hope I explained that ok. Basically I want to know have to pass a custom type variable and its field as a paramter in a function!
; I call the function like this
start_gearchange_timer()
; this is what the function looks like
Function start_gearchange_timer()
player(1)\gearchange_timer = Millisecs()
End Function
...now I have lots of timers, so I don't want to have lots of functins that essentially do the same thing so I wanted a simple function that could be passed paramters to do the same job eg.
;call the NEW function like this
start_timer( paramters eg. player(1)\gearchange_timer )
; the NEW function would look like this
Function start_timer ( paramters )
paramaters = Millisecs()
End Function
Can anyone help ? Hope I explained that ok. Basically I want to know have to pass a custom type variable and its field as a paramter in a function!