Gzirry Posted May 30, 2019 Share Posted May 30, 2019 anyone know how to loadResults I want to load search results into a function at the beginning of the script example gg.searchNumber('3', gg.TYPE_DOUBLE) gg.getResults(1000) local R=gg.getResults() gg.clearResults() Function Main() menu=gg.choice({'item 1','item2','item3'}) if menu == 1 then item1() end if menu == 2 then item2() end if menu == 3 then os.exit() end end function item1() gg.loadResults(R) ← not working gg.getResults(1000) gg.editAll('10', gg.TYPE_DOUBLE) gg.toast('item 1 activated') gg.clearResults() end function item2() gg.loadResults(R) gg.getResults(1000) ← not working gg.editAll('20',gg.TYPE_DOUBLE) gg.clearResults() gg.toast('item2 activated') end Link to comment Share on other sites More sharing options...
Administrators Enyby Posted May 30, 2019 Administrators Share Posted May 30, 2019 If you need only edit results, use setValues. Link to comment Share on other sites More sharing options...
ZTzTopiaa Posted May 30, 2019 Share Posted May 30, 2019 gg.setValues(r) maybe Link to comment Share on other sites More sharing options...
maulz Posted May 30, 2019 Share Posted May 30, 2019 You need add results to list before load it Example: gg.searchNumber("1", gg.TYPE_DWORD) local add = gg.getResults(10) -- Save Results gg.addListItems(add) gg.clearResults() -- Loading Results list = gg.getListItems(add) for i, v in ipairs(list) do add[i].value = "2" end gg.setValues(add) *CMIIW Link to comment Share on other sites More sharing options...
Question
Gzirry
anyone know how to loadResults
I want to load search results into a function
at the beginning of the script
example
gg.searchNumber('3', gg.TYPE_DOUBLE)
gg.getResults(1000)
local R=gg.getResults()
gg.clearResults()
Function Main()
menu=gg.choice({'item 1','item2','item3'})
if menu == 1 then item1() end
if menu == 2 then item2() end
if menu == 3 then os.exit() end
end
function item1()
gg.loadResults(R) ← not working
gg.getResults(1000)
gg.editAll('10', gg.TYPE_DOUBLE)
gg.toast('item 1 activated')
gg.clearResults()
end
function item2()
gg.loadResults(R)
gg.getResults(1000) ← not working
gg.editAll('20',gg.TYPE_DOUBLE)
gg.clearResults()
gg.toast('item2 activated')
end
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.