compile subroutine wo_valid_program_call(ConvType, DataIo, SubrLabel, ReturnedValue)
begin condition
pre:
post:
end condition

$insert logical
$insert quote_equ
$insert msg_equates
$insert wo_log_equ
$insert prod_spec_equ

declare function msg, get_property, set_property, fieldcount

equ valid$         to 0    ;* successful
equ invalid_msg$   to 1    ;* bad data       -   print error message window
equ invalid_conv$  to 2    ;* bad conversion -          "         "
equ invalid_nomsg$ to 3    ;* bad but do not print the error message window
equ CrLf$          to char(13):char(10)

ReturnedValue = DataIo       
status() = Valid$              
*
begin case
   case ConvType = 'ICONV'
      TDataIo = DataIo
      Comments = field( TdataIo, '|', 2 )
      TDataIo = field( TdataIo, '|', 1 )
      swap "52nd" with '' in TDataIo      
      Convert ';' to @fm in TDataIo
      convert @upper_case to '' in TDataIo
      convert @lower_case to '' in TDataIO
      convert " `~!@#$%^&*()_+-=\][{}|';:/?.>,<" to '' in TDataIo
      convert '"' to '' in TDataIo
      ReturnedValue = TDataIo
      * let it be valid just warn
   case ConvType = 'OCONV'
      * no output conversion
      ReturnedValue = DataIo
   case otherwise$
      ReturnedValue = ''
      status() = invalid_conv$
end case
return
