Line numbers for soft-wrapped styled text?

dunbarx dunbarx at
Sat Mar 25 19:40:55 EDT 2017


Make two small fields, both with lineWrap set to "false". Line up the two
field horizontally. Put some wrapped text into vld 1. Put this in a button

on mouseUp
   lock screen
   put fld 1 into storage
   replace return with return & numToChar(208) in fld 1
   put fld 1 into workingText
   put the formattedText of fld 1 into temp
   put 1 into line 1 of lineCounter
   put 1 into lineTracker
   repeat with y = 1 to the number of lines of temp
      if line y of temp contains numToChar(208) then
         add 1 to lineTracker
         put lineTracker into line y of lineCounter
      end if
   end repeat
   put storage into fld 1
   put lineCounter into fld 2
end mouseUp

I needed to pollute the source field in order to use the formattedText and
identify the hard returns.

View this message in context:
Sent from the Revolution - User mailing list archive at

More information about the use-livecode mailing list