Re: Q:show output from script

From: Thomas Matthews (Thomas_MatthewsSpamBotsSuck_at_sbcglobal.net)
Date: 01/09/05


Date: Sun, 09 Jan 2005 18:48:59 GMT

R. Stormo wrote:
> I have a problem showing output that is comming from a script.
> If I make a script running at commandline it do work and everything
> are showing.
> But when I try to execute it from within my proggy it would not show.
> I have tried to save the outout to a file and again, when I runit from
> commandline it do save everything but from software it would not.
> It do only show things that are outputed with "echo"
>
> My routine for showing the file are, the execute script rutine are the same.
>
> FILE *fp; //The filePIPE
> char message[1024]; //Declare buffer to hold the file

What happens if the file is bigger than 1024 bytes?

> fp = fopen( myfilename, "r" );//Read read in txt mode
> if ( fp==NULL )
> msgbox("could not open file to read !!!", "Warning");//Show File not
> found!
> else
> {
> while( !feof( fp ) ) //check for EOF
> {
> fgets( line, 128, fp ); //Read 128 bytes
> strcat( message, line ); //Add this line to previous buffer

You should be checking the total bytes read to make sure
you don't overflow the buffer.

> }
> fclose(fp); //Close the filePIPE
> //------------------------------
> // Show the output in a dialogbox on screen
> //------------------------------
> eMessageBox msg(message, "OUTPUT", eMessageBox::iconInfo
> eMessageBox::btOK);
> msg.show(); msg.exec(); msg.hide();
>
> }
>
>
>
> In advance, thanks

This looks like a platform / operating system issue.
Many windowing operating systems do not support the
mixing of scripts and windowing. Does yours?

Perhaps you should ask about this on a newsgroup
dedicated to your platform.

-- 
Thomas Matthews
C++ newsgroup welcome message:
          http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq:   http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
          http://www.comeaucomputing.com/learn/faq/
Other sites:
     http://www.josuttis.com  -- C++ STL Library book
     http://www.sgi.com/tech/stl -- Standard Template Library


Relevant Pages

  • Re: Q:show output from script
    ... > I have a problem showing output that is comming from a script. ... > commandline it do save everything but from software it would not. ... posting here, use a standard function, e.g.: ...
    (comp.lang.cpp)
  • O2K vbe error message "Cant find project or library"?
    ... even though my original versions showing up okay. ... I'm have trouble with a script in my O2K. ... strMsg = "Do you want to run the macro to expand all the ...
    (microsoft.public.outlook.program_vba)
  • Re: Run VBScript as Task in 32 Bit Mode
    ... And you don't have a hint about where the error is showing up, of course, with that kind of result. ... Post the script as-is (munging database passwords of course) so we can take a look at possible issues. ... That could be troublesome if it's lengthy, and it would be almost unmanageable unless all lines are less than 76 chars long since the script would get serious mangling. ... The script has worked for years in a SBS 2003 environment as a scheduled task. ...
    (microsoft.public.scripting.vbscript)
  • Re: if statement help
    ... It appears that the script is working as there are no erros ... showing but now,the matlab says its 'busy' and after 10 mins ... There is no initialization ...
    (comp.soft-sys.matlab)
  • Q:show output from script
    ... I have a problem showing output that is comming from a script. ... If I make a script running at commandline it do work and everything ... My routine for showing the file are, the execute script rutine are the same. ...
    (comp.lang.cpp)