Adding variable to namemapping
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2018
06:19 AM
02-16-2018
06:19 AM
Adding variable to namemapping
Hi All
I am passing the parameters in the function and use that in the namemapping. Val1 is working but when using val2 its not getting the value from that property. Is this the correct way to Concat( Highlighted in red) ?
function FXConnectBookedDataFwdClientAllIn(val1,val2)
{
val1= aqConvert.VarToInt(val1);
var val = vGetPropertyVal(WGrd_NetDataGrid.Items.Item(0).Forwards.Item(0).Item(val1)+"."+val2,'Value')
return val
}
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2018
06:41 AM
02-16-2018
06:41 AM
val2 in your code example will not be evaluated so that it's value will be part of the object itself. You need to evaluate the object first. See the code below. EDIT: found a slight typo.
function FXConnectBookedDataFwdClientAllIn(val1,val2) { val1= aqConvert.VarToInt(val1); var object = eval('WGrd_NetDataGrid.Items.Item(0).Forwards.Item(0).Item(' + val1 + ').' + val2) var val = vGetPropertyVal(object,'Value') return val }
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
