lineoffset doesn't find empty lines

Brian Yennie briany at qldlearning.com
Sun Aug 16 18:52:56 EDT 2009


Keep in mind that all of these (cr&cr) methods will miss an empty line  
as the FIRST line. So you need to do something like:

function emptyOffset tText
	if (char 1 of tText is cr) then return 1
	else return lineOffset(cr&cr, tText)+1
end emptyOffset

> I also see that
>
> lineoffset(cr & cr, tText) + 1
>
> seems to work well.
>
> Best,
>
> Mark Smith
>
> On 16 Aug 2009, at 22:42, BNig wrote:
>
>>
>> Björnke,
>>
>> would
>>
>> ----------
>> on mouseUp pMouseBtnNo
>>   put field 1 into temp
>>   repeat while theLine > 0
>>       put lineoffset(cr&cr,temp) into theLine
>>       if theLine > 0 then delete line theLine + 1 of temp
>>   end repeat
>>   put temp into field 1
>> end mouseUp
>> ---------------
>>
>> not do it? it works for me, if I understand you correctly.
>> regards
>> Bernd
>>
>>
>> Björnke von Gierke wrote:
>>>
>>> my main problem is that it's all based on lines. so finding the  
>>> empty
>>> lines allows me to dismiss the line after it, then parse the line
>>> after that etc. (for example). Frankly there must be some way to  
>>> find
>>> the number of the first occurrence of an empty line, and get a  
>>> result
>>> in lines, not in chars, right? i really wish i could find it,  
>>> there's
>>> just too many words in this language to find the one for my specific
>>> task ;-)
>>>
>>> On 16 Aug 2009, at 18:51, Brian Yennie wrote:
>>>
>>>> offset( (the lineDelimiter)&(thelineDelimiter) ) ?
>>>



More information about the use-livecode mailing list