How do I Create a Custom Property, part 19,214,651.5 B23

David Burgun dburgun at dsl.pipex.com
Sat Apr 24 08:09:39 EDT 2004


>Hi Mark,
>
>>Dave, if we see the return character as a divider or separator 
>>rather than a terminator,
>>it all makes a bit more sense, I think. The line count will always 
>>be the number of return
>>characters + 1, as it is assumed that there is data both before and 
>>after a return character .
>
>put "1" & CR & "2" & CR & "3" into fld 1
>
>-> 3 lines, but only 2 CRs...
>
>But how comes, what i explained yesterday?
>

Because if the last character isn't a CR, then 1 is added to the line 
count. It's like I said, it's better to think of yjhe CR as a line 
*terminator*. As long as you *always* terminate each line with a CR 
then the number of lines is equal to the number of CRs. BUT if the 
last line does not have a CR, then one is implied by the engine (or 
whatever). The only time this becomes an issue is in the IDE (since 
it doesn't add a CR is you don't type one), or if you do this:

return & "myLine"

instead of

"myline" & return

Since the former case involves adding more code in order to avoid 
spuriously creating empty lines, it following that the latter case is 
the best practise - to me anyway.

All the Best
Dave


More information about the use-livecode mailing list