On Nov 13, 2006, at 5:25 PM, John Ratcliffe wrote:
Thanks for the reply but I can't seem to get LINE ON mode to work. Is line mode a feature of the remote device or does intermapperbuffer up all the data and give each line in response to the NEXT command.
LINE mode causes InterMapper to buffer up the data so it can pass it to MTCH and EXPT commands as a whole line. It has nothing to do with the remote device.
The NEXT command does not actually read any data, it just indicates that you're done with the current line. The SEND command implicitly calls NEXT, so it also indicates that you're done with the current line.
To further explain this, here's what you're script below is actually doing:
LINE ON
SEND "S\r\n"
STOR "x1" "${_LINE:50}"
NEXT
STOR "x2" "${_LINE:50}"
NEXT
STOR "x3" "${_LINE:50}"
NEXT
STOR "x4" "${_LINE:50}"
NEXT
You send a line "S". The SEND implicitly resets the current line (but doesn't read any new data.) You store the empty line flag into x1, x2, x3, x4. All nine commands execute and return immediately. The next time MTCH, EXPT or SKIP are called, the "real" next line is read into the buffer.
The commands EXPT, MTCH and SKIP read lines into the buffer only when necessary. When reading new data, these commands do not return until the next line is fully read. As implemented, the NEXT command simply sets a flag to say, "next time you're calling MTCH, EXPT or SKIP, read new data." and immediately returns.
To fix, do this instead: LINE ON SEND "S\r\n" MTCH "^(.*)$"r STOR "x1" "$1" NEXT MTCH "^(.*)$"r STOR "x2" "$1" NEXT MTCH "^(.*)$"r STOR "x3" "$1" NEXT MTCH "^(.*)$"r STOR "x4" "$1" Let me know if this helps. Thanks. Bill Fisher Dartware, LLC ____________________________________________________________________List archives: http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [EMAIL PROTECTED]
