This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Purple's profile picture

Autocomplete?

Started by Purple, 14 December 2017 - 05:42 PM
Purple #1
Posted 14 December 2017 - 06:42 PM
I have a program that takes text input from the user. I know that the only valid input for the program are values from a list that is statically defined before the program runs. How would I implement an autocomplete system for my program? I basically want to mimic the shell autocomplete functionality but inside my program.
Edited on 14 December 2017 - 05:43 PM
KingofGamesYami #2
Posted 14 December 2017 - 07:57 PM
textutils.complete gets you the table, the third argument of read is where you want to implement it. For more information, check how the edit program does it.
Lyqyd #3
Posted 15 December 2017 - 03:44 AM
This thread split from the Idea Exchange.