WSorich Posted September 22, 2009 Posted September 22, 2009 Hello, I have working code for a simple _XMLGetValue call, but am not satisfied with my own execution of it. Is there a way I can wrap the first two lines into a single statement? I.e. can I reference an item in a returned array and assign it to a variable in a single line? I'm still getting my programming legs, so if this is an easy question, I apologise now. Cheers, Wal. $ret = _XMLGetValue("/results/data/row[@num="&$result_number&"]/IDCODE") $returned_result[21] = $ret[1] $ret = _XMLGetValue("/results/data/row[@num="&$result_number&"]/TIMESTAMP") $returned_result[20] = $ret[1] $ret = _XMLGetValue("/results/data/row[@num="&$result_number&"]/YN_ACTION") $returned_result[19] = $ret[1] $ret = _XMLGetValue("/results/data/row[@num="&$result_number&"]/TEXT") $returned_result[18] = $ret[1] $ret = _XMLGetValue("/results/data/row[@num="&$result_number&"]/TYPEINDICATOR") $returned_result[17] = $ret[1]
dantay9 Posted September 23, 2009 Posted September 23, 2009 (edited) No, there isn't. You can either leave it as it is, or put it in a function. I would go with the function. $Returned_Result[21] = Function("/results/data/row[@num=" & $result_number & "]/IDCODE") Func Function($String) Local $Ret = _XMLGetValue($String) Return $ret[1] EndFunc Edited September 23, 2009 by dantay9
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now