f_var.srf 734 B

1234567891011121314151617181920212223242526272829
  1. $PBExportHeader$f_var.srf
  2. $PBExportComments$自定义变量函数--自定义函数
  3. global type f_var from function_object
  4. end type
  5. forward prototypes
  6. global function string f_var (string s_var)
  7. end prototypes
  8. global function string f_var (string s_var);string ls1,ls2
  9. int li1,li2
  10. if isvalid(w_rpt_preview) then
  11. //ls1=w_rpt_preview.istr_rpt.uservar
  12. elseif isvalid(w_rpt_edit) then
  13. ls1=w_rpt_edit.istr_rpt.uservar
  14. end if
  15. //参数:s_var="系统名称='酒店系统',操作员='Mr. Zhang'"
  16. if ls1>'' then
  17. if right(ls1,1)<>',' then ls1=ls1+','
  18. li1=pos(ls1,s_var+'=')
  19. if li1=0 then return ''
  20. li2=pos(ls1,",",li1)
  21. if li2=0 then return ''
  22. ls2=mid(ls1,li1+len(s_var)+2,li2 -(li1+len(s_var)+2) -1)
  23. end if
  24. return ls2
  25. end function