Posted to tcl by dandyn at Thu May 23 17:39:13 GMT 2024view raw
- # Adds module to the 'mods' list.
- if {[info exists mods]} {
- if {[lsearch -exact $mods $foxTag] == -1 } { lappend mods $foxTag }
- } else {variable mods [list $foxTag]}
- # or
- # Adds module to the 'mods' list.
- if {[info exists mods]} {
- if {![string match "*$foxTag*" $mods]} {variable mods "$mods $foxTag"}
- } else {variable mods $foxTag}
Comments
Posted by dandyn at Thu May 23 17:47:10 GMT 2024 [text] [code]
set foxTag fox set mods "bbc fox aft svt" # Adds module to the 'mods' list. if {[info exists mods]} { if {[lsearch -exact $mods $foxTag] == -1 } { lappend mods $foxTag } } else {variable mods [list $foxTag]} puts "\tlist:\t $mods" # or # Adds module to the 'mods' list. if {[info exists mods]} { if {![string match "*$foxTag*" $mods]} {variable mods "$mods $foxTag"} } else {variable mods $foxTag} puts "\tstring:\t $mods"
Posted by dandyn at Thu May 23 20:59:36 GMT 2024 [text] [code]
set foxTag fox set mods "bbc fox aft svt" # Adds module to the 'mods' list. if {[info exists mods]} { if {[lsearch -exact $mods $foxTag] == -1 } { lappend mods $foxTag } } else {variable mods [list $foxTag]} puts "\tlist:\t $mods" # or # Adds module to the 'mods' list. if {[info exists mods]} { if {![string match "*$foxTag*" $mods]} {variable mods "$mods $foxTag"} } else {variable mods $foxTag} puts "\tstring:\t $mods"