X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=iterate.tcl;h=0a8c4c12bdb04bd98b96da7dd1bc7099a522ae4b;hb=4ccc8ab7a1f708af5fd89c71771040eaf6e6da4a;hp=b04d1015732c66858a2012001422521f32778dd7;hpb=184be1f49bc141230b8dfdd11dfb2acf538d1858;p=ir-tcl-moved-to-github.git diff --git a/iterate.tcl b/iterate.tcl index b04d101..0a8c4c1 100644 --- a/iterate.tcl +++ b/iterate.tcl @@ -1,28 +1,55 @@ -# $Id: iterate.tcl,v 1.1 1995-03-20 08:53:28 adam Exp $ +# $Id: iterate.tcl,v 1.6 1997-04-13 19:00:43 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} + 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 + catch {rename z.1 {}} + ir-set z.1 z z callback {search-response} - z.1 search adam + z.1 preferredRecordSyntax sutrs + z.1 search the +} + +proc search-response {} { + set hits [z.1 resultCount] + if {$hits <= 0} { + do-search + return + } + z callback {present-response} + if {$hits < 20} { + z.1 present 1 $hits + } else { + z.1 present 1 20 + } +} + +proc present-response {} { + do-search } ir z -ir-set z.1 -z databaseNames DEM +z failback {fail-back} +z databaseNames Default +z callback {connect-response} z connect localhost:9999 -z callback {init-response} -z init - +vwait forever