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

Username:   Password: 
 RegisterRegister   
 Running Batch Files
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mirhagk




PostPosted: Mon Dec 14, 2009 10:48 am   Post subject: Running Batch Files

What is it you are trying to achieve?
Trying to create and run a batch file


What is the problem you are having?
Turing always tells me that it fails


Describe what you have tried to solve this problem
Sys.Exec


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:


open : stream, "compile tools/run.bat", put
        put : stream, "a86 temp.asm"
        close : stream
        if ~Sys.Exec ("compile tools/run.bat") then
            put "For unknown reasons system could not compile program"
        else
            put "The file compiled correctly and is now placed" ..
            put " in the same folder with the same name as the source"
        end if



Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Mon Dec 14, 2009 10:59 am   Post subject: RE:Running Batch Files

Spaces in directory names are usually a bad plan. Try on a batch file in a directory without spaces anywhere in the path, such as C:\compile_tools\run.bat .

Also, errors don't have to be unknown. Turing has some facilities to track the current error.
mirhagk




PostPosted: Mon Dec 14, 2009 11:30 am   Post subject: RE:Running Batch Files

oh yeah sorry man, lol made this at 5 am last night, haven't really slept today, not really thinking.
DtY




PostPosted: Mon Dec 14, 2009 6:33 pm   Post subject: RE:Running Batch Files

Dunno if it works in Windows, but if you want a space in a directory, you can escape it with a slash in front of it. Since this isn't escaping in Turing, you have to escape the slash for turing.

So, "\\ "

[edit] Disregard that. Backslash is the directory separator in Windows, so that won't work. There's probably some way to do it though.
mirhagk




PostPosted: Mon Dec 14, 2009 11:31 pm   Post subject: RE:Running Batch Files

it works when writing, moving, deleting files, but spaces are not allowed in Sys.Exec
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  [ 5 Posts ]
Jump to:   


Style:  
Search: