Page 1 of 1

Autofill for Text Entry Responses

Posted: Tue Nov 26, 2013 7:19 pm
by lrieber
Hello everyone,

I created an autofill function for a text response as part of an instructional game that one of my students at the University of Georgia is currently making.

I think it is pretty cool and I've not seen any other postings about such a function in any of the forums.

To learn more about it and to get a demo file with code that you are more than welcome to take and adapt, go to my blog entry where I write about it:

http://learninglivecode.blogspot.com/20 ... entry.html

(And, if just one person accesses my blog, you will have increased my readership by 100%.)

Lloyd Rieber

Re: Autofill for Text Entry Responses

Posted: Tue Nov 26, 2013 7:32 pm
by dunbarx
Hi.

The next person in will only increase your readership by 50%.

You have made what I always referred to as a binary search, not really an autofill. When I get home tonight I will post a handler I used on a recent project. It handles deletes.

Craig Newman

Re: Autofill for Text Entry Responses

Posted: Wed Nov 27, 2013 3:45 am
by Mark
Lloyd,

Your readership increased by 50%.

It strikes me that you don't use the filter command.

kind regards,

Mark

Re: Autofill for Text Entry Responses

Posted: Wed Nov 27, 2013 5:14 am
by dunbarx
Hi again.

Make a field "outPutField" and another field to enter the text to find. I had this in the entry field script:

Code: Select all

on keyDown var
   put var after me
   if the length of me > 2 then put revFullFind(me,yourList) into fld "outputField"
   else put "" into fld "outputField"
end keyDown

on backspacekey
   delete the last char of me
send "keydown" to me
end backspacekey

function revFullFind tFind,tData
   repeat for each line tLine in tData
      if tFind is in tLine then put tLine & return after temp
   end repeat
   return char 1 to -2 of temp
end revFullFind
"yourList" is a return delimited list of text. You will see that as you type, matches appear, and are winnowed as more chars are entered. Deleting chars reverses the process. This can be modified as needed.

But Mark makes a point. The "filter" command has much power within it.

Craig Newman

Re: Autofill for Text Entry Responses

Posted: Wed Nov 27, 2013 6:28 pm
by lrieber
Craig and Mark,

Many thanks for your posts. I did not know about the "filter" command.

And, just adding the on backspacekey code makes my own program now function properly.

@Mark: I took a look at your new book. I'll be buying a copy to review -- it may be perfect for some of the courses I teach here at the University of Georgia.

Lloyd