X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=iterate.tcl;h=f95ece7345977d55d13ee5196c10e587697c8b22;hb=a3d15c17d1389f3047e2c271e69df869f6dd904d;hp=b04d1015732c66858a2012001422521f32778dd7;hpb=184be1f49bc141230b8dfdd11dfb2acf538d1858;p=ir-tcl-moved-to-github.git diff --git a/iterate.tcl b/iterate.tcl index b04d101..f95ece7 100644 --- a/iterate.tcl +++ b/iterate.tcl @@ -1,28 +1,52 @@ -# $Id: iterate.tcl,v 1.1 1995-03-20 08:53:28 adam Exp $ +# $Id: iterate.tcl,v 1.5 1996-08-21 11:24:01 adam Exp $ # -# Small test script which searches for adam ... +# Small test script which searches for science ... +proc fail-back {} { + puts "Fail" +} + +proc connect-response {} { + z callback {init-response} + ir-set z.1 z + z init +} proc init-response {} { global count set count 0 puts "In init-response" - z callback {search-response} - z.1 search adam + do-search } -proc search-response {} { +proc do-search {} { global count incr count - puts "In search-response $count" + puts $count z callback {search-response} - z.1 search adam + z.1 search science +} + +proc search-response {} { + set hits [z.1 resultCount] + if {$hits <= 0} { + do-search + } + z callback {present-response} + if {$hits < 10} { + z.1 present 1 $hits + } else { + z.1 present 1 10 + } +} + +proc present-response {} { + do-search } ir z -ir-set z.1 -z databaseNames DEM +z failback {fail-back} +z databaseNames dummy +z callback {connect-response} z connect localhost:9999 -z callback {init-response} -z init - +vwait forever