How does File() work?

Post Reply
User avatar
dutch
Posts: 1554
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

How does File() work?

Post by dutch »

Dear All,

I try to check database file is exist or not buy use file() but I don't know how to success.

- File( "TEST.DBF" ) is not working
- File( CURDIR()+"\TEST.DBF" ) is not working
- File( "\\"+CURDIR()+"\TEST.DBF" ) is not working

Thank you for any idea.

Best regards,
Dutch
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: How does File() work?

Post by Richard Chidiak »

dutch wrote:Dear All,

I try to check database file is exist or not buy use file() but I don't know how to success.

- File( "TEST.DBF" ) is not working
- File( CURDIR()+"\TEST.DBF" ) is not working
- File( ""+CURDIR()+"\TEST.DBF" ) is not working

Thank you for any idea.

Best regards,
Dutch


Dutch

FILE(CURDIR() + "\TEST.DBF") IS THE CORRECT SYNTAX.

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
dutch
Posts: 1554
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Post by dutch »

Dear Richard,

I try this FILE(CURDIR()+"\TEST.DBF") on my SD card in PPC but it return .F.

CURDIR()+"\TEST.DBF" = "Storage Card\TEST.DBF"

It doesn't work.

Best regards,
Dutch
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Post by Richard Chidiak »

dutch wrote:Dear Richard,

I try this FILE(CURDIR()+"\TEST.DBF") on my SD card in PPC but it return .F.

CURDIR()+"\TEST.DBF" = "Storage Card\TEST.DBF"

It doesn't work.

Best regards,
Dutch


It works with my ppc app. i use the file(...) several times.

make sure your test.txt is on the root of the sd card, if not

IF FILE(CURDIR() + "\whatever\test.txt")
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
dutch
Posts: 1554
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

It works on PPC but not work on Emulator

Post by dutch »

Dear Richard,

Thanks, I try on the Emulator and It doesn't work. But I try again in my PPC, It work ok.

Thanks&Regards,
Dutch
Post Reply