Opening External Files from MaxGUI

BlitzMax Forums/BlitzMax Beginners Area/Opening External Files from MaxGUI

3Ddoofus(Posted 2006) [#1]
Hi again,
Is there a way to open an external file for viewing in MaxGUI?
I've used 'Execfile' in BlitzPlus but can't find its equivalent in Max!
Any help would be appreciated


tonyg(Posted 2006) [#2]
Look for Openfile(), readfile(), writefile() or have I misunderstood?


3Ddoofus(Posted 2006) [#3]
I was unsure if these were the commands i needed.
What I need to do is click on a button in my window and it will open an external pdf using acrobat reader.
I have done this in the past with BlitzPlus but am at a loss as to what to use in MaxGUI.
Thanks


Dreamora(Posted 2006) [#4]
executing would be system_ or createprocess


ckob(Posted 2006) [#5]
you need to use system_ "executable.exe" Also if the executable has spaces you will need to use chr() to tell it to place quotes before and after the executable.


Chris C(Posted 2006) [#6]
[code]
system_ "C:/Program Files/Adobe/Acrobat 7.0/Reader/AcroRd32.exe 6432.pdf"

While True
WaitSystem()
Wend
[code]

works on winxp
in case they have a different version installed it might be safer to scan "C:/Program Files/Adobe" for AcroRd32.exe and use whatever path you find


3Ddoofus(Posted 2006) [#7]
Thanks, will give it a go.


3Ddoofus(Posted 2006) [#8]
Great, that worked a treat.
If the file location was the same except for the drive letter is there a way to specify the address without naming the drive.
Hope that makes sense.
Thanks again