f_setliblist.srf 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. $PBExportHeader$f_setliblist.srf
  2. global type f_setliblist from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_setliblist ()
  6. end prototypes
  7. global function integer f_setliblist ();Long rslt = 1
  8. String ls_list
  9. String ls_path
  10. ls_list = getlibrarylist ()
  11. ls_path = Trim(Mid(ls_list,1,Pos(ls_list,',') - 1))
  12. Long ls_i
  13. Long ll_loca = 0
  14. //FOR ls_i = 1 To Len(ls_path)
  15. // IF Mid(ls_path,ls_i,1) = '\' THEN
  16. // ll_loca = ls_i
  17. // END IF
  18. //NEXT
  19. ll_loca = LastPos(ls_path, '\')
  20. ls_path = Trim(Mid(ls_path,1,ll_loca))
  21. String LS_TEMPADDLIB
  22. DECLARE ADDLIB CURSOR FOR
  23. SELECT libname
  24. From u_setliblist;
  25. OPEN ADDLIB;
  26. FETCH ADDLIB Into :LS_TEMPADDLIB;
  27. DO WHILE SQLCA.SQLCode = 0
  28. ls_list+= ','+ls_path+LS_TEMPADDLIB
  29. FETCH ADDLIB Into :LS_TEMPADDLIB;
  30. LOOP
  31. CLOSE ADDLIB;
  32. //动态取消Ew_printbill.pbd, 因为用户添加的是Ew_printbill.pbl, 如果保留pbd,可能读取有影响
  33. IF Pos(lower(ls_list), ls_path+ "ew_printbill.pbd,") > 0 THEN
  34. ls_list = replace(ls_list, Pos(lower(ls_list), ls_path+ "ew_printbill.pbd,"), len( ls_path+ "ew_printbill.pbd,"), '') //系统默认打印格式
  35. //messagebox('', ls_list)
  36. elseIF Pos(lower(ls_list), "ew_printbill.pbd,") > 0 THEN
  37. ls_list = replace(ls_list, Pos(lower(ls_list), "ew_printbill.pbd,"), len( "ew_printbill.pbd,"), '') //系统默认打印格式
  38. else
  39. //openwithparm(w_message_err, ls_list)
  40. END IF
  41. sys_dftpblname = "Ew_printbill.pbl"
  42. //IF sys_version = 802001 THEN
  43. // sys_dftpblname = "Ew_printbill_bn.pbl"
  44. //ELSEIF sys_version = 802002 THEN
  45. // sys_dftpblname = "Ew_printbill_ep.pbl"
  46. //ELSEIF sys_version = 802003 THEN
  47. // sys_dftpblname = "Ew_printbill_ep+.pbl"
  48. //END IF
  49. IF Not Pos(ls_list, ls_path+ sys_dftpblname) > 0 THEN
  50. ls_list+= ','+ ls_path+ sys_dftpblname //系统默认打印格式
  51. END IF
  52. //IF Not Pos(ls_list, ls_path+ sys_pblname) > 0 THEN
  53. // ls_list+= ','+ ls_path+ sys_pblname //客户默认打印格式
  54. //END IF
  55. rslt = SetLibraryList(ls_list)
  56. RETURN rslt
  57. end function