1 # $Id: shell.tcl,v 1.1 1995-06-30 12:39:27 adam Exp $
5 proc target {name database} {
7 z failback {puts "Connection failed"}
8 z callback {connect-response}
9 z databaseNames $database
14 proc connect-response {} {
15 z callback {init-response}
19 proc init-response {} {
20 puts "Connect and initalized. ok"
23 proc find-response {z} {
24 set sstatus [$z searchStatus]
26 set h [$z resultCount]
27 puts "Search ok. $h hits"
34 proc common-response {z from} {
35 set status [lindex [$z responseStatus] 0]
39 puts -nonewline [lindex [$z responseStatus] 1]
41 puts -nonewline [lindex [$z responseStatus] 2]
43 puts -nonewline [lindex [$z responseStatus] 3]
48 for {set i $from} {$i < [$z nextResultSetPosition]} {incr i} {
49 if {[$z type $i] == ""} {
59 proc show {from number} {
60 z callback "common-response z.1 $from"
61 z.1 present $from $number
66 z failback {puts "Connection closed"}
67 z callback {find-response z.1}