- ago
Most of the example code i have seen does something like this:

CODE:
AddParameter(...) ... int foo = Parameters[0].AsInt;


However, accessing parameters by index is error prone, as you have to keep track of the index used if you add more parameters or change the order.

Is it possible to do something like this instead?

CODE:
Parameter myParam = AddParameter(...) ... int foo = myParam.AsInt;


I tried this and while it compiles fine, the value of foo in this example is not as expected. Using Parameters[index] works as expected.
0
365
Solved
2 Replies

Reply

Bookmark

Sort
- ago
#1
The "ParameterList" collection allows to access the values by parameter name i.e. FindByOptParamName:
https://www.wealth-lab.com/Support/ApiReference/ParameterList
1
Best Answer
Cone8
 ( 24.80% )
- ago
#2
QUOTE:
I tried this and while it compiles fine, the value of foo in this example is not as expected. Using Parameters[index] works as expected.
Do you have a full example of when it doesn't work? I've just done this about 200 times (not kidding) and haven't had a problem.
0

Reply

Bookmark

Sort