NSB.ShowProgress

From NSB App Studio
Jump to navigation Jump to search

NSB.ShowProgress(message)

Description

NSB.ShowProgress displays message to the user near the bottom middle of the screen. It can be dismissed or updated at any time by the program. The user can also dismiss it. Use it to provide the user with information during execution without interrupting execution.

To dismiss an NSB.showProgress message, call it with no arguments.

Example

'This sample shows how to use the NSB.showProgress function

'Set a global counter and call updateMessage every quarter second
Dim count=0
Dim IntervalRefID = 0

Function Form1_onshow()
  count=0
  IntervalRefID = SetInterval(updateMessage,250)
End Function

Sub updateMessage()
  count=count+1
  If count<20 Then
    'Display the progress message followed by dots
    NSB.ShowProgress("Running..." & String(count,"."))
    lblStat.textContent="Started"
  Else
    'Clear the progress message and stop calling updateMessage
    Call interruptMesg()
  End If
End Sub

Sub interruptMesg()
  NSB.ShowProgress(False)
  ClearInterval(IntervalRefID)
  lblStat.textContent="Stopped"
End Sub

Function btnStart_onclick()
  count=0
  IntervalRefID = SetInterval(updateMessage,250)
End Function

Function btnInterrupt_onclick()
  Call interruptMesg()
End Function

Output

(depends on use. See nsbShowProgress sample)

Related Items

MsgBox