Page 1 of 2

The path to liberation

Posted: Sun Oct 29, 2017 7:04 pm
by richmond62
If only . . .

I made a quickie standalone last night on my 2006-ish iMac with a few pictures stored in a folder
called "PIX" inside my home folder:

/richmondmathewson/PIX/stupid.png

carted the thing over to a Linux box at my school and dumped the PIX folder in the equivalent place there:

/MAGWITCH/PIX/stupid.png

and: NBG!

SO; as a very large number of programming language seem to be able to cope with that sort of move, I wonder
why LiveCode cannot . . .

1. The nature of the language (wow; there's a can of worms) STOPS that being implemented.

2. The LiveCode engineers HAVEN'T implemented it because:

2.1. It would be an extremely long and time-consuming bit of work.

2.2. The "Gods of Rock and Roll" don't think it is important.

HOWEVER: it IS important, and it's not just me.

Re: The path to liberation

Posted: Sun Oct 29, 2017 7:49 pm
by Klaus
No wonder if you set a (more or less) absolute pathname!

Why don't you use -> specialfolderpath("home") (or -> $HOME for *NIX based OSses) to set the image path? That will work on all desktop platforms. 8)

Re: The path to liberation

Posted: Sun Oct 29, 2017 7:51 pm
by richmond62
And on an Android tablet/Phone or an Apple one?

Re: The path to liberation

Posted: Sun Oct 29, 2017 8:03 pm
by Klaus
Since you cannot access "external"* folders on mobile, and Android does NOT have something like a "home" folder, I consider this question "moot" :D

* Means folder outside of the applications bundle -> Sandboxing!

Re: The path to liberation

Posted: Sun Oct 29, 2017 8:22 pm
by Klaus
Maybe this would be a good enhancement request to set an image/audio/video pathname
to an expression à la -> specialfolderpath("home" & "/folder in home folder/image.png"

Re: The path to liberation

Posted: Sun Oct 29, 2017 9:20 pm
by bogs
richmond62 wrote:NBG!
No bloody good ? I can't really answer your problem with a solution, but I'm really curious if I read the NBG right :P

Re: The path to liberation

Posted: Mon Oct 30, 2017 11:04 am
by mrcoollion
NBG ?

Could also be No Biscuits Generated ? :mrgreen:

Re: The path to liberation

Posted: Mon Oct 30, 2017 11:59 am
by bogs
...biscuits...mmmmm...

Re: The path to liberation

Posted: Mon Oct 30, 2017 3:21 pm
by FourthWorld
LiveCode does indeed support relative paths. How did you set the image references?

Re: The path to liberation

Posted: Mon Oct 30, 2017 7:33 pm
by richmond62
Nicely Boiled Greengages

Re: The path to liberation

Posted: Mon Oct 30, 2017 8:01 pm
by richmond62
I set the path via the Properties inspector:
HighwayToHell.gif
Here's my stack along with the test image so you can try this out on your machine(s) of choice:
RelativeP.zip
(12.9 KiB) Downloaded 190 times

Re: The path to liberation

Posted: Mon Oct 30, 2017 8:10 pm
by richmond62
This:

http://lessons.livecode.com/m/2592/l/12 ... ative-path

seems difficult to understand.

But this:

http://livecode.wikia.com/wiki/Using_relative_paths

seems a bit easier to understand.

Re: The path to liberation

Posted: Mon Oct 30, 2017 8:24 pm
by bogs
richmond62 wrote:
Mon Oct 30, 2017 7:33 pm
Nicely Boiled Greengages
Awesome, going to go look up 'greengages' now !

Dunno about the path issue you have on mac to linux, all I did was remove all the path except for the file name from the [source] box, and proceeded to move the relative folder all over my system (linux).
Image
Image came up every time with no other modification, in the IDE.

*Edit, I also saved it in legacy 5.5 format, took me a while to realize the lowest vers. of Lc I had that could open it was 7.x :shock:
*Edit 2, Ah, PLUMS ~!

Re: The path to liberation

Posted: Mon Oct 30, 2017 8:52 pm
by richmond62
This SHOULD work cross-desktop (Mac/Win/Linux), and has just been made on a Mac:
HighwayToHell2.jpg
Here's the stack:
RelativeP2.zip
(14.04 KiB) Downloaded 182 times

Re: The path to liberation

Posted: Mon Oct 30, 2017 9:00 pm
by richmond62
all I did was remove all the path
Indeed: but that is NBG because neither Thou nor I can expect our customer in a dress shop
in Omaha, Nebraska (Her name's "Marlene") to fiddle around with file paths.
xyz.jpg
Marlene
xyz.jpg (8.49 KiB) Viewed 6172 times