File location reference....

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
arkstar
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 70
Joined: Mon Dec 21, 2009 1:51 am

File location reference....

Post by arkstar » Wed Feb 24, 2010 4:21 am

I created a report with Quartam. I created the script and saved the .qrl file on the desktop where my main stack is located.

put "testrpt.qrl" into tLayoutFile

When I run the script, I get an error, "Can't find testrpt.qrl" If I enter the absolute path, it works perfectly.
I am drawing a blank here.... what would the relative file path be?

Thanks for the help/clue!

Rob
Rob Glassman
ArkStar

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: File location reference....

Post by Mark » Wed Feb 24, 2010 11:55 am

Rob,

The relative path starts from the defaultFolder. Usually this starts off as the folder where the Revolution executable is located and definitely not your desktop folder.

A solution that always works:

Code: Select all

set the itemDel to slash
put item 1 to -2 of the effective filename of this stack into myPath
put myPath & "/testrpt.q2rl" into tLayoutFile
-- now continue with your own script
Best regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

arkstar
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 70
Joined: Mon Dec 21, 2009 1:51 am

Re: File location reference....

Post by arkstar » Thu Feb 25, 2010 3:51 pm

Thanks again Mark!

Worked perfectly!

Rob
Rob Glassman
ArkStar

Post Reply