Page 1 of 1

how do I test an existing object

Posted: Mon May 06, 2013 6:09 pm
by orducom1
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

Re: how do I test an existing object

Posted: Mon May 06, 2013 6:12 pm
by Klaus
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

Re: how do I test an existing object

Posted: Mon May 06, 2013 7:17 pm
by mwieder
and don't forget

Code: Select all

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

Re: how do I test an existing object

Posted: Tue May 07, 2013 11:25 am
by orducom1
it works !

many thx Klaus :)

Re: how do I test an existing object

Posted: Tue May 07, 2013 11:46 am
by jmburnod
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