Checking the file if it is already exist in a specific loc.

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Checking the file if it is already exist in a specific loc.

Post by snop21 » Sun Feb 09, 2014 2:42 am

Hello everyone,

Can I ask how to check if the file is already exist in a location.

Any help will be very much appreciated

Thank you..

-snop21

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Checking the file if it is already exist in a specific l

Post by FourthWorld » Sun Feb 09, 2014 2:47 am

Code: Select all

if there is a file tMyFilePath then
   DoSomething
else
   answer "The file "& quote& tMyFilePath &quote&" cannot be found."
end if
Yep, there is a "there is" operator. Welcome to LiveCode. :)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Re: Checking the file if it is already exist in a specific l

Post by snop21 » Sun Feb 09, 2014 7:34 am

-- FourthWorld

Thank you for welcoming me here..! I am new in livecode..! I really find it interesting!.. :))

if there is a ----> file <--- tMyFilePath then
DoSomething
else
answer "The file "& quote& tMyFilePath &quote&" cannot be found."
end if

I have a followup question the file word there is the name of the file that I am referring to?

Many Thanks..

-snop21

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Checking the file if it is already exist in a specific l

Post by Simon » Sun Feb 09, 2014 7:55 am

Hi snop21,
put "C:\Users\snop21\Documents\theFile.txt" into tMyFilePath

Now does Richard's code make sense?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply