Recent

Author Topic: [Solved] label not updating ...  (Read 5581 times)

IPguy

  • Sr. Member
  • ****
  • Posts: 385
[Solved] label not updating ...
« on: June 08, 2011, 03:55:48 am »
I've an odd issue which I have not seen before.
I'm attempting to write to a label, followed by executing a SNMP get.

The label is not updating.
If I add the ShowMessage, the label updates, I see the Show Message and then start the SNMPGet.  

I suspect the form does not have a chance to update itself before the pgrm gets tied up with the SNMPGet.

Any thoughts on how to force the form to update prior to starting the get?

Code: [Select]
note: TempStr & DUT.DevName are strings.
begin
  TempStr := 'Getting ... ' + DUT.DevName;
  SNMPTest.Label1.Caption := TempStr;
  ShowMessage('loc #1 ' + TempStr);

  // at this point, I see the label update, followed by the ShowMessage

 STime := Time;
  // Do the snmp get for ipRouteDest & Mask
  SNMPResult1 := SNMPGetTable(OIDRouteDest,DUT.ROsnmpStr,DUT.DevIP,Table);      
0.9.31-30142-2.4.2, win32-Vista                    
                                    
« Last Edit: June 09, 2011, 03:15:31 am by IPguy »

mmab

  • Jr. Member
  • **
  • Posts: 89
Re: label not updating ...
« Reply #1 on: June 08, 2011, 05:16:28 am »
 add
application.processmessages;
after label string change.


IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: [Solved] label not updating ...
« Reply #2 on: June 09, 2011, 03:15:57 am »
mmab, thank you - that worked.

 

TinyPortal © 2005-2018