Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Dec 12, 2017 6:35 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Launch in Linux
PostPosted: Tue Jan 22, 2013 12:52 pm 
Offline

Joined: Tue Jan 22, 2013 12:39 pm
Posts: 4
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Launch in Linux
PostPosted: Tue Jan 22, 2013 1:02 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
Try:

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


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

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: Launch in Linux
PostPosted: Tue Jan 22, 2013 1:41 pm 
Offline

Joined: Tue Jan 22, 2013 12:39 pm
Posts: 4
Thanks for the suggestion, but it still doesn't work. No error or anything, it just does nothing.

- Rick


Top
 Profile  
Reply with quote  
 Post subject: Re: Launch in Linux
PostPosted: Tue Jan 22, 2013 1:55 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
Hmm, maybe you need to escape the space (shot in the dark...)

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

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: Launch in Linux
PostPosted: Tue Jan 22, 2013 2:11 pm 
Offline

Joined: Tue Jan 22, 2013 12:39 pm
Posts: 4
Nope, didn't work. This time I got a NilObjectException, similar to when I used the backslash with GetFolderItem.

This is too weird.

- Rick


Top
 Profile  
Reply with quote  
 Post subject: Re: Launch in Linux
PostPosted: Tue Jan 22, 2013 4:33 pm 
Offline

Joined: Tue Jan 22, 2013 12:39 pm
Posts: 4
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group