f_texttohtml.srf 769 B

12345678910111213141516171819202122232425262728293031323334
  1. $PBExportHeader$f_texttohtml.srf
  2. global type f_texttohtml from function_object
  3. end type
  4. forward prototypes
  5. global function string f_texttohtml (string arg_text)
  6. end prototypes
  7. global function string f_texttohtml (string arg_text);long ll_num
  8. ll_num = 1
  9. do while true
  10. ll_num = pos(arg_text, '~r~n', ll_num)
  11. if ll_num = 0 then exit
  12. arg_text = replace(arg_text, ll_num, 2, '<br>')
  13. ll_num = ll_num + 4
  14. loop
  15. ll_num = 1
  16. do while true
  17. ll_num = pos(arg_text, '~r', ll_num)
  18. if ll_num = 0 then exit
  19. arg_text = replace(arg_text, ll_num, 1, '<br>')
  20. ll_num = ll_num + 4
  21. loop
  22. ll_num = 1
  23. do while true
  24. ll_num = pos(arg_text, '~n', ll_num)
  25. if ll_num = 0 then exit
  26. arg_text = replace(arg_text, ll_num, 1, '<br>')
  27. ll_num = ll_num + 4
  28. loop
  29. return arg_text
  30. end function