#

# LogiView

## Function 'sel_logic'

| This function is used to read a database value. The corresponding database field must be the type "Logic".
| If the function is called using the Where clause "actual', LogiView tries to read the table field value from the current mask.
| If the number of values which are returned by the where clause is unknown, it is absolutely necessary to call sel_value(count) and proceed with the programming depending on the result. If the result > 1 , an array must be read-in. Example: RES=sel_value(count({FLD}),{WHERE|actual}) if(RES==0) put("No result") elseif(RES==1) {DAT_VAR}= sel_logic({FLD},{WHERE|actual})else else {DAT_VAR}= sel_logic({FLD},{WHERE|actual})else endif
| ### Syntax:
| {LOG_VAR}= sel_logic({FLD},{WHERE|actual}) or {LOG_VAR}= sel_logic(act_fld)
| ### I/O parameters:
| {FLD} | Name of a table field in the format "table name.column name".
| {WHERE|actual} | Where clause followed by a database access.
| act_fld | The keyword "act_fld" defines the access to the current (mask) field without the necessity to know its name. "Act_fld" represents a unique and complete Where clause; therefore, using further Where clauses is excluded. "Act_fld" can only be used if LogiView is called as "pre-field" or "post-field" userexit.
|  | In this case no database access is necessary. However, the mask contents may vary from the actual database contents unless an update was performed just before.
| - |
| ### Return value:
| {LOG_VAR} | Value read from the database.
| ### Example:
| Declaration of Variables
     10 if (sel_logic("T_USER.C_MNG_FLG","C_NAME"=user()) !=TRUE)

     30    put_mes("EDB-BAS-NEED-MNG-PRV")

     40 exit()

     50   endif
| Result:
| Functions and commands: DB/Mask Interface