FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC file() function
Posts: 2
Joined: Fri Aug 08, 2008 03:32 PM
file() function
Posted: Mon Aug 11, 2008 07:22 AM

I'm tryin to use the file() function to check if a file in the foldere "\My documents\immagini\" exists, but the function always returns .f. even if the file is there....
Any help ??

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
file() function
Posted: Mon Aug 11, 2008 10:49 AM
Andrea,

In Windows Mobile there is no the concept of "drives", so we have to use the current directory. Please try this example:

test.prg
#include "fwce.ch"

function Main()

   MsgInfo( File( CurDir() + "\test.exe" ) )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
file() function
Posted: Mon Aug 11, 2008 02:51 PM
Andrea,

You just have to remove the first slash bar:

test.prg
#include "fwce.ch"

function Main()

   MsgInfo( File( "My Documents\myfile.txt" ) )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2
Joined: Fri Aug 08, 2008 03:32 PM
file() function
Posted: Mon Aug 11, 2008 09:03 PM

thank you Antonio, everything works fine now.
There was a too little bug to be seen in my code!

Continue the discussion