X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=iterate.tcl;h=0a8c4c12bdb04bd98b96da7dd1bc7099a522ae4b;hb=4ccc8ab7a1f708af5fd89c71771040eaf6e6da4a;hp=484100357673eba755dc15972d00abc31622b69a;hpb=da0828666321a53b049c8c89934a30b5f31ab698;p=ir-tcl-moved-to-github.git diff --git a/iterate.tcl b/iterate.tcl index 4841003..0a8c4c1 100644 --- a/iterate.tcl +++ b/iterate.tcl @@ -1,9 +1,12 @@ -# $Id: iterate.tcl,v 1.3 1995-06-26 10:26:16 adam Exp $ +# $Id: iterate.tcl,v 1.6 1997-04-13 19:00:43 adam Exp $ # # 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 {} { @@ -19,20 +22,24 @@ proc do-search {} { incr count puts $count + catch {rename z.1 {}} + ir-set z.1 z z callback {search-response} - z.1 search science + 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 < 10} { + if {$hits < 20} { z.1 present 1 $hits } else { - z.1 present 1 10 + z.1 present 1 20 } } @@ -41,7 +48,8 @@ proc present-response {} { } ir z -z databaseNames dummy +z failback {fail-back} +z databaseNames Default z callback {connect-response} z connect localhost:9999 - +vwait forever