// Base class declaration
class CEmployee
{
public:
CEmployee(char* f, char* l, int salary);
CEmployee(int s);
~CEmployee(void);
int getSalary();
int age;
protected:
char* fname;
char* lname;
int salary;
};
// Derived...
I am not familiar with Ubuntu & source code installations. If you just care to install tcl/tk, other forums seem to suggest this:
sudo apt-get tcl tk
Other option is downloading binaries from:
www.ActiveState.com/activetcl/downloads
Unzip the tar.
Run install.sh from the directory where you...
Primilinary search indicates to me that TCL maynot be sufficient to open usb port. You may have to look into writing C/C++ code to accmplish that.
For Unix, you have to use open, read, close etc. file functions to read usb port. For example, under Unix you can run command "man 2 read" to...
In Linux, everything is a file. The /dev directory is part of Linux OS architecture containing special device files that allow for user applications to interface with hardware.
This mechanism of communicating with devices does not exist on MS Windows which you are trying to do. I have used...
You can sort the list with or without hex elements (0x30A) as shown in the response code sample above.
what happen if my list is i get from a database which i set it to
foreach part $partno{
set count ""
set count [<command> $partno]
}
It is hard to infer what you are trying to do from your...
Do you have TCL installed?
You can set the PATH in Windows to point to TCL intrepreter or explicitly type the path when running scripts, i.e,
\path\to\tclsh.exe \script\lives\here\tcl_script.tcl
You can also set file association in Windows so when a script name is entered Windows know to call...
Hmm. I think I understand your concern. Change the code as follows:
set a1 "Hello"
set a2 "there"
set a3 "UchihaItachi!!!"
set status [catch {exec /path/to/exe/cpp_app.exe "\$a1" $a1 "\$a2" $a2 "\$a3" $a3} result]
puts "$result"
if {$status} { puts "cpp_app error: $status}
Notice now...
You have to compile C/C++ code. You have to include iostream header. I had to install C++ compiler using yum.
I ran above script code with TCL interpreter with no problems.
Good luck
It looks like you have incorrect syntax. Your code is wrong!
if ([catch (exec / path / to / exe / cpp_app.exe $ a1 $ a2 $ a3)]) (
if ([lIndex $:: errorCode 2] eq "1") (
puts "cpp_app.exe error: [lIndex $:: errorCode 2]
Else ()
# Something else went wrong
)
)
What language...
You can check how procedure p1 modified flag in file1.
Updated file2.tcl:
# calls ONLY procedure p1 w/ 2 arguments in file1!
set flag [p1 10 20]
puts "flag in file2: $flag"
What in the world are you trying to do? If variable flag is constant then why not set it in file2? If flag is being manipulated and modified then file1 must execute!!!
It seems you may need to modularize file1. By that I mean, you need to create procedures that do very specific tasks in...
Feherke illustrated what I understood as well. But maybe you mean this?
file1.tcl:
set flag 1234
set output [exec tclsh /path/to/file2.tcl $flag]
puts stdout $output
file2.tcl:
set argc [llength $argv]
if {$argc < 1} {
puts "Too few arguments"
exit
}
# Assuming flag is the first argument...
Few key notes about my first response...
Typo fix:
cout << "Arg " << i << ":" << *argv[i] << endl;
The line above should be:
cout << "Arg " << i << ":" << argv[i] << endl;
Script code is in Expect lanugage. You maybe writing in TCL but idea is the same.
Line below can send script...
I am not sure if I understand your request correctly. As I I understand, this is what you are trying to do.
C/C++ code:
void somefunc(int argc, char* argv[])
{
int i = 1;
while(i < argc)
{
cout << "Arg " << i << ":" << *argv[i] << endl;
i++;
}
}
int main(int argc...
I am trying to figure out how Expect's interact command works with multiple processes. I have 2 simple scripts below. The objective is to feed output by spawned process id2 to spawned process id1.
#!/usr/bin/expect --
log_user 1
# clear screen
send_user [exec tput reset]
# it appears...
A driver? :0| What are you trying to do? To monitor changes to a file, you don't really need a driver.
For example, in Windows you can interface to Operating System's supplied API to monitor file changes. I am new to Linux but I am pretty sure there are mechanisms to accomplish the same...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.