Displaying a table

Geoff Canyon gcanyon at inspiredlogic.com
Mon Jan 14 03:36:01 EST 2002


At 10:22 AM +1000 1/14/02, Sarah Reichelt wrote:
>on checkSize theString
>    put theString into fld "Format Check"
>    repeat while the formattedWidth of fld "Format Check" > the width of fld
>"Format Check"
>        delete last char of theString
>    end repeat
>    
>    return theString
>end checkSize

You can simplify this, and speed it up a bit, with the following:

function truncateToFit theString
put the string into fld "Format Check"
return (line 1 of the formattedText of fld "Format Check")
end truncateToFit



More information about the use-livecode mailing list