Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!ukc!stl!stc!datlog!torch!paul From: paul@torch.UUCP (Paul Andrews) Newsgroups: comp.sys.mac.hypercard Subject: Re: "line height and auto wraparound" Message-ID: <374@torch.UUCP> Date: 23 Jun 89 13:11:45 GMT References: <214100003@s.cs.uiuc.edu> Organization: TORCH Computers Ltd., Cambridge, England Lines: 33 detert@s.cs.uiuc.edu writes: >Is it possible for a script to determine whether a given string, containing no >carriage returns, can be placed in a particular field (window) and have each >char. of the string be immediately visible? Well, sort of. It is possible to determine whether the string fits AFTER you have placed it in the field (you could then remove it of course). You do something like the following: 1) put the text in the field. 2) Determine the height and textheight of the field 3) sit in a loop starting at the bottom of the field and working up to the top in jumps of the textheight. 4) In the loop 'click at x,y' (y being the variable decremented by textheight) 5) 'get the selectedline'. 6) Until the selectedline changes, you are in the same 'Hypercard line' even though you are in a different screen line. This may not be a direct answer to your question, and it is certainly not a complete algorithm but you should be able to use the same general method. This is not a wonderfully clean way of doing what you want, but if its absolutley essential, what choice do you have? - Paul.