Need help with code (None Specified)
At 13 DEC 1999 02:35:27PM Barry Stevens wrote:
Hi All
I was hoping that someone might be able to supply me with the code for a routine to be able to do the following:
In a Combo line, EditlIne or EditTable cell, as a user enters data, to be able to auto fill the rest of the line with a value that matches the starting chars entered and refresh as a new char is entered. The data to match to would be available as say a @vm string.
I am sure you have seen this implemented in systems, if not your own, so can anyone help me out to save me re-inventing the wheel .
Thanks
Barry
Ps. If it is not a simple routine, and I have to pay for it, I will, just put your bids in .
At 15 DEC 1999 12:03PM Stephen Jones wrote:
The following code will fill a 30 character Edit Line (TestEdit) with the same character that you typed in:
DECLARE SUBROUTINE Set_Property
DECLARE FUNCTION Get_Property
NewString =Get_Property(@window : ".TestEdit", "TEXT")
FinalString=NewString
For i=1 to 30
FinalString=FinalString : NewStringSet_Property(@window: ".TestEdit", "TEXT", FinalString)Next i
This goes on the Lostfocus event, so it wont work immediately after you type in. Putting something like this on a changed event will (obviously) go into an infinate loop.
At 15 DEC 1999 03:47PM [email protected] - [url=http://www.sprezzatura.com]Sprezzatura Group[/url] wrote:
[notag]Stephen
You could make your routine faster and easier to maintain if you simply used the STR command
e.g.
NewString = Str(OldString,30)I think however you'll find that wasn't really what Barry was looking for, rather he was trying to achieve moving towards an eventual goal in a list by typing the first few letters - in other words autocomplete, like in an internet browser.
[<a HREF="mailto:[email protected]">Andrew P McAuley</a>]
[<A HREF="http://www.sprezzatura.com" onMouseOver="window.status='Why not click here to visit our web site?';return(true)">Sprezzatura Group</A>]
[<I>World Leaders in all things RevSoft</I>]
[<img src="http://www.sprezzatura.com/zz.gif">]
[<script language="javascript">function openNewPage () {window.location.href=(document.TOCNavigator.pageToGoTo.options[document.TOCNavigator.pageToGoTo.selectedIndex].value);document.TOCNavigator.pageToGoTo.selectedIndex="0";}end hiding from non-JS browsers –></script>] [<FORM ACTION "" METHOD=GET NAME="TOCNavigator" <SELECT NAME="pageToGoTo" SIZE=1 onChange="openNewPage()"> <OPTION>Pull down this menu to choose whereabouts on the Sprezz site to go <OPTION VALUE="http://www.sprezzatura.com">Home Page <OPTION VALUE="http://www.sprezzatura.com/whatsnew.htm">What's New <OPTION VALUE="http://www.sprezzatura.com/senl.htm">SENL <OPTION VALUE="http://www.sprezzatura.com/patches.htm">Download S/LIST <OPTION VALUE="mailto:[email protected]">Send mail to support at Sprezzatura <OPTION VALUE="mailto:[email protected]">Send mail to sales at Sprezzatura </SELECT> </FORM>][/notag] </QUOTE> —- === At 16 DEC 1999 02:08AM Ilde Giron wrote: === <QUOTE>Barry, Next code can auto-fill an edit line, but it has some limitations. I haven't tried it with other controls. I hope it can be of any help. Edit line is called 'EDFIELD' Data to match must be provided in reclist as an @FM delimited string. Code will suggest last match in reclist, and will track any changes in input in order to provide other matches- as long as they are available. If matching string is longer than required (i.e. if it presents you with 'cartoon' and you only need 'car') press spacebar to get rid of text in excess. Declare function get_property Declare subroutine set_property reclist=car':@FM:'cartoon':@FM:'calendar' inputtext=get_property(@WINDOW:'.EDFIELD', 'TEXT') if inputtext=' then return 0 i=1 loop while reclist[i] do leng=len(inputtext) mtch=reclist[i]1, leng if inputtext=mtch and (leng < len(reclist[i])) then selpos=leng + 1:@FM:'32767' set_property(@window:'.EDFIELD', 'TEXT', reclist[i]) set_property(@window:'.EDFIELD', 'SELECTION', selpos) end i += 1 repeat RETURN 0 Good luck! Ilde. </QUOTE> —- === At 16 DEC 1999 03:08PM Ilde Giron wrote: === <QUOTE>Barry, I apologize for not stating code must be put in 'CHANGED' event for edit line 'EDFIELD' Regards, Ilde. </QUOTE> —- === At 18 DEC 1999 05:37PM Barry Stevens wrote: === <QUOTE>Thank you very much for your help. I will test it and build as subroutine call, I will need to use with combobox and edittable, so I will play with and incorporate this in the routine. I know the code will be different for both these controls…have you done for cobo & tables. I will publish what ever I get working from all the responses. Barry </QUOTE> View this thread on the Works forum...