you could do something like this:
INPUT INPUT$ RESTORE @LIST REPEAT READ CMD$ DIM RESP$[0] 'reset the list of responses WHILE 1 'read responses until you reach "" READ TEMP$ IF TEMP$=="" THEN BREAK PUSH RESP$,TEMP$ WEND UNTIL INPUT$==CMD$ || CMD$=="" 'repeat until you find a match or reach the end of the data PRINT RESP$[RND(LEN(RESP$))] 'print a random response from the list @LIST DATA "command1","response1A","response1B","" DATA "command2","response2","" DATA "command3","response3A","response3B","response3C","response3D","" 'etc. DATA "","error: invalid command",""After you input a command, it reads the data until it finds a match, then prints a random response.