9/27/2023 0 Comments Xojo dictionary of arrays![]() ' to process each of the returned values in the array. '*** Not Sure How *** right here but need a loop 'Need to handle valuelist as a string array ![]() System.DebugLog("-Value ("+results(0).Value(mykey).StringValue+")")Įlseif valuelist.Type = variant.TypeArray then If valuelist.Type = Variant.TypeString then System.DebugLog("Key (" + results(0).Key(i).StringValue + ")")ĭim valuelist as Variant = results(0).Value(mykey) You can act as if they are all strings except for the objects and arrays which, as I mentioned, will be another JSONItem. In Xojo, a JSONItem value, returned as a Variant, can only be one of those too. A single JSON value can be nil, a number, a boolean, a string, or another JSON object or array. 'System.DebugLog("Key (" + results(0).Key(i).StringValue + _ The array is akin to a Xojo array of Variant. ' not zero since the key in element zero is always nil. 'Loop the keys value pairs starting with 1 L.SimpleBind("AD\" + Session.ServAcctID, Session.ServAcctPW)ĭim results() as Dictionary = l.Search(BaseDN, Scope, Filter) That all works but I just need to process the return values that are variant arrays. Parts of the code below is essentially copied from the MBS LDAP demo program. Very useful for saving all sorts of complex data to XML text files and reading back into a dict. I test for a returned dictionary array and treat it as an error elsewhere in the code after doing the MBS LDAP search.Ĭan somebody put the function above to re-cast the variant array to a string array in context in a little code where I would loop through the value array? I expanded a module originally created by Kevin Ballard that stores arrays of things (all types of integers, single, doubles, arrays of strings and arrays of folderItems) into a dictionary, and can R/W such dicts to to/from XML files. ![]() Note that the dictionary returned is also an array of dictionaries (hence the subscript for results(0) below) but I don’t get but one dictionary returned (element zero). I have that working but I cannot quite get my head wrapped around the solution mentioned by Will (above) in this thread to handle value arrays returned in the dictionary.Įssentially I have a loop with a set of keys in a dictionary returned by the MBS function but a few of the keys return values as variant arrays not just a simple string. I am attempting to use the MBS LDAP Search.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |