Real Software Forums
http://forums.realsoftware.com/

Launch in Linux
http://forums.realsoftware.com/viewtopic.php?f=8&t=46643
Page 1 of 1

Author:  rthornqu [ Tue Jan 22, 2013 12:52 pm ]
Post subject:  Launch in Linux

I'm testing out Real Studio for the first time, so forgive me if I'm missing something obvious!

I'm trying to get a button to launch a PDF file that's in a subdirectory. My code works in Windows, but not in Linux. Here's the code:

Dim f as FolderItem
f= GetFolderItem("A 1/test.pdf")
if f = nil then
msgbox "Nil"
elseIf not f.exists then
msgbox ("Does not exist")
else
f.launch
end if

So there's a subdirectory called "A 1" (note the space) below the executable with a file called test.pdf in it. When I run this, it doesn't work. I don't get a nil error, I don't get an error that the file doesn't exist, it just does nothing.

Note that if I change the code so there's a backslash before the space, it still doesn't work but this time I get a Nil error.

Also note that if I rename the directory to "A1" (without the space) and take out the space in the code, it works. It seems the space is causing the problem.

If someone could help me out with this I'd very much appreciate it!

- Rick

Author:  charonn0 [ Tue Jan 22, 2013 1:02 pm ]
Post subject:  Re: Launch in Linux

Try:

App.ExecutableFile.Parent.Child("A 1").Child("test.pdf").Launch


GetFolderItem can be unreliable if you're not using an absolute path.

Author:  rthornqu [ Tue Jan 22, 2013 1:41 pm ]
Post subject:  Re: Launch in Linux

Thanks for the suggestion, but it still doesn't work. No error or anything, it just does nothing.

- Rick

Author:  charonn0 [ Tue Jan 22, 2013 1:55 pm ]
Post subject:  Re: Launch in Linux

Hmm, maybe you need to escape the space (shot in the dark...)

App.ExecutableFile.Parent.Child("A\ 1").Child("test.pdf").Launch

Author:  rthornqu [ Tue Jan 22, 2013 2:11 pm ]
Post subject:  Re: Launch in Linux

Nope, didn't work. This time I got a NilObjectException, similar to when I used the backslash with GetFolderItem.

This is too weird.

- Rick

Author:  rthornqu [ Tue Jan 22, 2013 4:33 pm ]
Post subject:  Re: Launch in Linux

Additionally, I tried the FileBrowser example project on Linux. Any file where there's a space in the directory name (or the file name) won't launch. There's no error - it just does nothing. If there's no spaces, it launches fine.

- Rick

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/