Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Tcl functionality not working in Expect

Posted by ameen (ameen), 17 March 2004
Dear Folks,
    I am creating an application which has certain commands.. I done the command validation in TCL8.4.. For that command execution I am using expect b'se it has the capability to run that. But all other functionality (for example if there is an error in the arguments I trapped it and is working in Tcl) is not working in Expect. What will be the problem.. If you guys any one find the Problem and solution for that.Pls reply to this forum.

Ameen..

Posted by admin (Graham Ellis), 17 March 2004
If you can post a few lines of code that work in Tcl but not in Expect, we may be able to help but otherwise we're going to be guessing!

Also ... what version of Expect are you using, and on what platform?  And how does the code fail?

It does strike me that there's a send command in both Tk and Expect .... that gives rise to problems sometimes.

Posted by ameen (ameen), 17 March 2004
Dear Graham,
   Thanx for your reply. I validate some text in a command.. If suppose  I have a command  tell { } .. It should be in the format of  tell { FROM = somestring , TO = somestring}..     If the FROM  or TO missing I reported the error via my own API. The error is reporting in tclsh. But not in expect...

I 'm using expect 5.4

Appreciating in advance for the reply..

Ameen

Posted by admin (Graham Ellis), 17 March 2004
I'm guessing you might mean 5.40.0??  And I really can't even guess at what might be happenining until I see a few lines of code that illustrate the problem I'm supposed to be solving   - that's what I meant when I asked you to "post a few lines of code"

Posted by ameen (ameen), 23 March 2004
Hi Graham,

 I didn't found the solution for it.. I haven't enough time to give u the sample code..  Now I am giving some sample code that may useful for u to solve the problem.


I have a follwing code...

if { TRUE == Namespace1::call_fn "hello"} {
  puts "Hello"
} else {
 namespace2::print_error "Error happned in fn call"
}


proc Namespace1::call_fn {args } {
    # Some validaion
    return TRUE
}


namespace2::print_error "some argunmnts" ....is nothing but printing error msg in some format....

In that sample code if I source it in TCL8.4.5 it is working well.. But I source the same file in expect 5.4.0 it is not printing in the appropriate format...


Thanks,
Ameen

Posted by admin (Graham Ellis), 23 March 2004
on 03/23/04 at 04:04:58, ameen wrote:
Hi Graham,

I haven't enough time to give u the sample code..


I'm very busy too, so I'm going to concentrate on answering questions from people who have questions that are important enough for them to follow up on properly.

If you really have expect 5.4.0 it's ancient and you should upgrade.  You never did answer my question as to which platform; expect on Windows is flaky.

Posted by ameen (ameen), 23 March 2004
Sorry,
I am using Redhat Linux 9.0..

Rgds

Posted by admin (Graham Ellis), 23 March 2004
on 03/23/04 at 04:32:52, Graham Ellis wrote:
If you really have expect 5.4.0 it's ancient and you should upgrade.




This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho