Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Calling EXE's from menu.

Author
Message
Boo
21
Years of Service
User Offline
Joined: 29th Feb 2004
Location:
Posted: 4th Mar 2004 01:03
The use of the execute isn't clear. (1)What is the code for executing an external program from an existing menu. And, (2) what determines when the external program ends and what directs it back to the menu?

For example, if menu item one is selected, run program one, if menu item two is selected, run program two, etc.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 4th Mar 2004 02:57
I'm not quite following you. I know there is an EXECUTE FILE command.
Syntax:

EXECUTE FILE Filename, Commandline, Directory, Wait Flag

Check out the Help section in DB. It goes into more detail about the different parameters. For your second question, I believe the Wait Flag parameter determines that. If you could specify exactly what you're talking about I could probably help you more.

Crazy Donut Productions
Current Project: KillZone
Boo
21
Years of Service
User Offline
Joined: 29th Feb 2004
Location:
Posted: 4th Mar 2004 04:55
ok. I'm coding an execute command to execute a file located in my C directory vis execute "c:\program files\dark basic program\dark basic\myproj\test.exe"

I'm unclear of the other parameters in the execute command. Obviously the command structure that I'm using dnw.
Trowbee
22
Years of Service
User Offline
Joined: 12th Apr 2003
Location: United Kingdom
Posted: 4th Mar 2004 05:44 Edited at: 4th Mar 2004 05:45
EDIT: bah, all came out wrong..lets try again.

In your case, you would use:

EXECUTE FILE "test.exe","","Crogram FilesDark Basic ProgramDark Basicmyproj"

test.exe refers to the file (only the name and extension) you want to execute.
"" passes any additional command line information to the file being executed (in DB, it can be read using [/b]CL$[b])
"Crogram FilesDark Basic ProgramDark Basicmyproj" refers to the directory the file is in.
Boo
21
Years of Service
User Offline
Joined: 29th Feb 2004
Location:
Posted: 5th Mar 2004 00:53
Thanks for the help from the UK.

The execute file command now calls the defined program (notepad.exe), but doesn't return to the program containing the execute file command (test.exe).

Being specific, my main program (test.exe) contains this command: execute file "notepad.exe","","c:\windows",1

(test.exe) executes the execute file command correctly, transfers control and activates (notepad.exe), but the optional "flag" set in the execute file command should serve as a "wait until completion" of notepad.exe and cause a return to (test.exe) after closing of the notepad.exe. It doesn't, the computer just returns to the Windows XP desktop, with a menubar icon indicating the "test.exe" is still active.

Thanks for your patience.

Login to post a reply

Server time is: 2025-05-23 09:20:40
Your offset time is: 2025-05-23 09:20:40