hi all
I have stored the pictures ( JPG, BMP) files in one folder. Now, i want to search whether particular bmp or jpg exist in the directory or not. How can i find it

regard
gop

Re: question no 5 related to photos by Zeke

Zeke
Sat May 15 14:01:21 CDT 2004

Checkout the file() function and the adir() function. They will do the job
for you.
Ex:
if file('mypic.jpg')
*** code
endif
Zeke



"gibbs" <anonymous@discussions.microsoft.com> wrote in message
news:5738CC8B-A7F0-4C59-8CB9-15B259DA7D3E@microsoft.com...
> hi all,
> I have stored the pictures ( JPG, BMP) files in one folder. Now, i want to
search whether particular bmp or jpg exist in the directory or not. How can
i find it?
>
> regards
> gopi
>



Re: BUT HOW TO FIND OUT THE EXTENSION OF PICTURE by anonymous

anonymous
Sun May 16 03:56:03 CDT 2004

THANK YOU ZEKE

THE NAME OF MY PICTURE IS CNN-122.BMP BUT FOR TESTING PURPOSE I PUT CNN-122.JPG THEN ALSO IT WORKED
I PUT THE FOLLOWING CODE IN MY TEXT BOX VALID EVENT

IF FILE(this.Value
=MESSAGEBOX("Photo Added",48+0,"System Message"
ELS
=MESSAGEBOX("Picture Not Found!!!"+CHR(10)+"Please Check Picture Name & Extension Name",48+0,"System Message"
this.Value = SPACE(30
ENDI
thisform.Refres

PLEASE PLEASE TELL ME HOW TO FIND OUT THE FILE WITH EXTENSION OF FILE ALSO
REGARD
GIBB

----- Zeke Galama wrote: ----

Checkout the file() function and the adir() function. They will do the jo
for you
Ex
if file('mypic.jpg'
*** cod
endi
Zek



"gibbs" <anonymous@discussions.microsoft.com> wrote in messag
news:5738CC8B-A7F0-4C59-8CB9-15B259DA7D3E@microsoft.com..
> hi all
> I have stored the pictures ( JPG, BMP) files in one folder. Now, i want t
search whether particular bmp or jpg exist in the directory or not. How ca
i find it
>> regard
> gop
>

Re: BUT HOW TO FIND OUT THE EXTENSION OF PICTURE by Andrew

Andrew
Mon May 17 04:56:30 CDT 2004

GIBBS wrote:
> THANK YOU ZEKE,
>
> THE NAME OF MY PICTURE IS CNN-122.BMP BUT FOR TESTING PURPOSE I PUT
> CNN-122.JPG THEN ALSO IT WORKED.
> I PUT THE FOLLOWING CODE IN MY TEXT BOX VALID EVENT.
>
> IF FILE(this.Value)
> =MESSAGEBOX("Photo Added",48+0,"System Message")
> ELSE
> =MESSAGEBOX("Picture Not Found!!!"+CHR(10)+"Please Check Picture Name
> & Extension Name",48+0,"System Message") this.Value = SPACE(30)
> ENDIF
> thisform.Refresh
>
> PLEASE PLEASE TELL ME HOW TO FIND OUT THE FILE WITH EXTENSION OF FILE
> ALSO.

Turn your caps lock off.
I think you want something like this.

* your filename
m.file='test.bmp'

* your directory that you are checking
m.dir='c:\tmp\'

* list of extensions that you want to check
* extend these as required.
DIMENSION validext[3]
validext[1]='jpg'
validext[2]='bmp'
validext[3]='png'

* loop to check all extensions
FOR m.extno=1 TO ALEN(validext,1)
m.chkfile=m.dir+JUSTSTEM(m.file)+'.'+validext[m.extno]
IF FILE(m.chkfile)
WAIT WINDOW 'There is already a file '+m.chkfile
ENDIF
NEXT m.extno

--
HTH
Andrew Howell