files lister stack lock up

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
billworld
Posts: 188
Joined: Sat Oct 25, 2008 12:32 am

files lister stack lock up

Post by billworld » Tue Oct 28, 2008 7:52 pm

Okay. Today's not my day for trying to learn RR. I downloaded the Files and Folder tutorial stack. I changed to folder to list files to my /Applications/ folder and RR locks up me. I have to force quit to get out. I didn't change any code or anything. All I did was try to change the directory.

Tried a second time with the same result.

What gives? If there's some condition that needs to prevent navigating out of a particular folder or the like, the sample code should accommodate this.

These examples need to be more robust IMO. Doesn't bode well for first-timers researching the product.

I see the following at the bottom of the docs. Would inserting this solve the problem? If so, why the heck wasn't it in the example code to begin with?

Code: Select all

Hint: Although in this tutorial it has been neglected, it is good practice always to preserve the value of the directory in each function or handler you write. The directory is a global property and changing it is a common source of bugs in programs. The easy way to eliminate all errors of this sort is simply to add the following code around everywhere you change the directory

local tDirectory
put the directory into tDirectory
set the directory to pDirectory
# Insert code using the new directory here
set the directory to tDirectory

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Tue Oct 28, 2008 10:35 pm

Hi Bill,
you manage get the strangest errors. I tried your recipe and I couldnt reproduce the hang, Files and folders works without a flaw, at many folders I tried application an others. I can only guess at what is going on. Could it have to do something with permissions? Are you logged in as administrator?

'The directory' is new for me, I dont find it in the dictionary of Rev, but it works, it seems to be the same as the defaultFolder, which of cours is in the dictionary. Could someone please confirm:

the directory=the defaultfolder ?

or not.

As for the browser stack I also had problems with the get image example, sometimes it works sometimes it doesnt. Mostly when I try the example the first time it works, when I perform a search and retrieve a second image it didnt.

Most other examples I tried did work though and I learned a lot from them.
regards
Bernd

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

Post by Mark » Tue Oct 28, 2008 10:50 pm

Yes directory = defaultfolder
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

Post Reply