Uniface User Forum

 View Only
  • 1.  @UnifAce "empty trigger" message points to a misleading postion

    Posted 09-19-2024 09:11

    Hi
    The message  "empty trigger" refers to an "unfavorable" place in the code.
    Example

    trigger hello
    ; not
    ; used
    ; anymore

    trigger world                                 <======= X ==========
    $1 = "This trigger does something"

    Compiling gives a message "empty trigger" (in some line number)
    When you click on the messag, UnifAce you jumps to position X.
    Oops, "trigger world" is filled, what is wrong here ?
    I understand why the parser selects this position: The first position in this line is the first statement after "trigger hello", and so "hello" is empty.
    But from the programmer's point of view, the faulty part is either the entire line "trigger hello" or at least the end of this line.

    This "bug" should be relatively easy to fix, or :-)

    Ingo



    ------------------------------
    Ingo Stiller
    Aareon Deutschland GmbH
    ------------------------------


  • 2.  RE: @UnifAce "empty trigger" message points to a misleading postion

    Posted 09-20-2024 04:31
    Edited by Norbert Lauterbach 09-20-2024 04:39

    Hi Ingo,

    Hi Uniface,

    with "trigger" we get

    Compile Form: 'TEST_XML'
    Form: TEST_XML
    Phase 2: Model definitions
    warning: 1016 - (Fields for) entity ENTITY not found in application model, generating now...
    Phase 3: Prep. structure
    Phase 4: Form definitions
    Phase 5: Background text
    Phase 6: Component variables
    Phase 7: Procs compilation
    (2\HELLO) info: 1000 - Empty trigger
    (2\WORLD) info: 1000 - "end" assumed
    Phase 8: Structure tables
    Phase 9: Descriptor
    info: 1207 - Component TEST_XML has ID ID2024082916164992.
    Phase 10: Save form
    1820 bytes used for model definitions
    42 bytes used for paint information
    88 bytes used for paint labels
    40 bytes used for component variables
    0 bytes used for input translation table
    0 bytes used for output translation table
    128 bytes used for literal label pool
    34 bytes used for literal misc pool
    596 bytes used for structure tables
    2748 bytes total memory usage
    Compilation done: [info 3, warnings 1, errors 0]



    with "entry" we get



    Compile Form: 'TEST_XML'
    Form: TEST_XML
    Phase 2: Model definitions
    warning: 1016 - (Fields for) entity ENTITY not found in application model, generating now...
    Phase 3: Prep. structure
    Phase 4: Form definitions
    Phase 5: Background text
    Phase 6: Component variables
    Phase 7: Procs compilation
    Phase 8: Structure tables
    Phase 9: Descriptor
    info: 1207 - Component TEST_XML has ID ID2024082916164992.
    Phase 10: Save form
    1820 bytes used for model definitions
    42 bytes used for paint information
    88 bytes used for paint labels
    40 bytes used for component variables
    0 bytes used for input translation table
    0 bytes used for output translation table
    128 bytes used for literal label pool
    34 bytes used for literal misc pool
    596 bytes used for structure tables
    2748 bytes total memory usage
    Compilation done: [info 1, warnings 1, errors 0]



    with "function" we get

    Compile Form: 'TEST_XML'
    Form: TEST_XML
    Phase 2: Model definitions
    warning: 1016 - (Fields for) entity ENTITY not found in application model, generating now...
    Phase 3: Prep. structure
    Phase 4: Form definitions
    Phase 5: Background text
    Phase 6: Component variables
    Phase 7: Procs compilation
    (2\WORLD) function world
    (2\WORLD) error: 1000 - Preceding module (function HELLO) should end with an 'end' statement
    error: 1112 - Total ProcScript compile errors: 1.
    phase completed with error-code -1
    1114 - ****** NO NEW COMPONENT CREATED *******
    Compile done: [info 0, warnings 1, errors 1]
    Why is there a different behaviour between trigger, entry and function?
    Is it allowed to define triggers with user defined names?


    Regards 
    Norbert



    ------------------------------
    Norbert Lauterbach
    Infraserv Gmbh & Co. Höchst Kg
    Frankfurt DE
    ------------------------------



  • 3.  RE: @UnifAce "empty trigger" message points to a misleading postion

    Posted 09-20-2024 05:35

    Hi Norbert
    Yes, trigger can be defined  with "user names"
    This can be used, for example, when calling UnifAce from "outside", e.g. from a WEB environment  or OCX-containers

    Ingo


    trigger

    Declare a trigger.

    trigger TriggerName
        {public soap} ; Execute trigger only
        {public web | partner web }
        {ScopeBlock}
        {ParamsBlock}
        {VariablesBlock}
    
        ProcScript
    
        {return {(Value) }}
    end

    Declaration

    • TriggerName-valid trigger name. For more information, see the "Triggers: System" and "Triggers: Interactive" topics.
    • public web-trigger can be called from a web browser, RESTful service, or other web client when used in DSPs, USPs, and Service components. For more information, see the "web" topic.
    • ScopeBlock-specifies the data to be included in a DSP request-response exchange. For more information, see the "scope...endscope" topic.
    • ParamsBlock-defines the trigger's parameters, if any. For more information, see the "params...endparams" topic.
    • VariablesBlock-defines the local variables used by the trigger, if any. For more information, see the "Variables" topic.



    ------------------------------
    Ingo Stiller
    Aareon Deutschland GmbH
    ------------------------------