All pastes #766733 Raw Edit

Untitled

public text v1 · immutable
·published 2007-11-09 02:54 UTC
rendered paste body
proc checkline {string} {
  set f [open filename.txt r]
  set found [checkfile $f $string]
  close $f
  if {$found != "0"} {
    set f [open filename.txt a]
    puts $f "whatever"
    close $f
  }
}

proc checkfile {f string} {
  while {![eof $file]} {
    gets $file line
    set line [split $line " "]
    if {[string eq -nocase "WorldTime" [lindex $line 0]] == 0} {return [lindex $line 1]}
    return 0  
  }
}