need helping opening programs
Author |
Message |
Fiend-Master
|
Posted: Wed Oct 13, 2004 8:18 pm Post subject: need helping opening programs |
|
|
Can anyone help me? I need to be able to open some files, using turing, in a separate program window. For example: I need to be able to open a ".rtf" file using microsoft word. the menu list (to open these files) will be made from turing and will be where the user chooses which files he wants to open. I need to know the coding to be able to open these files in their own programs (aka a .psd file in adobe acrobat reader and so on). Any questions? Just ask.
input: user makes a selection on what file he wants opened. (for example a read me file (.rtf)
processing: program will decide which file the user wants to open and open in
output: the file will be opened in a separate window (IE. the read me file opened in microsoft word or notepad) |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Dan
|
Posted: Wed Oct 13, 2004 8:54 pm Post subject: (No subject) |
|
|
If you have a newer verson of turing and the file asotations are set up right on your computer you should be able to use the Sys.Exec comand to do this.
Just give the input to the Exec fuction as the full file path and if the file asotations are set up right it should open them in the deafult progame on your computer to run that file. Also make shure to do if Sys.Exec(...) then or var a:int:= Sys.Exec(...) b/c it returnes an int corsponding to error code. |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
Fiend-Master
|
Posted: Wed Oct 13, 2004 9:12 pm Post subject: (No subject) |
|
|
ok i got it working if the file is in the same folder, but could you explain again how to do it if the file is in a folder within a folder etc.? Sorry if you already explained it but i couldnt fully understand what you said |
|
|
|
|
|
Dan
|
Posted: Wed Oct 13, 2004 10:41 pm Post subject: (No subject) |
|
|
you need to put the full file path in for the file name. like if it was in \dans\myfile.doc
you whould put in "dans\\myfile.doc"
or i think that is how they do the file dirs in turing, i do not have turing on this computer.... |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
Fiend-Master
|
Posted: Thu Oct 14, 2004 5:21 pm Post subject: (No subject) |
|
|
hmmm....i tried....and for some reason, it works (c:\\program files\\etc....) but it will count the spaces as the close bracket) for example, try this code:
if not Sys.Exec ("C:\\Program Files\\Turing\\Turing.exe") then
put "Error: ", Error.LastMsg
end if
assuming that this is the correct file pathname, the program will error out thinking that the pathname u entered is: "C:\\Program". Can anyone help me get around this problem? lol as u can see im not the most advanced person when it comes to programming in turing, although ive programmed a few good things before. |
|
|
|
|
|
wtd
|
Posted: Thu Oct 14, 2004 5:28 pm Post subject: (No subject) |
|
|
Try something like:
code: | Sys.Exec("\"C:\\Program Files\Turing\Turing.exe\"") |
|
|
|
|
|
|
Fiend-Master
|
Posted: Thu Oct 14, 2004 10:01 pm Post subject: (No subject) |
|
|
SWEETTT!!!! YOUR SO BEASTLY! thanks man!!!!! the code actually looked like this:
if not Sys.Exec ("\"C:\\Program Files\\Turing\\Turing.exe\"") then
put "Error"
end if
but yea U definitely helped a lot. thanks |
|
|
|
|
|
|
|