November 15, 200916 yr I have written a small invoice solution in Filemaker 8.5 Advanced. There is a description field for each job that's shown and when they appear on the invoice layout, the sliding/printing means the rows only take up as much size as they require. However If there are too many entries or too many lines of text on some of the descriptions, the final invoice page can go on to a second page. I don't really want this to happen (filemaker doesn't seem to deal with headings well on more than 1 page) and would rather a warning appears as soon as the descriptions go above a certain amount of lines of text. Is there any means of easily calculating the number of lines of text used in a text box (a carriage return would increase the line by 1). I was hoping to add a calculation field with something 'like' Get(TextLineCount) or perhaps calculating the number of times a carriage return occurs in a text field. I could then fire up a graphic container that has a warning triangle as soon as that limit has been reached. Thanks in advance. : Edited November 15, 200916 yr by Guest
November 16, 200916 yr Author Looks like I may have figured it out just after posting. I made sure the text field 'Description' used courier (fixed font width which gives 70 characters per line) then used:- (Length ( Description )+(PatternCount ( Description ; "¶" )) * 70)/70 I need to figure out how to round values like 2.03 up to 3, but I think I'm on the right track : [edit] In case anyone else interested. Just found ceiling command. So it works fine now : So number of lines used in a text box calculated by:- Ceiling ( ((Length ( fieldname )+(PatternCount ( fieldname ; "¶" )) * x)/x) ) where x is the number of columns. (There may be a better way of doing this, I'm sure someone will point it out : ). Edited November 16, 200916 yr by Guest
Create an account or sign in to comment