update textbox text

2 posts / 0 new
Last post
partitionfrance
Offline
Joined: 09/09/2016 - 11:15
update textbox text

Hello,
I have created an interface with a textbox. I want to refresh the text of this texbox with the "progress status" of the script ( the script execution manage billions data and can last 10 hours).
I try to use the dlgtexbox with no success. I can easyly define the intial content, but not update it whitout action of the user.
It is possible to change the textbox content ?
Thanks (excuse my bad english, i'm french)

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi partitionfrance,

You can probably do this several ways. Have you considered using a progress bar instead of a dialog?  You can find code to create the progress bar here: http://ideascripting.com/Progress-Bar

If you want to use a dialog you will have to use a label as you can't update the edit box in the dialog except for setting a default when you create the dialog.  All your calls would have to be from the dialog function and you would have to manually update the label.  Here is some example code which I have also attached.  Hope this helps a bit.

Also if you want you can write in French, I am originally from Quebec so I can speak French and read it but my written French is lousy.

Thanks

Brian

Sub Main
	Call menu()
End Sub

Function menu()
	Dim button As Integer
	Dim dlg As NewDialog
	button = Dialog(dlg)
End Function

Function displayIt(ControlID$, Action%, SuppValue%)
	Dim bExitFun As Boolean
	Select Case Action%
		Case 1

		Case 2
		
			Select Case ControlId$
				Case "PushButton1"
					Call runLoop()
					dlgText "Text1", "10% complete"
					Call runLoop()
					dlgText "Text1", "20% complete"
					Call runLoop()
					dlgText "Text1", "30% complete"
					Call runLoop()
					dlgText "Text1", "40% complete"
					Call runLoop()
					dlgText "Text1", "50% complete"
					Call runLoop()
					dlgText "Text1", "60% complete"	
					Call runLoop()
					dlgText "Text1", "70% complete"
					Call runLoop()
					dlgText "Text1", "80% complete"
					Call runLoop()
					dlgText "Text1", "90% complete"
					Call runLoop()
					dlgText "Text1", "100% complete"
				Case "PushButton2"
					bExitFun = true
			End Select
	End Select
	
	If bExitFun Then
		displayIt = 0
	Else 
		displayIt = 1
	End If
End Function 	


Function runLoop()
	Dim i As Long
	
	For i = 1 To 100000
		
	Next i
End Function