
-----------------------------------
BryX
Fri Sep 19, 2003 4:08 pm

Sys.Exec
-----------------------------------
can anyone explain to me how to use Sys.Exec cause i can't get it to work :?  i'm trying to load a mid file while running other code so i thought using this command would be good but it doens't want to work maybe i have to sepcify what program to play the file? i'm not sure
Sys.Exec ("stuff.mid") 

p.s ne idea why my sig doesn't work?

[img]www.boomspeed.com/bryx2002/sig2003.jpg[/img]

-----------------------------------
Tony
Fri Sep 19, 2003 4:39 pm


-----------------------------------
first of all - .mid is a sound file, right? So you're better off playing the sound file using

Music.PlayFile ( fileName : string )


as for Sys.Exec - its a non-void function (not a procedure) so it returns an int value. The proper way of using it is:

if Sys.Exec("file.exe") then
   put "program is now running
else
   put "error occured"
end if


-----------------------------------
BryX
Fri Sep 19, 2003 4:45 pm


-----------------------------------
i got it to work tho:D plays in WMP but i want it to play in the background, is there anyway that i can tell WMP to move to the background or maybe bring my program tot he foreground? or is there a way to continue executing code while playing the midi using music.playfile??
var m1:boolean
m1:=Sys.Exec ("ff7seph.mid")

-----------------------------------
Tony
Fri Sep 19, 2003 4:52 pm


-----------------------------------
a number of ways around the problem...

Most prefer to use Proceses (read tutorial on that) that allow you to play the music in the background.

If you want to bring your program to front, try opening a new window after executing the file.

-----------------------------------
BryX
Fri Sep 19, 2003 6:49 pm


-----------------------------------
whoa thx alot man, I never knew about procedures and process before, been wondering if there was a way to run multiple code at the same time and now I can :D

-----------------------------------
Andy
Sat Sep 20, 2003 10:15 pm


-----------------------------------
but forks arent that good, they slow down ur program alot, i'd make something a porcedure and run it in the loop than forking something.

-----------------------------------
Tony
Sat Sep 20, 2003 10:39 pm


-----------------------------------
dodge said something useful?! No way  :o 

he probly just copied that out of one of my posts anyways  :lol: 

But yeah, the way processes are structured, you would increase performance if you avoid them.
