(I'm just thinking out loud here.)

I am at a little bit of an impasse with a rewrite of one of our libraries in
which all but one of the parameters are optional and so it makes defining
the order of parameters tough. (Using defaults aleviates the pain only
partly) This got me into thinking how I can emulate named parameters in
Active4D. The route I am thinking of came from structs in C.

The route I am thinking of taking is using a Local Collection and the
fantastic new syntax for addressing the Collection.

`##############################
My_Method($in_param)
    $t_local_var1:=$in_param{"param1"}
    `Do Stuff with these vars
end method

$param_struct:=new collection

$param_struct{"param1"}:="Data1"
$param_struct{"param2"}:="Data2"
$param_struct{"param3"}:="Data3"

My_Method($param_struct)

`##############################

What do you think? Have I missed a better solution to this problem?

All the best

Michael Bond



Reply via email to