tracker issue : CF-4087863

select a category, or use search below
(searches all categories and all time range)

structFindKey() with scope 'all' returns invalid variable name

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Henry Ho / Henry Ho (Henry Ho)

Created: 11/16/2015

Components: Language

Versions: 10.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Win All

Vote Count: 0

Listed in the version 2016.0.03.300466 Issues Fixed doc
Problem Description:

If the name of the key is not valid variable name, the returned result.path is also invalid.

Steps to Reproduce:

x = {y:{'background-image':'foo'}};
results = structFindKey(x, 'background-image', 'all');
for (r in results)
  setVariables("x#r.path#", 'bar');

Actual Result:
Parameter 1 of function SetVariable, which is now x.Y.background-image, must be a syntactically valid variable name. on line 5

Expected Result:

r.path should return .Y["background-image"]

Any Workarounds:
manipulate result.path manually with square bracket notation for invalid variable name

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4087863

External Customer Info:
External Company:  
External Customer Name: Henry Ho
External Customer Email:  
External Test Config: My Hardware and Environment details:



This can wait !
Comment by Suresh J.
5320 | January 20, 2016 06:41:20 AM GMT