[ List Archives Home ] [ Thread index for 2008 ] [ Date index for 2008 ] [ Author index for 2008 ]


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Thanks, Kyle & Martha. After using this bit of Expect code for a while
(to find an empty review file) I wondered why it was skipping some empty
files. I rewrote it as shown below, moving the "Select review file" line
to the top of the loop, so that $count decrements once instead of twice
each time.

# choose an empty review file
set count 80
while {$count > 0} {
expect "Select review file" {send "$count"}
expect {
"LIST RECORDS" {send "q"}
"BOOLEAN SEARCH of FILE" {break}
"Hit 's' to stop checking" {send "s"}
}
incr count -1;
}

Phil

> I like Kyle's solution better than mine. I found that when you find an
> Empty file, it could be in use by someone who has not completed their
> search yet.
>
> Kyle's script works better since it takes into consideration in use
> files, but I had a problem with it as written:
>
> set count 100
> while {$count > 0} {
> expect {
> "LIST RECORDS" {send -h "q"}
> "BOOLEAN SEARCH of FILE" {break}
> "Hit 's' to stop checking" {send -h "s"}
> "Choose one" {send "$count"}
> }
> incr count -1;
> }
>
> The match "Choose one" actually appears on the LIST RECORDS screen also,
> so I changed this script to:
>
> set count 160
> while {$count > 0} {
> expect {
> "LIST RECORDS" {send "q"}
> "BOOLEAN SEARCH of FILE" {break}
> "Hit 's' to stop checking" {send "s"}
> "Select review file" {send "$count"}
> }
> incr count -1;
> }
>
> --
> Martha Driscoll, Systems Manager
> North of Boston Library Exchange (NOBLE)
> driscoll@xxxxxxxxxx
> Ph: 978-777-8844 Fax: 978-750-8472
>
>
>
> --
> This message was distributed through the Innovative Users Group INNOPAC
> list Public replies: INNOPAC@xxxxxxxxxx
> Update your subscription options:
> http://innopacusers.org/mailman/listinfo/innopac


Phil Shirley
Technology Services Coordinator
Cuyahoga Falls Library
Cuyahoga Falls, Ohio
pshirley@xxxxxxxxxx