f_clen.srf 586 B

123456789101112131415161718192021222324252627282930
  1. $PBExportHeader$f_clen.srf
  2. $PBExportComments$计算Column的长度--函数
  3. global type f_clen from function_object
  4. end type
  5. forward prototypes
  6. global function integer f_clen (string stype)
  7. end prototypes
  8. global function integer f_clen (string stype);int li
  9. if stype='date' or stype='time' then//字段长度象素
  10. li=10
  11. else
  12. if stype='datetime' then
  13. li=19
  14. else
  15. if stype='number' or left(stype,7)='decimal' then
  16. li=12
  17. else
  18. if left(stype,4)='char' then
  19. li=long(mid(stype,6,len(stype)-6))
  20. else
  21. li=12
  22. end if
  23. end if
  24. end if
  25. end if
  26. return li
  27. end function