Skip to main content
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:39 AM UTC

Uniface 9: define trigger on entity level

define trigger on entity level

Author: i2stiller@gmx.de (istiller)

Hi freaks Did anyone of you use the define trigger on entity level? I just did so and got a strange listing (9.7.04)

Trigger <DEFE> from Entity: TABLE.MODEL [ 1] #define ENTITY_TYPE=XYZ ... Trigger <DEFE> from Entity: FIELD.MODEL [ 1] #define ENTITY_TYPE=XYZ Trigger <DTLF> from Field: FIELD.TABLE.MODEL ...

What the ... is this defintion for entity FIELD.MODEL? BTW: And, this defines are not local to the entity :-(   Background: We do have different 'types' of entities in a component, like visible entities or auxiliary entities. I looking for a simple way to tell the globale procs (for read or write or ...) which kind of entity it is. For the whole component, this could be done by the DEFINE-trigger and some coding in a general INIT-Operation. But how to do this for entities?  a) the DEFE trigger should do what it have to do. And this local to the entity  b) I need some kind of INIT for the entity (collection) Any ideas? BTW: This should not interference the rest of the code, as my colleagues don't like to change there code or see changed code :-) Ingo

20 replies

Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:39 AM UTC

define trigger on entity level

Author: i2stiller@gmx.de (istiller)

Hi freaks Did anyone of you use the define trigger on entity level? I just did so and got a strange listing (9.7.04)

Trigger <DEFE> from Entity: TABLE.MODEL [ 1] #define ENTITY_TYPE=XYZ ... Trigger <DEFE> from Entity: FIELD.MODEL [ 1] #define ENTITY_TYPE=XYZ Trigger <DTLF> from Field: FIELD.TABLE.MODEL ...

What the ... is this defintion for entity FIELD.MODEL? BTW: And, this defines are not local to the entity :-(   Background: We do have different 'types' of entities in a component, like visible entities or auxiliary entities. I looking for a simple way to tell the globale procs (for read or write or ...) which kind of entity it is. For the whole component, this could be done by the DEFINE-trigger and some coding in a general INIT-Operation. But how to do this for entities?  a) the DEFE trigger should do what it have to do. And this local to the entity  b) I need some kind of INIT for the entity (collection) Any ideas? BTW: This should not interference the rest of the code, as my colleagues don't like to change there code or see changed code :-) Ingo

By the way: If i put a #define in the DEFF-trigger of NDB_MASTER I got this: ... Trigger <DEFF> from Field: NDB_MASTER.DB14001.FAV_DATENBASIS [ 1] #define INGO_123 Trigger <DEFE> from Entity: NDB_MASTER.FAV_DATENBASIS ... What the f... is UnifAce doing here .... Ingo


Author: istiller (i2stiller@gmx.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:39 AM UTC

define trigger on entity level

Author: i2stiller@gmx.de (istiller)

Hi freaks Did anyone of you use the define trigger on entity level? I just did so and got a strange listing (9.7.04)

Trigger <DEFE> from Entity: TABLE.MODEL [ 1] #define ENTITY_TYPE=XYZ ... Trigger <DEFE> from Entity: FIELD.MODEL [ 1] #define ENTITY_TYPE=XYZ Trigger <DTLF> from Field: FIELD.TABLE.MODEL ...

What the ... is this defintion for entity FIELD.MODEL? BTW: And, this defines are not local to the entity :-(   Background: We do have different 'types' of entities in a component, like visible entities or auxiliary entities. I looking for a simple way to tell the globale procs (for read or write or ...) which kind of entity it is. For the whole component, this could be done by the DEFINE-trigger and some coding in a general INIT-Operation. But how to do this for entities?  a) the DEFE trigger should do what it have to do. And this local to the entity  b) I need some kind of INIT for the entity (collection) Any ideas? BTW: This should not interference the rest of the code, as my colleagues don't like to change there code or see changed code :-) Ingo

*grumbel* Now I got the same include six times Three time in the DEFE of the enitity in question and three times in a dubios DEFE-trigger which actualy is a field. As there is no proper way in/by UnifAce "run" the include only once, I have to build a tricky workaround. @UnifAce: Please let there be any precompiler function/attributes to get the actual status of an include And this for 9.7.04 or 9.7.05 and not for 10.xx something Ingo   Here is the DEFE:

; Dieser Include muss hier immer als letztes stehen:
#include FAV_LIB:STD_DEFE_2

This is the beginning of the include

#undefine CLLC_&lt;$entname&gt;_INCL
#ifundefined _REG_STD_&lt;$entname&gt;_DEFE_2_A_
#define _REG_STD_&lt;$entname&gt;_DEFE_2_A_
#define CLLC_&lt;$entname&gt;_INCL
#else
#ifundefined _REG_STD_&lt;$entname&gt;_DEFE_2_B_
#define _REG_STD_&lt;$entname&gt;_DEFE_2_B_
#define CLLC_&lt;$entname&gt;_INCL
#endif
#endif

  And that's the result Notice: NDB_MASTER is a (non-db) field under DB14001 and not an entity!

Trigger &lt;DEFE&gt; from Entity: DB14001.FAV_DATENBASIS
[ 1] ;
[ 2] ;#define CLL_TYP={SEL,DTL,SUI,DUI,SAX,DAX,AUX}
[ 3] ;#define SHOW_LOI
[ 5] ; Dieser Include muss hier immer als letztes stehen:
[ 6] #include FAV_LIB:STD_DEFE_2
                       &lt;------------------ First Include in DB14001
[I1: 1] #undefine CLLC_DB14001_INCL
[I1: 2] #ifundefined _REG_STD_DB14001_DEFE_2_A_
[I1: 3] #define _REG_STD_DB14001_DEFE_2_A_
[I1: 4] #define CLLC_DB14001_INCL
[I1: 5] ;#else
[I1: 6] ; #ifundefined _REG_STD_DB14001_DEFE_2_B_
[I1: 7] ; #define _REG_STD_DB14001_DEFE_2_B_
[I1: 8] ; #define CLLC_DB14001_INCL
[I1: 9] ; #endif
[I1: 10] #endif
...
[ 5] ; Dieser Include muss hier immer als letztes stehen:
[ 6] #include FAV_LIB:STD_DEFE_2                        &lt;------------------ Second Include in DB14001
[I1: 1] #undefine CLLC_DB14001_INCL
[I1: 2] #ifundefined _REG_STD_DB14001_DEFE_2_A_
[I1: 3] ; #define _REG_STD_DB14001_DEFE_2_A_
[I1: 4] ; #define CLLC_DB14001_INCL
[I1: 5] #else
[I1: 6] #ifundefined _REG_STD_DB14001_DEFE_2_B_
[I1: 7] #define _REG_STD_DB14001_DEFE_2_B_
[I1: 8] #define CLLC_DB14001_INCL
[I1: 9] #endif
[I1: 10] #endif
...
[ 6] ; Dieser Include muss hier immer als letztes stehen:
[ 7] #include FAV_LIB:STD_DEFE_2                        &lt;------------------ Third Include in DB14001
[I1: 1] #undefine CLLC_DB14001_INCL
[I1: 2] #ifundefined _REG_STD_DB14001_DEFE_2_A_
[I1: 3] ; #define _REG_STD_DB14001_DEFE_2_A_
[I1: 4] ; #define CLLC_DB14001_INCL
[I1: 5] #else
[I1: 6] #ifundefined _REG_STD_DB14001_DEFE_2_B_
[I1: 7] ; #define _REG_STD_DB14001_DEFE_2_B_
[I1: 8] ; #define CLLC_DB14001_INCL
[I1: 9] #endif
[I1: 10] #endif
...
Trigger &lt;DEFE&gt; from Entity: NDB_MASTER.FAV_DATENBASIS
[ 1] ;
[ 2] ;#define CLL_TYP={SEL,DTL,SUI,DUI,SAX,DAX,AUX}
[ 3] ;#define SHOW_LOI
[ 5] ; Dieser Include muss hier immer als letztes stehen:
[ 6] #include FAV_LIB:STD_DEFE_2
                       &lt;------------------ First Include in NDB_MASTER
[I1: 1] #undefine CLLC_DB14001_INCL
[I1: 2] #ifundefined _REG_STD_DB14001_DEFE_2_A_
[I1: 3] #define _REG_STD_DB14001_DEFE_2_A_
[I1: 4] #define CLLC_DB14001_INCL
[I1: 5] ;#else
[I1: 6] ; #ifundefined _REG_STD_DB14001_DEFE_2_B_
[I1: 7] ; #define _REG_STD_DB14001_DEFE_2_B_
[I1: 8] ; #define CLLC_DB14001_INCL
[I1: 9] ; #endif
[I1: 10] #endif
...
[ 5] ; Dieser Include muss hier immer als letztes stehen:
[ 6] #include FAV_LIB:STD_DEFE_2                        &lt;------------------ Second Include in NDB_MASTER
[I1: 1] #undefine CLLC_DB14001_INCL
[I1: 2] #ifundefined _REG_STD_DB14001_DEFE_2_A_
[I1: 3] ; #define _REG_STD_DB14001_DEFE_2_A_
[I1: 4] ; #define CLLC_DB14001_INCL
[I1: 5] #else
[I1: 6] #ifundefined _REG_STD_DB14001_DEFE_2_B_
[I1: 7] #define _REG_STD_DB14001_DEFE_2_B_
[I1: 8] #define CLLC_DB14001_INCL
[I1: 9] #endif
[I1: 10] #endif
...
[ 6] ; Dieser Include muss hier immer als letztes stehen:
[ 7] #include FAV_LIB:STD_DEFE_2                        &lt;------------------ Third Include in NDB_MASTER
[I1: 1] #undefine CLLC_DB14001_INCL
[I1: 2] #ifundefined _REG_STD_DB14001_DEFE_2_A_
[I1: 3] ; #define _REG_STD_DB14001_DEFE_2_A_
[I1: 4] ; #define CLLC_DB14001_INCL
[I1: 5] #else
[I1: 6] #ifundefined _REG_STD_DB14001_DEFE_2_B_
[I1: 7] ; #define _REG_STD_DB14001_DEFE_2_B_
[I1: 8] ; #define CLLC_DB14001_INCL
[I1: 9] #endif
[I1: 10] #endif

Author: istiller (i2stiller@gmx.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:39 AM UTC

define trigger on entity level

Author: i2stiller@gmx.de (istiller)

Hi freaks Did anyone of you use the define trigger on entity level? I just did so and got a strange listing (9.7.04)

Trigger <DEFE> from Entity: TABLE.MODEL [ 1] #define ENTITY_TYPE=XYZ ... Trigger <DEFE> from Entity: FIELD.MODEL [ 1] #define ENTITY_TYPE=XYZ Trigger <DTLF> from Field: FIELD.TABLE.MODEL ...

What the ... is this defintion for entity FIELD.MODEL? BTW: And, this defines are not local to the entity :-(   Background: We do have different 'types' of entities in a component, like visible entities or auxiliary entities. I looking for a simple way to tell the globale procs (for read or write or ...) which kind of entity it is. For the whole component, this could be done by the DEFINE-trigger and some coding in a general INIT-Operation. But how to do this for entities?  a) the DEFE trigger should do what it have to do. And this local to the entity  b) I need some kind of INIT for the entity (collection) Any ideas? BTW: This should not interference the rest of the code, as my colleagues don't like to change there code or see changed code :-) Ingo


Author: Lauterbach (norbert.lauterbach@infraserv.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:39 AM UTC

define trigger on entity level

Author: i2stiller@gmx.de (istiller)

Hi freaks Did anyone of you use the define trigger on entity level? I just did so and got a strange listing (9.7.04)

Trigger <DEFE> from Entity: TABLE.MODEL [ 1] #define ENTITY_TYPE=XYZ ... Trigger <DEFE> from Entity: FIELD.MODEL [ 1] #define ENTITY_TYPE=XYZ Trigger <DTLF> from Field: FIELD.TABLE.MODEL ...

What the ... is this defintion for entity FIELD.MODEL? BTW: And, this defines are not local to the entity :-(   Background: We do have different 'types' of entities in a component, like visible entities or auxiliary entities. I looking for a simple way to tell the globale procs (for read or write or ...) which kind of entity it is. For the whole component, this could be done by the DEFINE-trigger and some coding in a general INIT-Operation. But how to do this for entities?  a) the DEFE trigger should do what it have to do. And this local to the entity  b) I need some kind of INIT for the entity (collection) Any ideas? BTW: This should not interference the rest of the code, as my colleagues don't like to change there code or see changed code :-) Ingo

To Ingo: me example is as I intended. I wanted to demonstrate that the #define = YELLOW at MeldedEntity/ECOP does not inherit into component. To Uli (at some point): You are right, it does not harm the end-result of compiled modules, but still you could also have 'business' logic in defines and you need to keep a good eye on it. To Uli (last point about U10): You are right, at some point we still want to add an option to copy the modeled code into the component, so it can be sued as a starting point. Thanks guys, interesting discussions.


Author: Gerton Leijdekker (gerton.leijdekker@uniface.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:39 AM UTC

define trigger on entity level

Author: i2stiller@gmx.de (istiller)

Hi freaks Did anyone of you use the define trigger on entity level? I just did so and got a strange listing (9.7.04)

Trigger <DEFE> from Entity: TABLE.MODEL [ 1] #define ENTITY_TYPE=XYZ ... Trigger <DEFE> from Entity: FIELD.MODEL [ 1] #define ENTITY_TYPE=XYZ Trigger <DTLF> from Field: FIELD.TABLE.MODEL ...

What the ... is this defintion for entity FIELD.MODEL? BTW: And, this defines are not local to the entity :-(   Background: We do have different 'types' of entities in a component, like visible entities or auxiliary entities. I looking for a simple way to tell the globale procs (for read or write or ...) which kind of entity it is. For the whole component, this could be done by the DEFINE-trigger and some coding in a general INIT-Operation. But how to do this for entities?  a) the DEFE trigger should do what it have to do. And this local to the entity  b) I need some kind of INIT for the entity (collection) Any ideas? BTW: This should not interference the rest of the code, as my colleagues don't like to change there code or see changed code :-) Ingo

OK, back to our reality and a little "cave canes": It looks like the guard to stop multiple executions on an include proc cause problems; but these multiple compiles will not do any harm as local variations will overlay the modeled code. As we see without the guard, compiling modeled code in front of the code with the local variations will end up that the local variation will be processed at runtime (which is the expected way). So all it takes to clear Ingos problem from post #3 is to deactivate the 3 lines defining guard in the (centralised) include procs. ;#ifundefined STD_DEFE_GUARD ;#define STD_DEFE_GUARD #ifdefined DOSOMETHING #info somethingtodo #endif ;#endif Greetings from Frankfurt/Germany, Uli P.S. I don't like the idea of a "naked" local code as the traditional way shows me all the relevant code at once. It's a bit irritating in U10 that first one has to copy a proc out of the model window to start a local variation.


Author: ulrich-merkel (ulrichmerkel@web.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:39 AM UTC

define trigger on entity level

Author: i2stiller@gmx.de (istiller)

Hi freaks Did anyone of you use the define trigger on entity level? I just did so and got a strange listing (9.7.04)

Trigger <DEFE> from Entity: TABLE.MODEL [ 1] #define ENTITY_TYPE=XYZ ... Trigger <DEFE> from Entity: FIELD.MODEL [ 1] #define ENTITY_TYPE=XYZ Trigger <DTLF> from Field: FIELD.TABLE.MODEL ...

What the ... is this defintion for entity FIELD.MODEL? BTW: And, this defines are not local to the entity :-(   Background: We do have different 'types' of entities in a component, like visible entities or auxiliary entities. I looking for a simple way to tell the globale procs (for read or write or ...) which kind of entity it is. For the whole component, this could be done by the DEFINE-trigger and some coding in a general INIT-Operation. But how to do this for entities?  a) the DEFE trigger should do what it have to do. And this local to the entity  b) I need some kind of INIT for the entity (collection) Any ideas? BTW: This should not interference the rest of the code, as my colleagues don't like to change there code or see changed code :-) Ingo

And I used the MNUS trigger to simulate the alternative motto where the first definition wins: ; Let’s assume we change the motto to “the first definition blocks the following ones”: ; Local variation is compiled BEFORE the modeled one so precompiler guards are working as expected. #define DOSOMETHING ; the local one #ifundefined STD_DEFE_GUARD #define STD_DEFE_GUARD #warning guarded is active #ifdefined DOSOMETHING #warning somethingtodo locally #endif #endif ; the simulated modeled one #ifundefined STD_DEFE_GUARD #define STD_DEFE_GUARD #warning guarded is active #ifdefined DOSOMETHING #warning somethingtodo #endif #endif   Compile returned: (MNUS) #warning guarded is active (MNUS) warning: 1000 - guarded is active (MNUS) #warning somethingtodo locally (MNUS) warning: 1000 - somethingtodo locally   And the listing reads: Trigger <MNUS> from Form: A_TEST1 [ 1] ; Let’s assume we change the motto to “the first definition blocks the following ones”: [ 2] ; Local variation is compiled BEFORE the modeled one so precompiler guards are working as expected. [ 4] #define DOSOMETHING [ 5] ; the local one [ 6] #ifundefined STD_DEFE_GUARD [ 7] #define STD_DEFE_GUARD [ 8] #warning guarded is active (MNUS) warning: 1000 - guarded is active [ 9] #ifdefined DOSOMETHING [ 10] #warning somethingtodo locally (MNUS) warning: 1000 - somethingtodo locally [ 11] #endif [ 12] #endif [ 14] ; the simulated modeled one [ 15] #ifundefined STD_DEFE_GUARD [ 16] ;#define STD_DEFE_GUARD [ 17] ;#warning guarded is active [ 18] ;#ifdefined DOSOMETHING [ 19] ;#warning somethingtodo [ 20] ;#endif [ 21] #endif


Author: ulrich-merkel (ulrichmerkel@web.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:39 AM UTC

define trigger on entity level

Author: i2stiller@gmx.de (istiller)

Hi freaks Did anyone of you use the define trigger on entity level? I just did so and got a strange listing (9.7.04)

Trigger <DEFE> from Entity: TABLE.MODEL [ 1] #define ENTITY_TYPE=XYZ ... Trigger <DEFE> from Entity: FIELD.MODEL [ 1] #define ENTITY_TYPE=XYZ Trigger <DTLF> from Field: FIELD.TABLE.MODEL ...

What the ... is this defintion for entity FIELD.MODEL? BTW: And, this defines are not local to the entity :-(   Background: We do have different 'types' of entities in a component, like visible entities or auxiliary entities. I looking for a simple way to tell the globale procs (for read or write or ...) which kind of entity it is. For the whole component, this could be done by the DEFINE-trigger and some coding in a general INIT-Operation. But how to do this for entities?  a) the DEFE trigger should do what it have to do. And this local to the entity  b) I need some kind of INIT for the entity (collection) Any ideas? BTW: This should not interference the rest of the code, as my colleagues don't like to change there code or see changed code :-) Ingo

Hi Gerton, looks like I was not precise in my post, as I used the term "#define" not as a simple define, but as a shortcut for Ingos "guarded" example: The local variation is: #define DOSOMETHING ; the local one #ifundefined STD_DEFE_GUARD #define STD_DEFE_GUARD #warning guarded is active #ifdefined DOSOMETHING #warning somethingtodo locally #endif #endif The modeled code in DEFE reads: #ifundefined STD_DEFE_GUARD #define STD_DEFE_GUARD #warning guarded is active #ifdefined DOSOMETHING #warning somethingtodo #endif #endif The compile returns: Phase 7: Procs compilation (2\\DEFE) #warning guarded is active (2\\DEFE) warning: 1000 - guarded is active And the listing says: Trigger <DEFE> from Entity: A_TEST1.A_TEST [ 1] #ifundefined STD_DEFE_GUARD [ 2] #define STD_DEFE_GUARD [ 3] #warning guarded is active (2\\DEFE) warning: 1000 - guarded is active [ 4] #ifdefined DOSOMETHING [ 5] ;#warning somethingtodo [ 6] #endif [ 7] #endif [ 8] #define DOSOMETHING [ 9] ; the local one [ 10] #ifundefined STD_DEFE_GUARD [ 11] ;#define STD_DEFE_GUARD [ 12] ;#warning guarded is active [ 13] ;#ifdefined DOSOMETHING [ 14] ;#warning somethingtodo locally [ 15] ;#endif [ 16] #endif   Because the modeled code already sets the STD_DEFE_GUARD, the local #define DOSOMETHING will never result in a warning.


Author: ulrich-merkel (ulrichmerkel@web.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:39 AM UTC

define trigger on entity level

Author: i2stiller@gmx.de (istiller)

Hi freaks Did anyone of you use the define trigger on entity level? I just did so and got a strange listing (9.7.04)

Trigger <DEFE> from Entity: TABLE.MODEL [ 1] #define ENTITY_TYPE=XYZ ... Trigger <DEFE> from Entity: FIELD.MODEL [ 1] #define ENTITY_TYPE=XYZ Trigger <DTLF> from Field: FIELD.TABLE.MODEL ...

What the ... is this defintion for entity FIELD.MODEL? BTW: And, this defines are not local to the entity :-(   Background: We do have different 'types' of entities in a component, like visible entities or auxiliary entities. I looking for a simple way to tell the globale procs (for read or write or ...) which kind of entity it is. For the whole component, this could be done by the DEFINE-trigger and some coding in a general INIT-Operation. But how to do this for entities?  a) the DEFE trigger should do what it have to do. And this local to the entity  b) I need some kind of INIT for the entity (collection) Any ideas? BTW: This should not interference the rest of the code, as my colleagues don't like to change there code or see changed code :-) Ingo

Hi Gerton First: Is your table correct? It looks like, you put the #define myColor = YELLOW into the ECOP of component level instead of DEFE of component level. And scond, I  don't wrote the #warnig direct into ECOP but by include

  Modeled Entity Component Entity
Defines (DEFE)
 
; #define myColor = here your color #include STD_DEFE
#define myColor = YELLOW #include STD_DEFE
Collection Operations (ECOP)
#inlude STD_ECOP
./.

Where - STD_DEFE #warning DEFE: ‹myColor› - STD_ECOP #warning ECOP: ‹myColor› So I got three warnings *) #warning DEFE: WHITE #warning DEFE: YELLOW #warning ECOP: YELLOW Ingo *) could not give you the exact warnings as I at this very moment in a pub Laugh


Author: istiller (i2stiller@gmx.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:39 AM UTC

define trigger on entity level

Author: i2stiller@gmx.de (istiller)

Hi freaks Did anyone of you use the define trigger on entity level? I just did so and got a strange listing (9.7.04)

Trigger <DEFE> from Entity: TABLE.MODEL [ 1] #define ENTITY_TYPE=XYZ ... Trigger <DEFE> from Entity: FIELD.MODEL [ 1] #define ENTITY_TYPE=XYZ Trigger <DTLF> from Field: FIELD.TABLE.MODEL ...

What the ... is this defintion for entity FIELD.MODEL? BTW: And, this defines are not local to the entity :-(   Background: We do have different 'types' of entities in a component, like visible entities or auxiliary entities. I looking for a simple way to tell the globale procs (for read or write or ...) which kind of entity it is. For the whole component, this could be done by the DEFINE-trigger and some coding in a general INIT-Operation. But how to do this for entities?  a) the DEFE trigger should do what it have to do. And this local to the entity  b) I need some kind of INIT for the entity (collection) Any ideas? BTW: This should not interference the rest of the code, as my colleagues don't like to change there code or see changed code :-) Ingo

Hi all All I want do do is to have a default behavior and sometime a special one :-) So I wrote for some (1) triggers a standard include file named STD_<abbr> (2) and put them in the triggers as default code 1) This are e.g. DEFN,DEFN, OPER,ECOP,EOOP,... 2) <abbr> is here a literal not the precompiler $triggerabbr For DEFx, a developer can include own DEFINEs in front of the #include, for other triggers, the proc code gets in after the #include So every component got a lot of useful extra operations and other "helpers" But sometimes, you have to change the default behavior a little bit. So define a flag #DEFINE DO_SOMETHING in DEFN and the component does something other Define e.g #DEFINE CLL_TYP=SUI in DEFE and the triggers know how to handle SelectUserInterface-entities ... The goal is, to minimize the ToDo's for developers but use the precompiler to "solve" most of the issues. So it's important, that the sequence of resolving triggers is stable and defines are resolved before other triggers. And as there are includes like STD_CONSTANTS I don't want to include them over and over. Only this first time I need them. On other hand, if there is a change to make at global level, it should be necessary to recompile all forms. So global things to execute are in global procs. As you know, it's not easy to find a balance between precompiler and global procs, but I believe, I got a good one BTW:  Our application is over 20 years old, so it's not so easy as if you can do all this from the scratch :-) Ingo


Author: istiller (i2stiller@gmx.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:39 AM UTC

define trigger on entity level

Author: i2stiller@gmx.de (istiller)

Hi freaks Did anyone of you use the define trigger on entity level? I just did so and got a strange listing (9.7.04)

Trigger <DEFE> from Entity: TABLE.MODEL [ 1] #define ENTITY_TYPE=XYZ ... Trigger <DEFE> from Entity: FIELD.MODEL [ 1] #define ENTITY_TYPE=XYZ Trigger <DTLF> from Field: FIELD.TABLE.MODEL ...

What the ... is this defintion for entity FIELD.MODEL? BTW: And, this defines are not local to the entity :-(   Background: We do have different 'types' of entities in a component, like visible entities or auxiliary entities. I looking for a simple way to tell the globale procs (for read or write or ...) which kind of entity it is. For the whole component, this could be done by the DEFINE-trigger and some coding in a general INIT-Operation. But how to do this for entities?  a) the DEFE trigger should do what it have to do. And this local to the entity  b) I need some kind of INIT for the entity (collection) Any ideas? BTW: This should not interference the rest of the code, as my colleagues don't like to change there code or see changed code :-) Ingo

... and to get the correct modified code for procs without a guard, the local trigger will have a trailing (or only) #include locals_<$entname>_<$triggerabbr> This way all the not guarded entries are compiled again after all the modeled ones, so the modifications should be executed.


Author: ulrich-merkel (ulrichmerkel@web.de)