Sat, 11 Jan 2003, Benja Fallenstein wrote:
Another way to do this is could be the way I did finding font size in
AWT's ScalableFont. Recursive function, which starts from the middle of
the strint and checks is the wanted position greater or lesser, splits
string into half, and starts a new recursions with the correct half. Of
course this needs a little optimization, e.g. check first shoudl the
cursor be either at the beginning or at the end of the line.
I don't understand this. Can you explain in terms of, "When the user
hits the 'Up' key, the computer..."? :-)
Now, when I think this second time, probably this is too complicated for
that :) Because the line has only about 80 character's it could be better
to do only one dummy loop, which stops when a character far enough from
the beginning of the line is caught.