Hello
I have a class that manages the setup of my application, I wrote it
because my application needs a lot of setup parameters (it makes
electrical measures on different input channels and each channel has
many parameters). To avoid the creation of a setup page with hundreds
of parameters (or more pages because the parameter types are not
always the same for each channel), I wrote a class that stores and
retrieves this parameters in the registry. It shows the defined
parameters sorted by group and by name in a form so the user can found
quickly the parameters that he wants to change. I want to store new
value of the parameter in the registry and in the variable used in the
program. So I would avoid to write code like this:
If (ParameterVoice = 1) Then
Variable1 = "new value"
elseif (ParameterVoice = 2) Then
Variable2 = "new value"
.......
elseif (ParameterVoice = 250) Then
Variable250 = "new value"
endif
I would save the pointer of the variable linked to each parameter in
an internal structure of this class when I define the parameter, then
store the new values of the variables when the user changes the
relative voices in the setup
The goal of this class is to be generic and reusable in future
projects, I hope this will be possible without write 250 IFs....
Can I do this?
Thanks
Gianco
|