Jump to content
Sign in to follow this  
Manjish

autopopulate data into inputbox

Recommended Posts

Manjish

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 by Manjish

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites
ResNullius

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, etc

You also might want to consider changing your script to OnEvent mode.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×