Forum Discussion

FICO's avatar
FICO
Community Manager
16 years ago

How to use "Hashtable" class in the Blaze Advisor .net

How to use "Hashtable" class in the Blaze Advisor .net

Hi, I'm working on C# & Blaze Advisor .NET But i have a little problem. P_Hash-> .net Hashtable object. but it can't reference the Hashtable object. How to use the Hashtable object. For example, P_Hash[P_KEY] <- error... if ( P_Hash.ContainsKey(P_KEY) )  then {  return P_Hash.[P_KEY] as a string. <-- error   } else {  return "". } Please help me. Have a good day.

1 Reply

  • FICO's avatar
    FICO
    Community Manager

    Hi,

    Are you trying to create a Hashtable (System.Collections.Hashtable) instance in your rules project? If you are, did you import the class into your project through your .Net BOM?

    You can also use the built-in "association" if you do not have to have the .Net versjon. You declare it like this:

    myHash is some association from <keytype> to <valuetype>;

    Initialization:

    myHash = an association from <keytype> to <valuetype>;

    Indexing:

    myValue is some <valuetype> initially myHash[<key>];

    Inserting:

    myHash[<key>] = myValue;

    Regards,

    Jostein