1

これは、お気に入りのチャンネルのリストを保存する機能です。しかし、入力として文字列しか持てないため、配列をレジストリに保存することはできません

 Function addToFavorites(channeljson as object)as boolean
        print "started"
        sec = CreateObject("roRegistrySection", "FuturV1")
        poster = CreateObject("roAssociativeArray")
        'if not sec.Exists("FavoriteChannels")
        contentList = CreateObject("roArray", 100, true)
        'else

        'end if 
       poster.ShortDescriptionLine1 = channeljson.name
       poster.SDPosterURL = channeljson.logo
       poster.HDPosterURL = ch`enter code here`anneljson.logo
       poster.url= channeljson.ch
       contentList.push( poster ) `enter code here`
       'sec.Write("FavoriteChannels", ba.ToAsciiString())

       print "again"
       print contentList.GetEntry(0) 
    end function
4

3 に答える 3

2

最も簡単なのはformatJSON() / parseJSON()を使用することです。

于 2016-05-20T21:29:08.913 に答える
1

オブジェクトを永続ストレージに保存するには -

  1. オブジェクト (roArray または roAssociativeArray) を文字列に変換します
  2. その文字列を永続ストレージに保存します。

永続ストレージからデータを取得するには -

  1. 永続性から文字列を読み取ります。
  2. String を Object に変換して使用します。roAssociativeArray の場合、ParseJSON 関数を使用できます。
于 2016-05-20T05:36:39.367 に答える