On Sep 25, 9:31 pm, jamim <[EMAIL PROTECTED]> wrote:

> Now the problem I'm having is that it seems if a user preference is
> going to be hidden it has to be a string (http://code.google.com/apis/
> gadgets/docs/reference.html#Userprefs_Ref), when I need it to be an
> array.  Any ideas how to get around this?

You'll have to serialize your array as a string, but that's not hard
to do at all. I'd suggest the Array.join method (http://
developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/
Array/join), something like this to save:

        songStr = songArr.join('|');
        prefs.setString('songString', songStrr);

and this to retrieve:

        var songStr = prefs.setString('songString');
        var songArr = songStr.split('|');

Incidentally, this is how the Prefs array type is stored internally,
as a pipe-delimited string.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iGoogle Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Gadgets-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to