Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for alfanumeric index access #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matthiaz
Copy link

You can have alfanumeric keys together with numeric keys. I changed the regular expression to fix this.

Example:

var arrResults = {"ID4":{"MAXNUMBERPRATICA":"27652","_odbc_connection_id":"ID4"},"4":{"MAXNUMBERPRATICA":"123456","_odbc_connection_id":"ID4"}};
console.log(sprintf("check results = %(arrResults[4].MAXNUMBERPRATICA)s",{"arrResults":arrResults}));
console.log(sprintf("check results = %(arrResults[ID4].MAXNUMBERPRATICA)s",{"arrResults":arrResults}));

You can have alfanumeric keys together with numeric keys. I changed the regular expression to fix this. 

Example: 
```
var arrResults = {"ID4":{"MAXNUMBERPRATICA":"27652","_odbc_connection_id":"ID4"},"4":{"MAXNUMBERPRATICA":"123456","_odbc_connection_id":"ID4"}};
console.log(sprintf("check results = %(arrResults[4].MAXNUMBERPRATICA)s",{"arrResults":arrResults}));
console.log(sprintf("check results = %(arrResults[ID4].MAXNUMBERPRATICA)s",{"arrResults":arrResults}));
```
@alexei
Copy link
Owner

alexei commented Mar 15, 2016

Thanks for your input. Does .ID4 not work in your case?

@matthiaz
Copy link
Author

errr, I haven't tried that... I just did a test and you are right. That works perfectly.

Feel free to decide wheter or not my change gets included. As you correctly point out, this already works if I change the way I'm requesting the parameter:

console.log(sprintf("check results = %(arrResults.ID4.MAXNUMBERPRATICA)s",{"arrResults":arrResults}));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants