[SOLVED] Nice coding - can I define something as function module on form?

Author: dammie@seznam.cz (dammie)

Hello, in my code I can use this : call L_my_proc_get_state ( ln_state ) if ( ln_state ) ... do something   I would like use more nice and readable command as this... if ( $my_function_get_state ) ... do something   Is there any way to do this on form or how to get it with proc / operation more nicely?   Thanks for tips..

5 Comments

  1. Using the returns code. Examples below.  regards,  Iain  

    v_numeric_variable = lp_get_the_state() v_string_variable = lp_get_the_text(param1, param2)

    .....  

    entry lp_get_the_state returns numeric {params/endparams} {variables/Endvariables} return v_state end

     

    entry lp_get_the_text returns string params string param1 : IN string param2 : IN endparams return $concat(param1," ",param2) end

    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  2. Thanks...But it seems with entry this doesnt work : v_numeric_variable = lp_get_the_state() ... I ve got error during compilation   But it inspired me using operation...   Proc code... variables

    handle this endvariables

    this = $instancehandle

    if ( this->get_state() )

     do something ...

    ...

    ... end   Operation trigger operation get_state   ...   return ln_state end


    Author: dammie (dammie@seznam.cz)
  3. Hmm, I use it all the time with entry what compiler error did you get?    Iain


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  4. Also, can you use $instancehandle->get_state() 


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  5. Ive found it, brackets cannot be ommited - compare with call ...   variables

    numeric v_numeric_variable endvariables

    v_numeric_variable = lp_get_the_state()   --  compiler OK

    v_numeric_variable = lp_get_the_state  -- compiler error

     

    call lp_get_the_state()  --  compiler OK

    call lp_get_the_state   --  compiler OK  

    return end entry lp_get_the_state

     return 1 end So, thanks...


    Author: dammie (dammie@seznam.cz)