8 21 SET_REF

LANSA Technical

8.21 SET_REF

The SET_REF command is used to assign a component reference to a variable that has been defined with a dynamic reference in the DEFINE_COM statement. With a dynamic reference, an instance of a component is created only when a reference to it is assigned with the SET_REF command.

Note: Beware of using long object names with this command.
SET_REF Com(#MyObject) To(*CREATE_AS #MyFormWithLongNames) works with long names.
SET_REF Com(#MyObject) To(*CREATE_FROM #MyFormWithLongNames) doesn't work as it is runtime and long names are not available.

Also See

8.21.1 SET_REF Parameters

8.21.2 SET_REF Examples

8.13 IF_REF

 

 

                                                           Required       

                                                                          

       SET_REF --- COM  ------- Variable name|variable name------->      

                                                                          

               >-- TO  -------- Reference expression ------------->       

                                                                          

               >-- CONTEXT  --- *DEFAULT  ------------------------>       

                                *OWNER                                    

                                *MODULE                                   

                                *NEW                                      

                                *NAMED ---- #Variable                     

                                                                          

               >-- COM_ERROR--- *ABORT ---------------------------|       

                                *IGNORE                                   

                                *SET_NULL