I’m running a program using Tcl 8.5.9, specificly: /tcl/8.5.9_64/bin/wish8.5 I’m trying to use the lcontain command, but the tcl doesn’t recognize it. Was it excluded from that version? and is there a different command to replace it?
I’m running a program using Tcl 8.5.9, specificly: /tcl/8.5.9_64/bin/wish8.5 I’m trying to use the
Share
If I’m not mistaken the
lcontaincommand checks the existence of an element in a list? This command never was in pure Tcl. It’s a part of TclX package, AFAIK.It the Tcl.8.5 there is
inoperator which can be used in any expressions. For example:There is also
nioperator which is opposite toin(checks if a list does not contain an element).In earlier versions of Tcl you can use
lsearchcommand and compare the result (index of found element) with-1to see whether an element was found actually.