Announcement

Collapse
No announcement yet.

Invisible Chilluns?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Invisible Chilluns?

    Is it possible with the SHELL function in PB 3.5 for DOS to call a
    DOS program in such a way that there is no screen output from that
    SHELL child?

    In other words, I'd like to use the operating system to do a task,
    yet not tell the program user what is going on in that task!

    Haven't tried it, but could I, perhaps, send the visual output of
    the child to a pipe null somehow like I do when I call an executable
    in a batch file and pipe the output to a file name?

    Inquiring mind wants to know!

    Thanks..


    ------------------
    Mike Luther
    [email protected]
    Mike Luther
    [email protected]

  • #2
    Don't know if this will work but you might try redirecting the
    output to a nul device. i.e., SHELL "SOMEFILE.EXE > NUL". This
    the only way that I know of to suppress screen output.


    ------------------


    [This message has been edited by Mel Bishop (edited July 14, 2003).]
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3
      The DOS screen handling was so desperately inefficient, it was often
      bypassed. Depends on the program.

      ------------------
      Tom Hanlin
      PowerBASIC Staff

      Comment


      • #4
        Is it possible with the SHELL function in PB 3.5 for DOS to call a DOS program in such a way that there is no screen output from that SHELL child?
        Depends on if the child program produces output, and if so, if it sends it to STDOUT, which can be redirected; STDERR, which is cannot be redirected; or writes directly to the video RAM (you have no paddle if you're up this particular creek).

        Later you say, "operating system" in lieu of "DOS Program;" many MS-DOS utilities (e.g., copy) often write to STDERR rather than to STDOUT.

        If you write your own MS-DOS program which is SHELLed, of course, you have total control of screen output.

        MCM



        [This message has been edited by Michael Mattias (edited July 15, 2003).]
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          Thanks Michael...

          What you posted was in the back of my mind and exactly what I was
          hoping someone would post here.

          The thing that makes this on rough is that if a new version of the
          child program is distributed and used, over which you have no control
          and that version changes video output technique and displays the data,
          you are again .. up the creek without a paddle.

          What we are really saying is that the only total control you have
          over the situation is to write the child program. Which may have
          to be done anyway, if the real reason for the shell operation was that
          there simply isn't enough room in memory to do the whole job in one
          program and CHAIN isn't a real option ..

          I guess this is kinda like the law here in Texas which holds that you
          can't disown an adopted child!

          Thanks for the help.


          ------------------
          Mike Luther
          [email protected]
          Mike Luther
          [email protected]

          Comment


          • #6
            Your an OS/2 guy, so I don't know if this will work for you, but the following technique does work on a 32-bit Windows system:

            Under Windows 95 or better, a DOS app can SHELL to a Windows GUI app (such as created with PB/Win rather than PB/CC) and this app is actually launched as a separate process (and hence no connection to the DOS window that launched it).

            The key is to have this Windows app launch the target DOS app via it's SHELL statement (or asynchronous SHELL function). The "hidden window" requirement is solved by using "hide window" option that the PB/Win SHELL statement supports.

            The entire Windows app would look like this:
            Code:
            #COMPILE EXE
            %HIDDENWINDOW = 0
            FUNCTION PBMAIN
                SHELL "dosapp.exe", %HIDDENWINDOW  ' synchronous SHELL
            END FUNCTION
            Of course, the app name could be passed as a parameter to make it as flexible as possible, thus:
            Code:
            #COMPILE EXE
            %HIDDENWINDOW = 0
            FUNCTION PBMAIN
                SHELL COMMAND$, %HIDDENWINDOW  ' synchronous SHELL
            END FUNCTION
            I hope this helps!


            ------------------
            Lance
            PowerBASIC Support
            mailto:[email protected][email protected]</A>
            Lance
            mailto:[email protected]

            Comment


            • #7
              Originally posted by Mike Luther:
              Is it possible with the SHELL function in PB 3.5 for DOS to call a
              DOS program in such a way that there is no screen output from that
              SHELL child?

              In other words, I'd like to use the operating system to do a task,
              yet not tell the program user what is going on in that task!

              Haven't tried it, but could I, perhaps, send the visual output of
              the child to a pipe null somehow like I do when I call an executable
              in a batch file and pipe the output to a file name?

              Inquiring mind wants to know!

              Thanks..


              Hi, Mike -

              Yeah, I've done it.

              Try writing to a screen that's not being displayed.

              Use the SCREEN statement in the child program, and diddle the apage and vpage controls.



              ------------------
              Don't sweat it, it's only ones and zeros

              Comment

              Working...
              X