file() function

file() function

Postby andreaquaglia » Mon Aug 11, 2008 7: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 ??
andreaquaglia
 
Posts: 2
Joined: Fri Aug 08, 2008 3:32 pm
Location: italy

Postby Antonio Linares » 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
Code: Select all  Expand view
#include "fwce.ch"

function Main()

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

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Mon Aug 11, 2008 2:51 pm

Andrea,

You just have to remove the first slash bar:

test.prg
Code: Select all  Expand view
#include "fwce.ch"

function Main()

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

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby andreaquaglia » Mon Aug 11, 2008 9:03 pm

thank you Antonio, everything works fine now.
There was a too little bug to be seen in my code!
andreaquaglia
 
Posts: 2
Joined: Fri Aug 08, 2008 3:32 pm
Location: italy


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 9 guests