Hi I would like to write a general method check_range() that gets as parameter raw_type (vin or vout or il etc.) and according to the raw_type call relevant method calc_vin() or calc_vout() etc. I try to use reflection get_method() for it:
type raw_t : [vin, vout, il, iin];
...
extend my_unit {
check_range(raw_type : raw_t) : uint {
var meth_name : string = appendf("calc_%s", raw_type);
var meth : rf_method = me.get_method(meth_name); //This line causes an error
// ....
};
calc_vout() is {
// Calculates Vout
};
};
When I invoke the check_range() method I get the error:
Error: 'me' (of type my_unit_u) does not have 'get_method()' method.
How can I approach the calc_vout() method using reflection get_method()? Really appreciate your help
Aucun commentaire:
Enregistrer un commentaire