Código: Selecionar todos
#include "hwgui.ch"
#include "directry.ch"
FUNCTION DlgTextView()
LOCAL aFileList, nIndex, cFileSpec := "*.prg"
LOCAL oDlg, oEdit, oFont := HFont():Add( "MS Sans Serif", 0, -13 )
aFileList := Directory( cFileSpec )
nIndex := 1
INIT DIALOG oDlg CLIPPER TITLE "Text view" ;
AT 0,0 SIZE 800, 600 ;
FONT oFont ON INIT Dlg_Init( oEdit, aFileList, nIndex )
@ 10, 10 HCEDIT oEdit SIZE oDlg:nWidth - 40, oDlg:nHeight - 100
ACTIVATE DIALOG oDlg
RETURN Nil
STATIC FUNCTION Dlg_Init( oEdit, aFileList, nIndex )
LOCAL cTxt
IF Len( aFileList ) == 0
cTxt := ""
ELSE
cTxt := MemoRead( aFileList[ nIndex ], F_NAME )
ENDIF
oEdit:SetText( cTxt )
(cTxt)
(oEdit)
(aFileList)
(nIndex)
RETURN Nil
Desse jeito dá erro de não existir o método SetText()
