Check if file or folder

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
wake
Posts: 21
Joined: Thu Jun 25, 2009 6:15 pm

Check if file or folder

Post by wake » Thu Jul 02, 2009 10:59 pm

How do I evaluate a string value as being a file or a folder?

I have a Scrolling List Field that supports drag and drop and I want to loop through the list and determine which entries are files and which are folders.

Probably another simple solution that I am just not seeing.

I am really having a hard time with the whole "Write code in English thing". LOL

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

Post by Mark » Fri Jul 03, 2009 12:07 am

Hi wake,

Code: Select all

if there is a folder "folder name" then
  -- it is a folder
else if there is a file "file name" then
  -- it is a file
else
  -- it doesn't exist
end if
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

wake
Posts: 21
Joined: Thu Jun 25, 2009 6:15 pm

Post by wake » Fri Jul 03, 2009 4:11 pm

Mark,
Thanks for the help. This worked perfectly!

Post Reply