How to compare a variable with NULL

Homepage Clovertech Forums Read Only Archives Cloverleaf Tcl Library How to compare a variable with NULL

  • Creator
    Topic
  • #50475
    Susan Ferraz
    Participant

    I’m writing a tcl program to verify if a field is blank. If it is then the message will be killed. My problem is the field is coming with double-quotes (“”) instead of blank. How do I write the cequal statement to compare a variable with a NULL value?

    The statement below works on messages I receive where the field is blank.

    if {[cequal $var1″”]}

Viewing 1 reply thread
  • Author
    Replies
    • #66245

      if {[cequal $var1 “”] || [cequal $var1 “”””]}

      Code:


      set var1 “”””

      if {[cequal $var1 “”] || [cequal $var1 “”””]} {
         puts “Hello.”
      }

      -- Max Drown (Infor)

    • #66246
      Susan Ferraz
      Participant

      Hi Max,

      Your suggestion works. Thanks!

      Susan

Viewing 1 reply thread
  • The forum ‘Tcl Library’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,042
Forums
28
Topics
9,200
Replies
34,023
Topic Tags
267