Difference between revisions of "Ns findset"

From AOLserver Wiki
Jump to navigation Jump to search
(imported from WiKit id 556)
 
 
(One intermediate revision by one other user not shown)
Line 17: Line 17:
 
'''EXAMPLES'''
 
'''EXAMPLES'''
  
     % set sets [[list]]
+
     % set sets [list]
  
     % lappend sets [[ns_set create foo]]
+
     % lappend sets [ns_set create foo]
 
     d0
 
     d0
  
     % lappend sets [[ns_set create bar]]
+
     % lappend sets [ns_set create bar]
 
     d0 d1
 
     d0 d1
  
     % lappend sets [[ns_set create baz]]
+
     % lappend sets [ns_set create baz]
 
     d0 d1 d2
 
     d0 d1 d2
  
Line 31: Line 31:
 
     d1
 
     d1
  
     % llength [[ns_findset $sets quux]]
+
     % llength [ns_findset $sets quux]
 
     0
 
     0
  
Line 42: Line 42:
 
----
 
----
  
[[Category Documentation]] - [[Category Core Tcl API]]
+
[[Category:Documentation]] - [[Category:Core Tcl API]]

Latest revision as of 19:24, 7 February 2009

Man page: http://aolserver.com/docs/tcl/ns_findset.html


NAME

ns_findset - Find a set by its name from a list of sets

SYNOPSIS

ns_findset sets name

DESCRIPTION

This command is used to find a set by its name from a list of sets and returns the setId of the first set whose name matches name, or returns an empty string if no set matches.

EXAMPLES

   % set sets [list]
   % lappend sets [ns_set create foo]
   d0
   % lappend sets [ns_set create bar]
   d0 d1
   % lappend sets [ns_set create baz]
   d0 d1 d2
   % ns_findset $sets bar
   d1
   % llength [ns_findset $sets quux]
   0
   % ns_set cleanup

SEE ALSO

ns_set

-