Seems a little basic but I'm missing something I think...
I'm trying to use the 'formattedheight' property for a field to set its required height after updating the field with some text. This is important to me because the field contains data of varying length and I'm trying (playing?) with adjustring the field height so that all the data may be seen without having to use a scroll bar.
So, I'm using a code line like :
Code: Select all
local nHt, nNextTop --just declare my vars
set the text of field "fldMyField" to "The quick brown fox jumped" & cr & "over that darn lazy dog" --put some text in the field
--set the text of field "fldMyField" to "The fox jumped over the dog" --or put some other text in the field
put the formattedheight of field "fldMyText" into nHt --get the height of MyField with the varying texts in it
if nHt > the height of field "fldMyText" then --check to see if the text is 'too tall' for the standard field height
set the height of field "fldMyField" to nHt --change the height of fldMyField
put the top of field "fldMyField" into nNextTop --get the 'Y' loc of the field and then...
add nHt to nNextTop --add the new required height to it
add 6 to nNextTop --add any height offset / spacing required between successive fields
else
put 0 into nNextTop --Not, no change in height, therefore, no change required to next field top
end if
However, my problem :
I have a generic / stack-side handler that populates the card (with fldMyField" on it) which is passed the name of the card to update and the DataBase ID for the data records to add...
Code: Select all
Populate_Card sCard, nID
Code: Select all
put the formattedheight of field "fldMyText" into nHt
Code: Select all
put the formattedheight of field "fldMyText" of card sCard into nHt
If I enclose my target with brackets like :
Code: Select all
put the formattedheight of (field "fldMyText" of card sCard) into nHt
If I try, on a card-side script (a script that resides on the card it pertains to - rather than a stack-side script which then references the card)
Code: Select all
put the formattedheight of field "fldMyText" of this card into nHt
Code: Select all
put "crdMyCard" into sCard
put the formattedheight of field "fldMyText" of sCard into nHt
It seems that the code lines work when the script resides on the card it pertains to (and even accepts all the additional 'on card...' statements but refuses (for me) to run on a stack-side srcipt.
Anyone able to shed some light on whether this is this a bug with LC


Better still, is there a work-around / way to fix my problem ?
Thanks.
Regards.