event inq : 18 // Test Event; You can use this in a Sub Function if you want, just call it from the Event that is use.
// VARIABLES
var ii : n3 //
var aTenderMedia[10] : A32 // Array for Storing Tender/Media Information currently on the check; [10] = Array Size, A32 = 32 Characters in length (Alphanumeric)
var count : N4 // Counter for Array
var arrString : A32 // Array String
var Item_Selected : n16 // Used with ListInput
// ## END VARIABLES
count = 1
for ii = 1 to @NUMDTLT
if @DTL_TYPE[ii] = "T" // T = Tender/Media; D = Discount; M= Menu Item
// Format arrString, so the information can be added to the Array properly.
format arrString as "[", @DTL_OBJNUM[ii],"] ",trim(@DTL_NAME[ii]), " - Total: ", @DTL_TTL[ii]
// Add item to the Array
aTenderMedia[count] = arrString
count = count + 1 // Increase count for next Array entry
endif
endfor
// Display Tender/Media Results, Via Window/Display Function
window 14,50, "Tender/Media Results"
windowclear
displayinverse 1, @CENTER, "--------------------------------------------------"{=(@WCOLS)}
displayinverse 2, @CENTER,"Tender/Media Found on Check"{=(@WCOLS)}
displayinverse 3, @CENTER, "__________________________________________________"{=(@WCOLS)}
ListInput 4, 2, arraysize(aTenderMedia), aTenderMedia, Item_Selected, "Make your Selection..."
//ListDisplay 4, 2, arraysize(aTenderMedia), aTenderMedia // If you use this make sure the waitforclear is uncommented out, otherwise you won't see the window
displayinverse 14,@CENTER,"=================================================="{=(@WCOLS)}
//waitforclear // Wait for the Clear button to be pressed; Use this only when ListDisplay is used.
infomessage "Selected: ", aTenderMedia[Item_Selected] // Displays what was selected
endevent