Equivalent of BASIC's run?

This is a discussion on Equivalent of BASIC's run? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Is there an equivalent of the run statement in BASIC? It's a statement that will run another program. Will it ...

  1. #1
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913

    Equivalent of BASIC's run?

    Is there an equivalent of the run statement in BASIC? It's a statement that will run another program. Will it return to the system afterwards, or will it go back to the program.

  2. #2
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    spawnf()

    It is in process.h

    It can run DOS or Windows programs.

    You can also use system() which accepts dos commands. So if you used system, you would do:

    system("cd\windows\myprog.exe");

    I use both. spawnf() is the more correct way to run EXE's.
    My Website

    "Circular logic is good because it is."

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    don't you mean

    system("c:\\windows\\myprog.exe");

    ?


  4. #4
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Thanks - system() sounds like what I was looking for (even better actually), but do I need to double up on the \'s and all the other escape sequences?

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    > but do I need to double up on the \'s and all the other escape sequences?
    Yes

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Re-doing a C program to run in Win2000 or XP
    By fifi in forum C Programming
    Replies: 5
    Last Post: 08-17-2007, 05:32 PM
  2. how to run an exe command in c++ and get back the results?
    By mitilkhatoon in forum C++ Programming
    Replies: 5
    Last Post: 09-21-2006, 06:00 PM
  3. calculating the mode
    By bigggame in forum C Programming
    Replies: 10
    Last Post: 06-13-2006, 03:04 AM
  4. How I can Run exe file in C++
    By palang in forum C++ Programming
    Replies: 2
    Last Post: 05-10-2006, 11:55 AM
  5. Replies: 2
    Last Post: 10-29-2002, 03:56 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21