Place it in your table's Lua script.
Code: Select all
function ShiftSelection(ddrec,dir)
ddrec = getAddressList().getMemoryRecordByDescription(ddrec)
local allVals = ddrec.DropDownValue
local itemCount = ddrec.DropDownCount
local nextVal = (dir > 0) and allVals[0] or allVals[itemCount-1]
for i=0,itemCount-1 do
if allVals[i] == ddrec.Value then
if dir > 0 then
nextVal = (i < itemCount-dir) and allVals[i+dir] or nextVal
break
else
nextVal = (i >= 0-dir) and allVals[i+dir] or nextVal
break
end
end
end
return nextVal
end
(To select next item) Set value to: [ShiftSelection("memrec description",1)]
(To select previous item) Set value to: [ShiftSelection("memrec description",-1)]
memrec description has to be an exact match to the label you've assigned to that memory record. Unfortunately {MRDescription} is not accessible to the Set value field, at least in CE 7.2, even though it is accessible to the Speech text field.