You can modify your function this way:
function A1()
gg.clearResults()
gg.setRanges(gg.REGION_ANONYMOUS)
gg.searchNumber('45.0000038147;20.30000114441;4.40000009537;256D;0::84', gg.TYPE_FLOAT)
local count = gg.getResultCount()
if count == 0 then -- need to check count of results here too, because if nothing found, then next search will be new search, not refine
-- something to perform if nothing was found
else
gg.searchNumber('0', gg.TYPE_FLOAT)
count = gg.getResultCount()
if count == 0 then
-- something to perform if nothing was found
else
local results = gg.getResults(count)
local lastResult = {results[count]}
lastResult[1].value = '2.1019477e-44'
gg.setValues(lastResult)
gg.toast('111! ')
end
end
end
This may be considered as implementation of first approach from the ones that Enyby has mentioned.
I guess that it is suitable for your case, because such group search usually won't produce many results.