NEW1.06.05 · Released 26 November 2012
NEWfinPOWER Connect
Released in
1.06.05
26 November 2012
- Opened1 Nov
- Closed7 Nov
- Released26 Nov
Article 10655
Job J010644
Scripts can now display progress form and allow the User to cancel them
Script can now display a progress form and give the User the ability to cancel them.
The following code sample shows how to display a progress box with the ability to cancel.
Public Function Main(ByVal parameters As ISKeyValueList) As BooleanConst LoopMax As Integer = 1000Dim Cancelled As BooleanDim i As Integer' Assume SuccessMain = True' Status BeginfinBL.StatusProcessBegin("Progress Status Test", "Initialising", True)' SleepSystem.Threading.Thread.Sleep(2000)' ProgressFor i = 0 To LoopMax' ProgressfinBL.StatusProcess((i / LoopMax) * 100, "Item " & CStr(i), Cancelled)' Cancelled?If Cancelled ThenMain = FalsefinBL.Error.ErrorBegin("Script was cancelled by the User.")Exit ForEnd If' SleepSystem.Threading.Thread.Sleep(10)Next' Status EndfinBL.StatusProcessEnd()End Function
NOTE: Do not allow the Script to be cancelled unless your Script is running from a logical place, e.g., showing this progress or allowing the Script to be cancelled for an 'Object Events' type Script could cause issues.