Topic
  • 2 replies
  • Latest Post - ‏2012-10-23T10:19:16Z by Dragos.Cojocari
rhochecker
rhochecker
11 Posts

Pinned topic Variables of type Object

‏2012-10-22T10:47:02Z |
I need to use a variable as a map to store full user names to user ids. In Java script this would look like:

Users = "User Name 1";
Users = "User Name 2";
...

This works in a single script window but not when doing the assignment earlier. The variable seems to lose its properties and is casted to type String.

How can I store the information?
Updated on 2012-10-23T10:19:16Z at 2012-10-23T10:19:16Z by Dragos.Cojocari
  • rhochecker
    rhochecker
    11 Posts

    Re: Variables of type Object

    ‏2012-10-22T10:49:59Z  
    the forum software did interpret some characters wrong:

    This:
    Users = "User Name 1";
    Users = "User Name 2";

    Should be:
    Users['id1'] = "User Name 1";
    Users['id2'] = "User Name 2";
  • Dragos.Cojocari
    Dragos.Cojocari
    1647 Posts

    Re: Variables of type Object

    ‏2012-10-23T10:19:16Z  
    Hi,

    with the current GA version you need to serialize your array into a string format and parse it back to array form when using again. We have two RFEs on this topic and they are planned for the next RPE release:
    http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=12700
    http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=9773

    Regards,
    Dragos

    RPE Actual