Search the Community
Showing results for tags 'real-time'.
-
I have an edit box that I wanted to keep tabs of the line number in real-time. For an example, if a user enter 3 lines, the counter should update as soon as the user hit "Enter" after the 3rd entry. I managed to do it but it's not real-time. Program would hung or slow to response after I hit the "Configuration" button. Many thanks! ; Testing Host Count #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <StaticConstants.au3> Example() Func Example() Local $hostLabel, $hostEdit, $button, $msg, $count, $hostname GUICreate("Host Count") ; will create a dialog box that when displayed is centered $hostLabel = GUICtrlCreateLabel ("Hostname", 10, 10, 120, 20) $hostEdit = GUICtrlCreateEdit ("", 10, 40, 200, 80) $button = GUICtrlCreateButton ("Configure", 20, 140, 120, 30) GUISetState() ; will display an dialog box with 1 checkbox ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() $hostname = StringRegExp (GUICtrlRead ($hostEdit), '\V\S+', 3) $count = UBound ($hostname) sleep (500) GUICtrlCreateLabel ($count, 200, 10, 10, 20, $SS_RIGHT) Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $button MsgBox (0, "Count", "The count is " & $count) #cs $hostname = StringRegExp (GUICtrlRead ($hostEdit), '\V\S+', 3) $count = UBound ($hostname) GUICtrlCreateLabel ($count, 200, 10, 10, 20, $SS_RIGHT) #ce EndSelect WEnd EndFunc ;==>Example
- 9 replies
-
- line counter
- real-time
-
(and 1 more)
Tagged with: