Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Sys.Exec
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
BryX




PostPosted: Fri Sep 19, 2003 4:08 pm   Post subject: Sys.Exec

can anyone explain to me how to use Sys.Exec cause i can't get it to work Confused 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
code:
Sys.Exec ("stuff.mid")


p.s ne idea why my sig doesn't work?

[img]www.boomspeed.com/bryx2002/sig2003.jpg[/img]
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Fri Sep 19, 2003 4:39 pm   Post subject: (No subject)

first of all - .mid is a sound file, right? So you're better off playing the sound file using
code:

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:
code:

if Sys.Exec("file.exe") then
   put "program is now running
else
   put "error occured"
end if
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
BryX




PostPosted: Fri Sep 19, 2003 4:45 pm   Post subject: (No subject)

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??
code:
var m1:boolean
m1:=Sys.Exec ("ff7seph.mid")
Tony




PostPosted: Fri Sep 19, 2003 4:52 pm   Post subject: (No subject)

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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
BryX




PostPosted: Fri Sep 19, 2003 6:49 pm   Post subject: (No subject)

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 Very Happy
Andy




PostPosted: Sat Sep 20, 2003 10:15 pm   Post subject: (No subject)

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




PostPosted: Sat Sep 20, 2003 10:39 pm   Post subject: (No subject)

dodge said something useful?! No way Surprised

he probly just copied that out of one of my posts anyways Laughing

But yeah, the way processes are structured, you would increase performance if you avoid them.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: