Determining exact location within a field

Thomas McGrath III 3mcgrath at adelphia.net
Thu Feb 26 14:33:02 EST 2004


Dan,

Sort of a fill in the blanks like in a children's story book? Except 
you want to mark words to be replaced by script rather than pre doing 
it by hand?
Nice idea if this is right.

I think your biggest problem is going to be how fonts show up 
differently on different platforms (if your are shooting for cross 
platform).

I don't know how to locate the exact spot and size.
First:
	I did a little trick where I made a word white (same color as field) 
and that would keep the space and size exactly the size of the right 
word while hiding it. But hiliting/selecting the text will show the 
text on highlighting. Now if that was not going to happen you would be 
good.

Second:
	 If you knew before hand the actual size of characters and built 
fields based upon those sizes it would work in theory. But that is a 
difficult task as characters do not have the same width even in the 
same font.

Far out idea:
If you put all of the words into separate fields (one per word or one 
per group of words before needed word and after needed word) and 
aligned those fields (but made them blank for the empty one after 
creating it) by line and by back to back it would work. You could 
create a blank text field and enter text and then do a fit to contents 
by height and width But then you need to adjust margins etc.

Unless of course someone else knows how to get that size and 
placement????

Tom

On Feb 26, 2004, at 11:42 AM, Dan Soneson wrote:

> Does anyone know of a way to find the location of a specific spot 
> within a text field? I am interested in developing a module that will 
> allow me to construct a fill-in-the-blank activity. My thought is to 
> construct a text in a field and mark the words that I want to replace 
> in some way (precede them with a special character). Then I want to 
> construct a button with a script that finds the words with this 
> character in the text and replaces them with a space. Over this space 
> I want to create a field into which users can enter the missing word. 
> It would be nice to automate this process and to be able to know 
> exactly where to place the new field, how large to make it, etc. But I 
> cannot figure out the placement issue.
>
> Any suggestions appreciated.
>
> Dan
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>

Thomas J. McGrath III
SCS
1000 Killarney Dr.
Pittsburgh, PA 15234
412-885-8541



More information about the use-livecode mailing list