Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MICROS 3700 SIM ListInput Paging

Status
Not open for further replies.

hannajo1

Programmer
Apr 10, 2015
8
US
Hello,

I was wondering if anyone has an example of paging for a ListInput.
For example, I want to create a ListInput in a Window sized at 10 rows.
However, my list size is > 10 items.
How would I create the functionality to allow the user to page through the list while also providing the ability to select an item from the list?
 
ListInput sample.

Code:
event rxmsg : room_inquire
    var rm_guest[14] : a20 //Guest names array
    var rm_num : a6 //Room number
    var list_size : n3 //Number of array items 
    var user_choice : n3 //Guest number user chooses
    rxmsg rm_num, list_size, rm_guest[ ] // receive message from POS
    window list_size, 24, "Guests- Room #", rm_num 
    listinput 1, 1, list_size, rm_guest, user_choice, "Choose a guest"
    txmsg "guest inquiry", rm_num, user_choice
    //Ask for info from PMS 
    waitforrxmsg // on guest user chooses
endevent

You might be better off though using DisplayInput as it is designed for looping, and you could directly input into your array

Code:
The following script will allow input of customer information in a window:
event inq : 1
    var rowcnt: n3
    var field_name[5] : a15
    var customer_info[5] : a20
    field_name[1] = "Customer name:"
    field_name[2] = "Company:"
    field_name[3] = "Address:"
    field_name[4] = "City:"
    field_name[5] = "Phone:"

    window 5, 36
    for rowcnt = 1 to 5
        display rowcnt, 2,
        field_name[rowcnt]
        displayinput rowcnt, 16, customer_info[rowcnt],\ 
        "Enter ", field_name[rowcnt]
    endfor
    windowedit 
endevent

If you use ListInput you're either going to need multiple arrays or going to need to basically copy the content of each ListInput into another, larger array each time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top