XBase - ERROR DE PARAMETROS EN MEMOEDIT

 
Vista:

ERROR DE PARAMETROS EN MEMOEDIT

Publicado por antonio (2 intervenciones) el 18/06/2006 16:49:51
Hola a todos:
A ver alguien me puede ayudar, con las dos primeras lineas de memoedit me da error de ejecucion, error de parametros y con la tercera linea de memoedit funciona pero no me admite la funcion.
procedure memore
set cursor on
@ 9, 0 to 21, 79 double
@ 22, 0 say '(CTRL + Y) Borra linea -- (CTRL + T) Borra palabra -- (CTRL + G) Borra caracter '
@ 23, 0 say '(CRT + W) para Grabar -- ( F5 ) Imprimir --( ESC ) Abandona cambios '
do bloquea
replace texto with memoedit (texto, 10, 1, 20, 78, .T.,"CASCOS", 79, '', '', '', '', 10, 1) && con esta da error de parametros en ejecucion
replace texto with memoedit (texto, 10, 1, 20, 78, .T.,"CASCOS") &&con esta da error de parametros en ejecucion
replace texto with memoedit (texto, 10, 1, 20, 78, .T.) && con esta si va bien pero sin la funcion
unlock
return
***************
function CASCOS()
parameters modo, fil, col
if modo = 0
clear gets
@ 8, 5 say 'LINEA: ' get fil picture '999'
@ 8, 25 say 'COLUMNA: ' get col picture '99'
clear gets
return 0
endif
if lastkey () = -4
save screen to w_p1
set console off
set print on
? texto
set print off
set console on
restore screen from w_p1
endif
RETURN ""
******************
gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:ERROR DE PARAMETROS EN MEMOEDIT

Publicado por Antonio Cortés (11 intervenciones) el 13/07/2006 19:19:54
Pues no sé, las primeras líneas las veo bien. El siguiente código funciona, está sacado de la ayuda de XBASE++:

#include "Inkey.ch"
#include "Setcurs.ch"
#include "Memoedit.ch"

STATIC snLeft, snBottom

PROCEDURE Main


? FileEdit( "TEST.PRG", 2, 2, 22, 76 )

RETURN

* Edit function for text files
FUNCTION FileEdit( cFilename, nTop, nLeft, nBottom, nRight )
LOCAL cString := MemoRead( cFilename )
LOCAL cScreen := SaveScreen( nTop, nLeft, nBottom, nRight )

snBottom := nBottom // row and column for
snLeft := nLeft + 1 // screen output in UserFunc()

DispBox( nTop, nLeft, nBottom, nRight, 2 )
@ nTop, nLeft+1 SAY PadC(cFileName, nRight-nLeft-1, Chr(205) )


SET SCOREBOARD OFF
cString := MemoEdit( cString , ;
nTop + 1 , ;
nLeft + 1 , ;
nBottom- 1 , ;
nRight - 1 , ;
.T. , ;
"UserFunc" )

SET SCOREBOARD ON
RestScreen( nTop, nLeft, nBottom, nRight, cScreen )

RETURN MemoWrit( cString, cFilename )

* User function for MemoEdit()

FUNCTION UserFunc( nMode, nRow, nCol )
LOCAL nKey := LastKey()
LOCAL nReturn := ME_DEFAULT // default return value

DO CASE
CASE nMode == ME_IDLE // display position in the
SetPos( snBottom, snLeft ) // text buffer
?? "Row:", Str(nRow,4), "Column:", Str(nCol,2)

CASE nMode == ME_UNKEY .OR. nMode == ME_UNKEYX

DO CASE
CASE nKey == K_F7 // word right with F7

nReturn:= ME_WORDRIGHT

CASE nKey == K_F8 // last character in the
nReturn:= ME_BOTTOMRIGHT // window with F8

CASE nKey == K_F9 // switch word wrap
nReturn:= ME_TOGGLEWRAP // with F9

CASE nKey == K_F10 // switch scroll
nReturn:= ME_TOGGLESCROLL // with F10

CASE nKey == K_CTRL_RET // save with Ctrl-Return

nReturn:= K_CTRL_W

CASE nKey == K_INS // display cursor based
IF SetCursor() == SC_SPECIAL1 // on insert mode
SetCursor( SC_NORMAL )
ELSE
SetCursor( SC_SPECIAL1 )
ENDIF
ENDCASE

OTHERWISE // on initialization
nReturn := IIf( Set(_SET_INSERT), 0, K_INS )
// switch to the insertion

SetCursor( SC_SPECIAL1 ) // mode by default

ENDCASE


RETURN nReturn
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar