B
Brett Romero
I have methods such as the following:
void GetA20(somevar)
{
A20 = ONE
}
void GetA30(somevar)
{
A30 = ONE
}
void GetA40(somevar)
{
A40 = ONE
}
I need the three (A20, A30, A40) variables since they are used in XML,
per the receiver's guidelines. I like to create one method, send in
another variable containing the string 20, 30, or 40 and assign to A.
For example:
timeRange = 20;
void GetA(somevar, timeRange)
{
(A + timeRange) = ONE
}
which would mean:
A20 = ONE
The above is an extremely simple scenario. I can use case or if
conditionals but would rather avoid them. Is there a clean way to do
this?
Thanks,
Brett
void GetA20(somevar)
{
A20 = ONE
}
void GetA30(somevar)
{
A30 = ONE
}
void GetA40(somevar)
{
A40 = ONE
}
I need the three (A20, A30, A40) variables since they are used in XML,
per the receiver's guidelines. I like to create one method, send in
another variable containing the string 20, 30, or 40 and assign to A.
For example:
timeRange = 20;
void GetA(somevar, timeRange)
{
(A + timeRange) = ONE
}
which would mean:
A20 = ONE
The above is an extremely simple scenario. I can use case or if
conditionals but would rather avoid them. Is there a clean way to do
this?
Thanks,
Brett