Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Changing Arrays Within GBC Data Cabinet
Started by mpkostek Feb 14 2016 10:46 AM

- - - - -
1 reply to this topic

Best Answer mpkostek , 18 February 2016 - 06:06 PM

local t = GBCDataCabinet.get("Cabinet1","shipInfo")

t.ship1 = {0, true, 100}

cabinet = GBCDataCabinet.set("Cabinet1", "shipInfo", t)

[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

mpkostek

[GLOBAL: userInfoPane.html]
mpkostek
  • Enthusiast

  • 89 posts
  • Corona SDK

I am storing a table in a GBC data cabinet like this:

cabinet = GBCDataCabinet.set("Cabinet1","shipInfo",{
["ship1"] = {0,false,100},
["ship2"] = {0,false,200},
["ship3"] = {0,false,300},
["ship4"] = {0,false,400},
["ship5"] = {0,false,500},
["ship6"] = {0,false,600},
["ship7"] = {0,false,700},
["ship8"] = {0,true ,800}})

How would I change one of the “false” values to true? I have found that I can access values with something like this:

local t = GBCDataCabinet.get("Cabinet1","shipInfo")
entry.price = t[entry.imageName][3]

but how do I modify this value?



[TOPIC: post.html]
#2

mpkostek

[GLOBAL: userInfoPane.html]
mpkostek
  • Enthusiast

  • 89 posts
  • Corona SDK

  Best Answer

local t = GBCDataCabinet.get("Cabinet1","shipInfo")

t.ship1 = {0, true, 100}

cabinet = GBCDataCabinet.set("Cabinet1", "shipInfo", t)




[topic_controls]
[/topic_controls]