Expectk - Any body an expert?! (Tcl/Tk)

From: Wayne Sweatt <sweatt_at_dps.state.nm.us>
Date: Fri, 05 Dec 1997 08:48:17 -0700

 I know this isn't strictly Digital Unix, but I'm not getting any response from the "comp.lang.tcl"
newsgroup. I thought I'd re-post it here in case someone has an idea. I've scanned the Don Libes'
Expect book, but couldn't resolve it. Here's the question:


  I am having a problem getting long messages stored fully into
expect_out(1,string). It seems to do the match check before the
entire message gets there. It seems to be getting chopped off
at random lengths using a send that always will receive the same
message at the same length in bytes. Is it possible that my buffer
is getting full? Will this cause an immediate "-re" check?
I am running tcl7.5, tk4.1,expect5.2 and oratcl2.4b3 under
Digital Unix 4.0b. I have a "set timeout -1" before my expect_background.
I didn't notice any difference. Just in case it makes a difference,
Here's the format of the expect_background code:

proc get_messages
   global som eom

   expect_background {
     -re "^\[? \x07\]*${som}(.*)${eom}"
           {process_message $expect_out(1,string) }
       eof { handle_eof }

     -re "\\? ${som}(.*)${eom}"
           {process_message $expect_out(1,string) }
       eof { handle_eof }

     -re "${som}(.*)${eom}"
           {process_message $expect_out(1,string) }
       eof { handle_eof }
}

What happens, is that instead of getting an: expect-background: does "
${som} blah,blah,blah ${eom} match regular expression "^\[?
 \x07\]*${som}(.*)${eom}"
I get:

expect-background: does "${som} blah,blah,blah bl" match regular
 expression "^\[? \x07\]*${som}(.*)${eom}"

with the message cut off before it ever gets to the ${eom}!
Any ideas??
Thanks,
 Wayne
Received on Fri Dec 05 1997 - 16:46:21 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT