f_outrep_array.srf 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. $PBExportHeader$f_outrep_array.srf
  2. global type f_outrep_array from function_object
  3. end type
  4. forward prototypes
  5. global subroutine f_outrep_array (string arg_outrepstr)
  6. end prototypes
  7. global subroutine f_outrep_array (string arg_outrepstr);Long ll_cnt,cnt
  8. String ls_outrepstr
  9. string ls_outrep
  10. string local_outrep[]
  11. ll_cnt = 0
  12. ls_outrepstr = arg_outrepstr
  13. IF sys_power_issuper Or arg_outrepstr = '0' THEN
  14. SELECT count(*) INTO :cnt
  15. From u_outrepdef;
  16. IF sqlca.SQLCode <> 0 Or cnt = 0 THEN
  17. ll_cnt++
  18. local_outrep[ll_cnt] = ''
  19. ELSE
  20. DECLARE cur_plugins CURSOR FOR
  21. SELECT distinct u_outrepdef.outrepname
  22. FROM u_outrepdef;
  23. OPEN cur_plugins;
  24. FETCH cur_plugins Into :ls_outrep;
  25. DO WHILE sqlca.SQLCode = 0
  26. ll_cnt++
  27. local_outrep[ll_cnt] = ls_outrep
  28. FETCH cur_plugins Into :ls_outrep;
  29. LOOP
  30. CLOSE cur_plugins;
  31. END IF
  32. ELSEIF Trim(arg_outrepstr) = '' Or Trim(arg_outrepstr) = '-1' THEN
  33. local_outrep[1] = ''
  34. ELSE
  35. DO WHILE Len(ls_outrepstr) <> 1
  36. ls_outrepstr = Replace( ls_outrepstr, 1, 1, '' )
  37. ls_outrep = Left(ls_outrepstr,Pos(ls_outrepstr,',',1) - 1)
  38. ll_cnt++
  39. local_outrep[ll_cnt] = ls_outrep
  40. ls_outrepstr = Replace ( ls_outrepstr, 1, Pos(ls_outrepstr,',',1) - 1, '' )
  41. LOOP
  42. END IF
  43. sys_user_outrep = local_outrep
  44. end subroutine