TEXT   82
procedure makeline
Guest on 12th March 2023 09:13:27 AM


  1. procedure makeline(f, stop_c, cl)
  2.  
  3.     local line, c
  4.     static c_count
  5.     initial c_count := 0
  6.  
  7.     line := ""
  8.     while c := reads(f) do {
  9.         if (c_count +:= 1) > cl then
  10.             break
  11.         if c == stop_c then
  12.             break
  13.         line ||:= c
  14.     }
  15.     return "" ~== line
  16.  
  17. end

Raw Paste

Login or Register to edit or fork this paste. It's free.