tcl::prefix
tcl::prefix subcommand ?arg ...?
Matches a word to a unique prefix of a table, as a command does with its options.
Subcommands
| Synopsis | What it does |
|---|---|
tcl::prefix match ?-exact? ?-message TEXT? ?-error OPTIONS? TABLE STRING |
The entry of TABLE that STRING is a unique prefix of, or an error. |
tcl::prefix all TABLE STRING |
Each entry that starts with STRING. |
tcl::prefix longest TABLE STRING |
The longest common prefix of those entries. |
Examples
A click on an example runs it in the shell of the page.
tcl::prefix match {apple banana} ban:bananatcl::prefix all {apple apricot banana} ap:apple apricot
Facts
- Capability: none.
- Compute cost: one compute unit for the call, and more for the commands that it runs.