string out;
out=system("ping pc1 -c 2|grep Reply");//linux
out=system("ping pc1 -n 2|grep Reply");//windows
out=system("netstat -a -n -o");
Debug(out);
it is available in v3.8/3.9/3.10 in windows/linux although online help is "int ret=system();"
Powerful! output the result of system() directly
- Chenghannong
- Posts:1
- Joined: Thu Feb 17, 2011 6:16 am
Powerful! output the result of system() directly
- zs9782
- Posts:2
- Joined: Sat Oct 09, 2010 9:37 am
Re: Powerful! output the result of system() directly
This author is as PVSS expert in Siemens Ltd.,China, please give him a ebullience support.
- zs9782
- Posts:2
- Joined: Sat Oct 09, 2010 9:37 am
Re: Powerful! output the result of system() directly
Very good function, this solution was come from Si Chuan Longgang gas field SCADA project in China.
- aorange
- Posts:147
- Joined: Thu Nov 04, 2010 10:07 am
Re: Powerful! output the result of system() directly
The helpfile states:
For the purpose of debugging I would simply call the system() function from within the DebugN() functionReturns the return code of the program that was executed. Returns -1 if no argument was specified, a new process could not be created or if the started process was not finished normally.
Code: Select all
DebugN( system( "tracert 127.0.0.1" ) );