\"On compiling, UnifAce treats procedure local variables like fields. Or better, a \"\"valid name\"\" could be a variable or a field. When the procedure is within a component, UnifAce trys after the syntax check to find the \"\"name\"\" in the pool of the entity fields and the declared variables. If there is no match, a warning will write to the message frame. When the procedure is a globale one, after the syntax check there is only a check against the declared variables. If the name not found, no furher check will done and no message will be displayed. Except of few cases, there is no need to access fields in globale procedures. So to get a warning when a \"\"name\"\" is not a variable and not a field, an enhancement to the proc language will be nice\"

Use Case

\"Two new features will be needed: * New VariableSpec in VARIABLES \"\"field\"\" {datatype} Declares as a field. The assignment to the field in a hitlist will be done at runtime (as before) * New pragma to check \"\"names\"\" against VARIABLES (or the field pool as before) #PRAGMA DECLARE_EXPLICIT This pragra tells the compiler to check against VARIABLES and then (if in a component) againts the field pool. If the \"\"name\"\" is not found, a warning (error) will be issued When this pragma is within the procedure body, its scope is only the procedure. Example: GP_XYZ #PARGMA DECLARE_EXPLICIT variables string v_STR field A_FIELD.A_ENTITY endvariables $01=v_STR , Okay $01=A_FIELD.A_ENTITY , Okay $01=something , Warning (or Error) END\"


It is very hard to find missspelled variables names in a globale procedure as there is no warning at all. On runtime, there is a warning running through the message line but no possiblity to catch this kind of error. To write error free programms, it is very important to have a warning on compile time, not at runtime!



Operating System

Not Applicable



Leave a Reply