tclserv

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

0001-usefultools.tcl (1067B)


      1 blocktnd misc
      2 set miscellanyunbindrehash [llbind - evnt - confloaded miscellany.rehash]
      3 
      4 proc miscellany.rehash {a} {
      5 #	if {[catch {set oldmiscellanyunbindalive}] == 0} {
      6 #		unllbind - evnt - alive $::oldmiscellanyunbindalive
      7 #		unllbind - evnt - confloaded $::oldmiscellanyunbindrehash
      8 #	}
      9 	putlog [format "there are %s miscellany blocks" [set blocks [tnda get "openconf/[ndcenc misc]/blocks"]]]
     10 	if {$blocks == ""} {return}
     11 	for {set i 1} {$i < ($blocks + 1)} {incr i} {
     12 		set netname [string tolower [lindex [tnda get [format "openconf/%s/hdr%s" [ndcenc misc] $i]] 0]]
     13 		after 1000 [list miscellany.oneintro [tnda get [format "openconf/%s/hdr%s" [ndcenc misc] $i]] [tnda get [format "openconf/%s/n%s" [ndcenc misc] $i]]]
     14 	}
     15 }
     16 
     17 proc miscellany.oneintro {hdr block} {
     18 	if {$hdr == ""} {
     19 		tnda set "gmisc" $block
     20 	} {
     21 		tnda set "misc/[ndcenc $hdr]" $block
     22 	}
     23 }
     24 
     25 proc dictassign {dictValue args} {
     26 	foreach {i j} $args {
     27 		upvar $j jj
     28 		if {[dict exists $dictValue {*}$i]} {
     29 			set jj [dict get $dictValue {*}$i]
     30 		} {
     31 			if {![info exists jj]} {set jj ""}
     32 		}
     33 	}
     34 }