how do I test an existing object

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
orducom1
Posts: 6
Joined: Fri Apr 12, 2013 10:20 am

how do I test an existing object

Post by orducom1 » Mon May 06, 2013 6:09 pm

hi guys !

How can I test if file exist ?
I want to test if file exist like a VBS file system method such as FS.FileExists(PathFile) (or FS.FolderExists(PathFolder)) which return true or false as the case.

I don't find a similar method in liveCode and I can not to believe it :shock:

Thanks by advance for your help ! :D

Emeric

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: how do I test an existing object

Post by Klaus » Mon May 06, 2013 6:12 pm

Hi emeric,

1. welcome to the forum :D

2. well, you already mentioned it:

Code: Select all

...
if there is a file "path/to/file.txt" then
  ## file exists ;-)
end if
...
Get used to things like this :D


Best

Klaus

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: how do I test an existing object

Post by mwieder » Mon May 06, 2013 7:17 pm

and don't forget

Code: Select all

if there is a folder "path/to/folder" then
  #...
Get used to things like this :D

orducom1
Posts: 6
Joined: Fri Apr 12, 2013 10:20 am

Re: how do I test an existing object

Post by orducom1 » Tue May 07, 2013 11:25 am

it works !

many thx Klaus :)

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: how do I test an existing object

Post by jmburnod » Tue May 07, 2013 11:46 am

Hi orducom1,
Good news
I guess a new frenchie in your user name. Right ?
Welcome in this helpful and generous forum
Kind regards
Jean-Marc
https://alternatic.ch

Post Reply