Thanks for reminding me of “the”.

Need to test a little more but this seems to work:

function calculateLegFldWidth tText,tFontName,tFontSize
   set the textFont of the templateField to tFontName
   set the textSize of the templateField to tFontSize
   put measureText(tText,the templateField) + 8 into tFldWidth -- 8 to allow 
for fld margins
   return tFldWidth
end calculateLegFldWidth


All the best

Terry


> On 23 Feb 2015, at 15:52, J. Landman Gay <jac...@hyperactivesw.com> wrote:
> 
> On February 23, 2015 5:16:51 AM CST, Terence Heaford <t.heaf...@icloud.com> 
> wrote:
>> Tried it as:
>> 
>> put measureText("testText”,templateField) into theTextWidth
>> 
>> Wasn’t expecting it to work and it didn’t but should it have crashed
>> LC?
>> 
>> Would it be a good idea for it to work with the templateField?
> 
> 
> Livecode should never crash, so this is worthy of a report.  That said, the 
> templateField is a function and it needs to be preceded by "the". 
> 
> The measureText function only needs a reference to any object that has text 
> properties, either its own or inherited. You could reference the card for 
> those probably.  Or try it again with the templateField after assigning it 
> the text properties you want. Might work. 
> -- 
> Jacqueline Landman Gay         |     jac...@hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to