Uniface User Forum

 View Only
  • 1.  Functional subtypes after migrating from Uniface-9 to Uniface-10.

    Posted 12-19-2022 09:32
    I can't figure out what I see in functional subtypes after migrating from Uniface-9 to Uniface-10.

    In the original entity D_BUTTONS I see:
    Declarations

    Collection Script
    ....

    and before the entries:
    #ifundefined BreakInheritance_ent_D_BUTTONS_P_GENERAL

    In the subtype D_BUTTONS2 I see this:
    Declarations
    #define BreakInheritance_ent_D_BUTTONS_P_DUP
    #define BreakInheritance_ent_D_BUTTONS_P_GENERAL

    Collection Script
    ...
    And before the entries:
    #ifundefined BreakInheritance_ent_D_BUTTONS2_P_GENERAL (mind the '2')

    I noticed that additional warning and errors are generated when compiling forms with functional subtypes in Uniface-10 for code that was not included in the same form in Uniface-9. 
    Can somebody smarter then me tell me what I'm doing wrong?


    ------------------------------
    Wim Van Wijngaarden
    CAL Consult Gmbh
    ------------------------------


  • 2.  RE: Functional subtypes after migrating from Uniface-9 to Uniface-10.

    ROCKETEER
    Posted 12-20-2022 10:20
    Hi Wim,

    Uniface 10 increases the granularity of inheritance from container to module, and these defines are to reinstate how v9 did it. To understand how they work, you need to look at how the compiler works when compiling scripts. The relevant steps when compiling the component proc are to collect the script from all levels of the container's inheritance, with the most generic location first and the most specific last.  An example result would be 

    Declarations
    ; From D_BUTTONS
    
    ; From D_BUTTONS2
    #define BreakInheritance_ent_D_BUTTONS_P_DUP
    #define BreakInheritance_ent_D_BUTTONS_P_GENERAL
    
    Collection Script
    ; From D_BUTTONS
    #ifundefined BreakInheritance_ent_D_BUTTONS_P_GENERAL
      entry lpEntryFrom_D_BUTTONS
      end
    #endif
    
    ; From D_BUTTON2
    #ifundefined BreakInheritance_ent_D_BUTTONS2_P_GENERAL
      entry lpEntryFrom_D_BUTTONS
      end
    #endif
    ​

    The precompiled is then processed, resolving all the #directives and removing the #ifundefined BreakInheritance_ent_D_BUTTONS_P_GENERAL block, as BreakInheritance_ent_D_BUTTONS_P_GENERAL is defined.
    Declarations
    ; From D_BUTTONS
    
    ; From D_BUTTONS2
    #define BreakInheritance_ent_D_BUTTONS_P_DUP
    #define BreakInheritance_ent_D_BUTTONS_P_GENERAL
    
    Collection Script
    ; From D_BUTTON2
    #ifundefined BreakInheritance_ent_D_BUTTONS2_P_GENERAL
      entry lpEntryFrom_D_BUTTONS
      end
    #endif
    ​​
    The compiler will finally compile the result and save the component. If these defines were not present, the entry lpEntryFrom_D_BUTTONS would be included in v10 but not in v9.

    I am not sure what the extra messages are. Do you have an example?

    I hope this helps
    Mike
    ​​​​​

    ------------------------------
    Michael Taylor
    Rocket Internal - All Brands
    ------------------------------



  • 3.  RE: Functional subtypes after migrating from Uniface-9 to Uniface-10.

    Posted 12-20-2022 11:03

    I could send you the XML's of the primary entity, the functional subtype and the compile listing in which the problem appears. (we use March Hare).

    Is that enough?



    ------------------------------
    Wim Van Wijngaarden
    CAL Consult Gmbh
    ------------------------------



  • 4.  RE: Functional subtypes after migrating from Uniface-9 to Uniface-10.

    ROCKETEER
    Posted 12-20-2022 11:43
    It would have to be a Uniface export, but if you could just paste new warnings/errors from the message frame, it may be enough.

    Kind regards,
    Mike

    ------------------------------
    Michael Taylor
    Rocket Internal - All Brands
    ------------------------------



  • 5.  RE: Functional subtypes after migrating from Uniface-9 to Uniface-10.

    Posted 12-20-2022 14:33
    This is an example of the compiled code in U10, that is not used in U9.

    Trigger <FSCR> from Field: CMDUPDATE.TB2_COPIE.CAL

    [ 1] #ifundefined BreakInheritance_fld_TB2_P_DET
    [ 7]****** entry lp_update
    [ 8] variables
    [ 9] string hvfunktie
    [ 10] string hvmenu
    [ 11] endvariables
    [ 12] 1-1 if ($dbocc("WHENT") <= 0)
    (LP_UPDATE) warning: 1000 - Entity 'WHENT' not found
    [ 13] 2-1 return(-1)
    [ 14] 3-1 endif
    [ 15] 4 call lp_store
    [ 16] 5 hvmenu = $$MENU_ITEMS
    [ 17] 6 $$RUNFORM = "WENTU00"
    [ 18] 7 call X_MWKCHECK ; alleen uitvoeren als maatwerk is toegestaan
    [ 19] 8 hvfunktie = ""
    [ 20] 9 $2 = 0

    A lot of these extra lines are compiled, all under the same '#ifundefined BreakInheritance_fld_TB2_P_DET'
    This code exists in the main entity (which is called TB2), however this code is only used (and modified) when the accompanying button (CMDUPDATE in this case)  is painted on the component.

    I don't see any #define BreakInheritance_fld_TB2_P_DET'  line.

    I hope this is enough to determine my problem​

    ------------------------------
    Wim Van Wijngaarden
    CAL Consult Gmbh
    ------------------------------



  • 6.  RE: Functional subtypes after migrating from Uniface-9 to Uniface-10.

    Posted 12-21-2022 02:57
    Maybe I should refrase the problem.
    This is the case.
    We created in U9 an entity with multiple commandbuttons, each with some default code in the detail-trigger. This is default code that has to be modified when such a commandbutton is painted on a component. If not modified, this code will generate warnings.

    For this entity some functional subtypes are created without any changes.

    So, the entity contains  incorrect code. This is no problem however, because this code is only interpreted when the commandbutton is painted on a component, and of course, the code in the detail trigger is modified. This works fine for the original entity and the subtypes in U9.

    That 's different in U10.
    It works fine for the original entity, but when a subtypes is used all the code, even for buttons that are not painted, is compiled and generates warnings

    ------------------------------
    Wim Van Wijngaarden
    CAL Consult Gmbh
    ------------------------------



  • 7.  RE: Functional subtypes after migrating from Uniface-9 to Uniface-10.
    Best Answer

    ROCKETEER
    Posted 12-21-2022 07:08
    Hi Wim,

    I think need an example to play with to get a clearer picture. Maybe it would be better to log a call with support.

    Kind regards,
    Mike

    ------------------------------
    Michael Taylor
    Rocket Internal - All Brands
    ------------------------------



  • 8.  RE: Functional subtypes after migrating from Uniface-9 to Uniface-10.

    Posted 12-21-2022 07:18
    Thanks, I will do that.

    ------------------------------
    Wim Van Wijngaarden
    CAL Consult Gmbh
    ------------------------------