NSB.ShowProgress: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
NSB.SHOWPROGRESS(''message'')
[[File:NSB.ShowProgress.png]]


'''Description'''
NSB.ShowProgress(''message'')


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.
== Description ==


To dismiss an NSB.showProgress message, call it with no arguments.
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.


'''Example'''
To dismiss an NSB.showProgress message, call it with a reference to the NSB.ShowProgress dialog.
 
== Example ==


<pre>
<pre>
'This sample shows how to use the NSB.ShowProgress function
'This sample shows how to use the NSB.showProgress function
 
'Set a global counter and call updateMessage every quarter second
'Set a global counter and call updateMessage every quarter second
Dim count=0
Dim count=0
SetInterval(updateMessage,250)
Dim IntervalRefID = 0
 
Sub updateMessage()
Sub updateMessage()
   count=count+1
   count=count+1
   If count<20 Then
   If count<20 Then
     'Display the progress message followed by dots
     'Display the progress message followed by dots
     NSB.ShowProgress("Loading" & String(count,"."))
     NSB.ShowProgress("Running..." & String(count,"."))
    lblStat.textContent="Started"
   Else
   Else
     'Clear the progress message and stop calling updateMessage
     'Clear the progress message and stop calling updateMessage
     NSB.ShowProgress()
     Call interruptMsg()
    ClearInterval(updateMessage)
   End If
   End If
End Sub
End Sub
Sub custDone(result)
 
   Text2.value=result
Sub interruptMsg()
  NSB.ShowProgress(False)
  ClearInterval(IntervalRefID)
   lblStat.textContent="Stopped"
End Sub
End Sub
Function btnStart_onclick()
  count=0
  IntervalRefID = SetInterval(updateMessage,250)
End Function
Function btnInterrupt_onclick()
  Call interruptMsg()
End Function
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
Line 38: Line 52:
</pre>
</pre>


'''Related Items'''
== Related Items ==
 
[[msgbox|MsgBox]]
 
[[Category:Language Reference]]


[[msgbox|MSGBOX]]
[[Category:Messages]]

Latest revision as of 16:33, 28 January 2013

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 a reference to the NSB.ShowProgress dialog.

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

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 interruptMsg()
  End If
End Sub

Sub interruptMsg()
  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 interruptMsg()
End Function

Output

(depends on use. See nsbShowProgress sample)

Related Items

MsgBox