Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
from letside, furthest and closest line in multiline string
#2
try this Ron
Code:
Copy      Help
str test1 test2=
;;;;;;;;;a
;;;;;;;;;;;;;;b1
;;;;;;;;;;;;;;b2
;;;;c1
;;;;c2

int j closest furthest lineC lineF
str c f
for j 0 2000000000
,if(test1.getl(test2 -j)<0) break ;;no more
,if(test1.len=0) continue ;;skip empty
,if j=0
,,closest=test1.len; furthest=test1.len
,,c=test1; f=test1;lineC=j; lineF=j
,else
,,if test1.len < closest
,,,closest=test1.len; c=test1; lineC=j
,,if test1.len > furthest
,,,furthest=test1.len; f=test1; lineF=j
out F"closest = {c.trim} on line {lineC+1} furthest={f.trim} on line {lineF+1}"


Messages In This Thread
RE: from letside, furthest and closest line in multiline string - by Kevin - 06-17-2021, 12:57 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)