Announcement

Collapse
No announcement yet.

Executed from console?

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

  • Lance Edmonds
    replied
    Oh, PB/CC (different forum!)...

    STARTUPINFO should be able to help you here, but the easiest way (although not bullet-proof) is just test CURSORX and CURSORY at the start of the program...
    Code:
    FUNCTION PBMAIN
      IF CURSORX * CURSORY = 1 THEN 
        ' Cursor at top/left (assume console is clear, so *probably NOT* 
        ' launched from the command-line)
        StandAlone& = -1
      END IF
      ...
      IF StandAlone& THEN WAITKEY$
    END FUNCTION
    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Peter P Stephensen
    replied
    Lance,

    If my PBCC-app is not executed in a console it should end with
    a waitkey$

    Regards
    Peter

    ------------------
    [email protected]

    Leave a comment:


  • Lance Edmonds
    replied
    A GUI app is launched as a separate process when started from the command-line.

    Possibly info in the STARTUPINFO block returned via 'GetStartupInfo()' could offer some clues, but I've not experimented with it.

    What do you want to achieve by knowing how the app was started?

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

    Leave a comment:


  • Peter P Stephensen
    started a topic Executed from console?

    Executed from console?

    Hi all,

    Is there any way a program can know if it is executed
    from a console or not?

    Regards
    Peter

    ------------------
    [email protected]
Working...
X