gamecircle.Whispersync.GetLatestStringListKeys

Type function
Library gamecircle.*
Return value KeyTable
Revision Release 2024.3703
Keywords Latest, List, SyncableStringList, Whispersync

Overview

Returns the keys for the latest string lists stored under the current Whispersync GameData level. The return value is a KeyTable.

Syntax

local keys = gamecircle.Whispersync.GetLatestStringListKeys()

Examples

local latestListKey = "myFirstLatestStringList"  
local gamecircle = require("plugin.gamecircle")  
gamecircle.Init(false, false, true)  
gamecircle.Whispersync.SetLatestStringListLength(latestListKey, 4)  
gamecircle.Whispersync.AddToLatestStringList(latestListKey, "A")
gamecircle.Whispersync.AddToLatestStringList(latestListKey, "B")
gamecircle.Whispersync.AddToLatestStringList(latestListKey, "C")
gamecircle.Whispersync.AddToLatestStringList(latestListKey, "D") 
gamecircle.Whispersync.AddToLatestStringList(latestListKey, "E") 
print("Here is the list of strings as they are stored in the latest string list. They should be in the order from latest to oldest.")  
local latestList = gamecircle.Whispersync.GetLatestStringList(latestListKey)  
for i,entry in ipairs(latestList) do  
    print("-" entry.value)  
end  
local keys = gamecircle.Whispersync.GetLatestStringListKeys()  
for i,key in ipairs(keys) do  
    print("-" .. key)  
end