Casting - the general case etc.
Posted: Sun Nov 19, 2017 2:26 pm
Hi Robert, Chris and Team,
I have a small problem / issue and need some help please.
I wish to be able to write code so that a cast I make can be done in a general way and not by me typing a specific class name / type. The attached very small image will help explain what I am after.
In line 114 I wish to provide a variable name and not 'Double' - as in the end I am to make some very general code where the Type comes in as a parameter, or Generic type.
I seem to have tried most things with Type and typeof() and GetType() etc., but have not coded as yet in a Generic fashion.
What is the correct and proper way to do this ?
HELP !!! please,
Phil.
I have a small problem / issue and need some help please.
I wish to be able to write code so that a cast I make can be done in a general way and not by me typing a specific class name / type. The attached very small image will help explain what I am after.
In line 114 I wish to provide a variable name and not 'Double' - as in the end I am to make some very general code where the Type comes in as a parameter, or Generic type.
I seem to have tried most things with Type and typeof() and GetType() etc., but have not coded as yet in a Generic fashion.
What is the correct and proper way to do this ?
HELP !!! please,
Phil.