Antonio tenho um timer que verifica os arquivos TXT do diretorio, acontece que se chamar a cGETFILE, a função DIRECTORY passa a não achar mais os arquivos enquanto não fechar a cGETFILE:
EX:
#include "fivewin.ch"
function main()
local oWnd1,oti,obtn
DEFINE WINDOW oWnd1 TITLE "oWnd1" ;
FROM 5, 5 TO 24, 64
define timer oti of ownd1 interval 2000 action(teste())
@ 10,10 button obtn size 100,50 of oWnd1 pixel ACTION(LA())
ACTIVATE WINDOW oWnd1 on init(oti:activate()) maximized
return nil
******
function teste()
local adir
aDir := directory('*.txt')
if len(adir)=0
? "PROBLEMA"
endif
return(.t.)
FUNCTION LA()
LOCAL CFILE
cFile:=cGetFile("Bitmaps|*.bmp","" )
RETURN(.T.)
DIRECTORY() + cGetFile - BUG????
#include "fivewin.ch"
#Include "Directry.ch"
#Include "Directry.ch"
Code: Select all
function main()
local oWnd1,oti,obtn
DEFINE WINDOW oWnd1 TITLE "oWnd1" ;
FROM 5, 5 TO 24, 64
define timer oti of ownd1 interval 2000 action(teste())
@ 10,10 button obtn size 100,50 of oWnd1 pixel ACTION(LA())
ACTIVATE WINDOW oWnd1 on init(oti:activate()) maximized
return nil
******
function teste()
local adir
aDir := directory('*.txt')
if len(adir)=0
? "PROBLEMA"
endif
return(.t.)
FUNCTION LA()
LOCAL CFILE
//cFile:=cGetFile("Bitmaps|*.bmp","" )
cFile := SubStr( cGetFile( "*.BMP", "Selecione o Arquivo Bitmap (.BMP)" ), 3 )
IF Empty( cFile )
? "No BitMaps in Local"
Return Nil
ELSE
? cFile
ENDIF
RETURN(.T.)
João Santos - São Paulo - Brasil
#include "fivewin.ch"
#Include "Directry.ch"
#Include "Directry.ch"
Code: Select all
static oti
function main()
local oWnd,obtn
DEFINE WINDOW oWnd TITLE "WINDOW" ;
FROM 5, 5 TO 24, 64
@ 10,10 button obtn size 100,50 of oWnd pixel ACTION(LA())
ACTIVATE WINDOW oWnd on init(ACIONA_TIMER(oWnd)) maximized
return nil
STATIC FUNCTION ACIONA_TIMER(OWND)
DEFINE TIMER oTi INTERVAL 1000 OF oWnd ACTION teste()
ACTIVATE TIMER oTi
return(nil)
******
STATIC FUNCTION TESTE()
local adir
aDir := directory('*.txt')
if len(adir)=0
oTi:End()
//-> Ou oTi:DeAtivate()
? "nao encontrei nenhum arquivo.txt"
endif
return(.t.)
******
FUNCTION LA()
LOCAL CFILE
cFile:=cGetFile("Bitmaps|*.bmp","" )
RETURN(.T.)
João Santos - São Paulo - Brasil