私はリストにテストを言っています
set test "Hi i am Nitesh"
regexp "am" $test
tell test # to ge the position of the pointer
次のようなエラーが表示されます
can not find channel named "test"
その方法がわからない
私はリストにテストを言っています
set test "Hi i am Nitesh"
regexp "am" $test
tell test # to ge the position of the pointer
次のようなエラーが表示されます
can not find channel named "test"
その方法がわからない
ここには 2 つのまったく異なる概念があるようです。一方では、リストがあり、リスト内の用語の位置を見つけたいとします。次に、一方、tellを使用しています(通常は、開いているチャネルのアクセス位置を決定するために使用されます)。本当に必要なのは、test という文字列を検索することだと思います。http://www.tcl.tk/man/tcl8.5/TclCmd/string.htm#M8を使用してみてください
set test "Hi i am Nitesh"
string first "am" $test
test をリストとして扱いたい場合は、単純にlsearchを使用してリスト インデックスを検索します。
lsearch $test am