List processing. Model Technology Special EE/SE, Elite EE/SE
જાહેરાત
જાહેરાત
List processing
System commands
To pass commands to theUNIX shell or DOS window, use the Tcl exec command: echo The date is [exec date]
List processing
In Tcl a "list" is a set of strings in curly braces separated by spaces. Several Tcl commands are available for creating lists, indexing into lists, appending to lists, getting the length of lists and shifting lists. These commands are:
Command syntax
lappend var_name val1 val2 ...
lindex list_name index
linsert list_name index val1 val2 ...
list val1, val2 ...
llength list_name
lrange list_name first last
Description
appends val1, val2, etc. to list var_name return the index-th element of list_name; the first element is 0 inserts val1, val2, etc. just before the index-th element of list_name returns a Tcl list consisting of val1, val2, etc.
returns the number of elements in list_name returns a sublist of list_name, from index first to index last; first or last may be "end", which refers to the last element in the list replaces elements first through last with val1, val2, etc.
lreplace list_name first last val1, val2, ...
Two other commands, lsearch and lsort, are also available for list manipulation.
See the Tcl man pages (Main window: Help > Tcl Man Pages) for more information on these commands.
See also the ModelSim Tcl command:
lecho
(CR-92)
ModelSim EE/SE User’s Manual Tcl and ModelSim
16-377
ડાઉનલોડ કરો
જાહેરાત