Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problem with exec(); #187142
03/05/08 13:23
03/05/08 13:23
Joined: Sep 2007
Posts: 48
Deutschland
H
HoopyDerFrood Offline OP
Newbie
HoopyDerFrood  Offline OP
Newbie
H

Joined: Sep 2007
Posts: 48
Deutschland
Hello,

I try to execute a Program with the A7 using the exec(); command.

Code:

function exectest()
{
exec("KleinesEinmaleins.exe", ""); //a simple C console application
beep(); // to let me hear the function was started
}

function DebugKeyBinds_startup()
{
on_m = exectest;
}



And nothing happend. I hear the beep, so the function is executed but this is everything. Absolut no reaction. The Programm "KleinesEinmaleins.exe" is located in the main Folder so the engine should find it. I tryed to place it in an Folder I included with PATH "" but there was no difference.

Could anyone help me with this Problem?

Thank you in advance.

Re: Problem with exec(); [Re: HoopyDerFrood] #187143
03/05/08 14:13
03/05/08 14:13
Joined: Aug 2007
Posts: 44
QLD, Australia
Serex Offline
Newbie
Serex  Offline
Newbie

Joined: Aug 2007
Posts: 44
QLD, Australia
I cannot see any problems with your code. I however would like to see you check to see if the file exists before trying to execute it. So something like...

Code:
  
function exectest()
{
var file_handle = file_open_read("KleinesEinmaleins.exe");

if (file_handle != 0) // if the file exists
{
exec("KleinesEinmaleins.exe", ""); // A simple C console application
}
else
{
beep();
}
}



The application will beep if the file isn't found.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1