Manjish Posted August 11, 2009 Share Posted August 11, 2009 (edited) Hi, I was doing this script, where if I write a name into an inputbox and if that name is there in my database, the script will autopopulate other details like EID No. Mobile no etc. The problem is that coz I am putting this in the while loop, the guictrlsetdata() command gets executed continously. So if I wanna change the data that has been autopopulated, its not possible. Can any1 help resolve this. I am attaching my script and necessary files. Thanks... P.S. this is a part of an entire script.. so please ignore the rest of it.. Edited August 11, 2009 by Manjish [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
ResNullius Posted August 12, 2009 Share Posted August 12, 2009 I had a quick look at your script: biggest suggestion would be to move most of the actions out of your While loop.Have the While loop check for only those things that might change and need to be acted on, like the name.If they have changed, then call functions that execute the other actions of populating the related fields.To do that effectively, you'll need to store the current value in an "OldValue" variable, and then in the While loop compare it to the actual current value to see if there's a change. Something like:$oldName = "" While 1 $nameEntered = guictrlread($name) If $nameEntered <> $oldName then ;call Function containing _ArraySearch and population of other fields routine $oldName = $nameEntered EndIf If ... then ;check some other control here ;call Function for updating other info based on this control EndIf ;etc, etcYou also might want to consider changing your script to OnEvent mode. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now