choice = ListRequest(title$, body$, choices[, t])
choice = ListRequest(title$, body$, choices[, active])
When ListRequest()
returns, you will receive the index of the list entry
that the user has selected as the return value. If the user hasn't selected
an item or cancelled the requester, -1 will be returned.
ListRequest()
supports several additional arguments. Before Hollywood 9.0, those
had to be passed as optional parameters (see above). Since Hollywood 9.0,
however, it is recommended to use the new syntax, which has a single optional
table argument that can be used to pass one or more optional arguments to
ListRequest()
.
The following table fields are recognized by this function:
Active:
Active
table tag.
Indices start at 0 for the first entry and run through number of entries
minus 1. If Active
is omitted or out of range, nothing will be preselected.
X:
Y:
Width:
Height:
Starting with Hollywood 6.0 you can pass an empty string ("") as title$
. In
that case, the requester will use the title specified in the
@APPTITLE preprocessor command.
r = ListRequest("User prompt", "Which of these is not an island?", {"Australia", "Fiji", "New Zealand", "Easter Island", "Hawaii", "Goa", "Madagascar", "Maldives", "Seychelles"}) If r = -1 Print("You chose the chicken exit!") ElseIf r = 5 Print("That's right, congratulations!") Else Print("Sorry, but that is an island...") EndIfThe code above shows how to use
ListRequest()
for a little quiz.