in reply to checking existence of a tag in a TK::Text?

Fails how?

Why do you want to know if a tag exists?

What is wrong with iterating ( sub tag_exists ...)? See what i did there? Its called 2nd day of programming :p

Re: How to extract, delete TK tags' option/value (Tk ROText indices index tagAdd tagRemove)

  • Comment on Re: checking existence of a tag in a TK::Text?

Replies are listed 'Best First'.
Re^2: checking existence of a tag in a TK::Text?
by jsteng (Beadle) on Apr 30, 2018 at 06:30 UTC
    when $list->index("T$j.first") fails the subroutine that contained it returns without doing anything further.
    Therefore I need to know if it exists first before I fetch the index.

      Did you say that out loud? Try saying that out loud. If a tag doesnt exist do nothing . if index says a tag doesnt exist do nothing. Hmmm. Can you hear what youre saying? Do you remember your previously posted code? Each tag had its own callback closure -- it could only be called if a tag existed... Hmmm.. What? Yeah. What? Ok :)