ALLOWEDIT -- "syntax error at '@'"

Moderator: Rathinagiri

Post Reply
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

ALLOWEDIT -- "syntax error at '@'"

Post by andyglezl »

Hola

Al compilar un GRID con EDIT, funciona OK, pero al compilarlo con ALLOWEDIT, da error. ( "syntax error at '@' )
Es algun BUG ? HMG 3.4
----------------------------------------------------------------------------------------------------------------------------
Hello

When compiling a GRID with EDIT, it works OK, but when compiling with AllowEdit, fails. ( "syntax error at '@' )
It's a bug? HMG 3.4



@ <nRow> ,<nCol>
GRID <ControlName>
...
[ EDIT | ALLOWEDIT ] ] <====================


Veo que tambien dice que con EDIT abre una nueva ventana para editar los campos pero se edita en la linea.
y tambien los campos MEMO.
--------------------------------------------------------------------------------------------------------------------------------
I see also says that with EDIT opens a new window to edit the fields but is modified in each field on the line.
and also MEMO fields.


- Hints:
...
...

- If EDIT clause is used, by doubleclicking an item, will open an editing
window allowing to change the item content.
Andrés González López
Desde Guadalajara, Jalisco. México.
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: ALLOWEDIT -- "syntax error at '@'"

Post by trmpluym »

I also tried it over here.

'EDIT' works 'ALLOWEDIT' generates an error.

The solution is simple (search replace) but i understand your point...
User avatar
serge_girard
Posts: 3178
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: ALLOWEDIT -- "syntax error at '@'"

Post by serge_girard »

Andres,

Try with :

DEFINE GRID and ALLOWEDIT true of false

Serge
There's nothing you can do that can't be done...
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: ALLOWEDIT -- "syntax error at '@'"

Post by andyglezl »

Gracias trmpluym y Serge

Lo que estoy tratando de hacer, es cambiar los BROWSE que tengo en mis programas por el control GRID.
Pero no encuentro como hacer que el GRID funcione de la misma manera que el BROWSE.
Ademas de que estoy encontrando varios detalles que no se si son de la version 3.4 ó yo estoy
haciendo algo mal. (anexo ejemplo)

Alguien ya utilizo el GRID para editar DB como el BROWS ???
---------------------------------------------------------------------------------------------------------------------------
Thanks trmpluym and Serge

What I'm trying to do is change the BROWSE I have in my programs by the GRID control.
But I can not find how to make the GRID to work the same way as the BROWSE.
Besides I'm finding several details not if they are version 3.4 or I
doing something wrong. (Attached example)

Someone already use the GRID to edit DB as the BROWSE ???
PrbSample.rar
(4.03 KiB) Downloaded 300 times
Andrés González López
Desde Guadalajara, Jalisco. México.
mlnr
Posts: 126
Joined: Fri Aug 28, 2015 1:52 pm
DBs Used: DBF

Re: ALLOWEDIT -- "syntax error at '@'"

Post by mlnr »

Hi Andy

View this code.

Code: Select all

FUNCTION Modifica_DB( )
	LOCAL nCpos := LEN( aCpos1 ), aReadOnly := ARRAY( nCpos ), afColor := ARRAY( nCpos ), aColCtrls := { }
	AFILL( aReadOnly, .F. )
	AFILL( afColor, fColor )
	*  aCpos, aTips, aLong, aDec
	FOR i1 = 1 TO nCpos
		IF aTips[ i1 ] = "N"
			AADD( aColCtrls, { 'TEXTBOX', 'NUMERIC', '$ 9,999,999.99' } )
		ELSEIF aTips[ i1 ] = "D"
			AADD( aColCtrls, { 'DATEPICKER', 'DROPDOWN' } )
		ELSEIF aTips[ i1 ] = "L"			
			AADD( aColCtrls, { 'CHECKBOX' , 'Yes' , 'No' } )			
		ELSEIF aTips[ i1 ] = "C"			
			AADD( aColCtrls, { 'TEXTBOX', 'CHARACTER' } )
[color=#FF0000]		ELSEIF aTips[ i1 ] = "M"			
			AADD( aColCtrls, { 'EDITBOX' })[/color]
		ENDIF
	NEXT
	DEFINE WINDOW Form_GridCtes AT 0 , 0 WIDTH 1024 HEIGHT 600 TITLE '| ABC CLIENTES |' ON RELEASE Form_Main.Restore BACKCOLOR { 0, 33, 38 }

		@ 300 , 005 GRID   Grid_2 OF Form_GridCtes WIDTH 1000 HEIGHT 250 FONT "VERDANA" SIZE 10 FONTCOLOR BLUE ;
					ROWSOURCE "Ctes" VALUE 1 WIDTHS aLong HEADERS aCpos1 COLUMNFIELDS aCpos2 COLUMNCONTROLS aColCtrls	; 
                                        ON HEADCLICK { { || nil }, { || nil }, { || nil } }	;
					EDIT ALLOWAPPEND ALLOWDELETE EDITOPTION GRID_EDIT_INSERTCHAR ;
					DYNAMICBACKCOLOR afColor ;
	                                [color=#FF0000]COLUMNWHEN { {|| .F. }, {|| .T. }, {|| .T. }, {|| .T. }, {|| .T. }, {|| .T. }, {|| .T. } }  ;[/color]
					TOOLTIP '<Doble Click>=Editar  <ALT-A>=Añadir   <SUP>=Borrar' LOCKCOLUMNS 2								
					Form_GridCtes.Grid_2.ToolTip := '<Doble Click>=Editar  <ALT-A>=Añadir   <SUP>=Borrar'  				
					
	END WINDOW
	CENTER WINDOW Form_GridCtes
	ACTIVATE WINDOW Form_GridCtes
RETURN nil
[/code


-i use it replace command to save the modification
-is see it so the tooltip doesn't work perfectly in modal window, because the tooltip is behind the window
Best regards,
Gabor
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: ALLOWEDIT -- "syntax error at '@'"

Post by andyglezl »

Gracias por tu ayuda "mlnr"

* He instalado la version 3.42 (Patch 1 y 2) y sigue haciendo los detalles comentados dentro del .prg.

* FONTCOLOR en el BROWSE no funciona
* DYNAMICBACKCOLOR en el BROWSE no funciona

* LOCKCOLUMNS en el GRID no funciona
* ON SAVE en el GRID no funciona.
* En que momento se ejecuta el evento ON SAVE ??? cuando oprimo ENTER ???
* Al editar un campo MEMO en el GRID, lo edita en el mismo renglon, no abre una ventana como el BROWSE.
* En el GRID, no aparece la leyenda <MEMO> en la columna del campo memo.

* He quitado de la ventana Main "TOPMOST" el TOOLTIP si funciona OK. (pero quiero que sea TOPMOST)
------------------------------------------------------------------------------------------------------------------------------------------
Thanks for your help "mlnr"

* I installed the version 3.42 (Patch 1 and 2) and continues to the details discussed in the .prg.

* FONTCOLOR not work in the BROWSE
* DynamicBackColor not work in the BROWSE

* LockColumns in the GRID does not work
* SAVE ON in the GRID does not work
* At that time the event runs SAVE ON?, When I press ENTER?
* When editing a memo field in the GRID, you edit in the same row, does not open a window like the BROWSE.
* In the GRID, the legend <MEMO> column does not appear in the memo field.

* I removed the Main "TOPMOST", the TOOLTIP it works OK window. (But I want it to be TOPMOST)

paso.jpg
paso.jpg (113.97 KiB) Viewed 3994 times
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: ALLOWEDIT -- "syntax error at '@'"

Post by andyglezl »

Hola

Con la propiedad "TOPMOST" en la ventana MAIN, comprobe otro detalle (ademas del "TOOLTIP") en la ventana MODAL, parece que no funciona
DoMethod( 'xxx', "xxx", "SetFocus" ) ya que el foco se queda en una ventana cualquiera, abierta anteriormente.
----------------------------------------------------------------------------------------------------------------------------------------------------------
Hello

With the "TOPMOST" property in the MAIN window, checked other details (besides the "TOOLTIP") in the modal window, it does not work
DoMethod ('Form_GridCtes', "Grid_2", "SetFocus") as the focus remains on any window, open before.
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: ALLOWEDIT -- "syntax error at '@'"

Post by srvet_claudio »

GRID with data base:

ALT + A --> Append
ALT + D --> Delete
ALT + R --> ReCall
ALT + S --> Save (On Save)
ALT + U --> ClearBuffer

Code: Select all

FUNCTION GridOnSave( )
LOCAL k 
   FOR k = 1 TO HMG_LEN (This.EditBuffer)   // Numbers of edit cell
      MsgDebug( This.EditBuffer [ k ] )     // { nLogicalRow , nLogicalCol , xValue , nRecNo } 
      DbGoTo( This.EditBuffer [ k ][ 4 ] )
      If RegEnRed( "Ctes" )
         FIELDPUT( This.EditBuffer [ k ][ 2 ], This.EditBuffer [ k ][ 3 ] )
      ELSE
         MsgInfo("No se pudo grabar el Registro...","Verifique" )
      ENDIF
      UNLOCK
   NEXT
RETURN NIL
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: ALLOWEDIT -- "syntax error at '@'"

Post by andyglezl »

Muchas gracias Dr. Claudio, solucionado.

Que tan posible es que el control Grid tenga los eventos ON DELETE y ON APPEND ( como tenemos ON SAVE)
para personalizar mas el GRID ?

P.D. ( Ya parece Navidad, con tantos deseos ! :oops: )

Y tambien poder personalizar la edicion de los campos MEMO.
---------------------------------------------------------------------------------------------------------------------------
Thank you very much Dr. Claudio, solved.

How likely it is that the Grid control events have ON DELETE and ON APPEND (as we ON SAVE)
to further customize the GRID?

P.S. (Already seems Christmas, with many desires: :oops: )

And also to customize editing the MEMO fields.
Andrés González López
Desde Guadalajara, Jalisco. México.
Post Reply