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 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
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., 2022: 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