PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → manage events on several table columns once
manage events on several table columns once
Iniciado por guest, 30,dic. 2015 21:41 - 4 respuestas
Publicado el 30,diciembre 2015 - 21:41
I was tring a way to write the code of an event on table columns once instead of copying the procedure (the call of a procedure if it is more than 2 rows of code) inside the code in response to the same event on N columns of a table. Unfortunately I cannot succeed in this task. Did anyone succeded in archieving this?

Example: I have a table control "TABLE_Person" with 20 editable columns:
COL_name, COL_surname, COL_address, COL_city, COL_zipcode, COL_age and so on...

If I want to execute the simple code MySelf..Value = MySelf..Note for the "Entry" or "Exit" event for each column the user can edit. Now I need to put that code in the event of COL_name and copy it the same for all the other columns.
Final result... N columns = N copy of that code

Thank you.
Stefano
Publicado el 31,diciembre 2015 - 12:52
Hi Stefano,

first, myself..anything will work only in the code of the column...

Second, you can use a procedure call that you put in each column and send to it as a parameter myself..name, then in yor procedure, you use indirection to work on any column the code is calling from.

Finally, you can try and see if entering a column and exiting a column trigger a specific "event". If it's the case, you can interecept it and put your code there

Best regards
Publicado el 31,diciembre 2015 - 14:50
Thank you for the answer.
This - being an expert like you to sayd that - confirms I can't do nothing more than what I'm doing now to manage this feature.
Currently I already call function "LP_ColEntry", "LP_ColExit" and so on to unify the management of columns. I could put them in a class not to having copy of them inside each form but I cannot call them once for a "generic column" of the table. N columns = N calls.

So no way to escape from that.
Publicado el 31,diciembre 2015 - 15:16
Stefano,

maybe an event is fired whenever you enter/exit a column?

Event("your_proc",TABLE_Person..Name,0)

See the help for the proper format of "your_proc".
You will get all events on TASBLE_Person, which can be quite a lot events you don't want, (like draw and mousemove) but with some tracing maybe you fill find the events you need.
If so you have one procedure to handle all columns.
Publicado el 31,diciembre 2015 - 16:33
Yes, already tried even this way.
Unfortunately there is no specific event on entry/exit of a column...
It reminds me the headache when tring to do the same to implement sorting on table columns header double-click instead of native single-click sort.