X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=iterate.tcl;h=91c9b8ab5448098a177df7a57d5932f8f649762d;hb=534e39b7986d6cbbfac1c99bcca97d8d1fb5e990;hp=b04d1015732c66858a2012001422521f32778dd7;hpb=184be1f49bc141230b8dfdd11dfb2acf538d1858;p=ir-tcl-moved-to-github.git diff --git a/iterate.tcl b/iterate.tcl index b04d101..91c9b8a 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.4 1995-08-04 11:32:40 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 connect localhost:9999 -z callback {init-response} -z init +z failback {fail-back} +z databaseNames dummy +z callback {connect-response} +z connect localhost:210