Quote:Mark -
I'm Erika.
Quote:Still being a novice at Sbasic, I am a little confused about the sub-routine being in global code. I can understand it being there if I am going to use it in a number of elements. If, however, I planned to use it in one specific layout element, only, could I put the sub-routine, along with the other programming, in the on-element-entry event?
You could. I usually put routines that may be generally useful in GLOBAL CODE so I only have to look for them in one place. However, it will work from the same event where called.
Quote:With regard to:
vHeight = (@Int(vLen / 25) + 1) * 20
It appears to me that you are looking at the length of what is in the field (# of characters) (for example 200) dividing that by 25 (which would become 8), adding 1 (which would become 9) and then multiplying the product by 20 (which would become 180). Is this some magic formula for converting characters to pixels?
And, wouldn't the "formula" somehow be greatly affected by the width of the element as well as the number of charcters in the field?
Yes. It's not a magic number. You are interpreting the code correctly. It's just the numbers that worked for the element width and font size I was using. As both Height and Font Size are measured in pixels, no conversion is needed. Just a simple division to determine how many "lines" there are in my case at 25 characters per line) multiplied by a number a bit larger than the font size. The "+1" just creates an extra line of padding.