Code: Select all
Procedure.s RandomChoose (myList$, sep$=",")
Protected.i last, item
last = CountString(myList$, sep$)
item = Random(last) + 1
ProcedureReturn StringField(myList$, item, sep$)
EndProcedure
Debug RandomChoose("Hello,World,To,The")