ALTADataSet.ShowCalculationProgress: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Template:API}}{{Template:APIBreadcrumb|.[[ALTAEvents Class|ALTAEvents]]}}
{{Template:API}}{{Template:APIBreadcrumb|.[[ALTADataSet Class|ALTADataSet]]}}
{{Template:InProgress}}
{{Template:InProgress}}
<onlyinclude>Occurs when the calculation process is running. Displays a progress bar.</onlyinclude>
{{Template:API_EventsNote}}
== Syntax ==
'''_ShowCalculationProgress'''()
== Example ==
The following example provides a simple demonstration on how to customize the event procedure.
'''VBA'''
{{APIComment|'Specify a variable to handle the event.}}
  {{APIPrefix|Private WithEvents}} ads {{APIPrefix|As}} ALTADataSet
{{APIComment|'----------------------------}}
  {{APIPrefix|Sub}} Main()
  {{APIComment|'Associate the event variable with an object.}}
    {{APIPrefix|Set}} ads = {{APIPrefix|New}} ALTADataSet
  {{APIComment|'Set the application to use your event procedure.}}
    ads.UseEvents = True
  {{APIComment|'Define a stress type with a use stress level of 300.}}
    {{APIPrefix|Call}} ads.AddStressDefinition({{APIString|"Stress1"}}, , 300) 
  {{APIComment|'To trigger the event, analyze a data set.}}
    {{APIPrefix|Call}} ads.AddFailure_2(245, 1, 353)
    {{APIPrefix|Call}} ads.AddFailure_2(110, 1, 373)
    {{APIPrefix|Call}} ads.AddFailure_2(180, 1, 373) 
    {{APIPrefix|Call}} ads.AddFailure_2(50, 1, 393)
    {{APIPrefix|Call}} ads.AddFailure_2(70, 1, 393)
    ads.Calculate
    Msgbox({{APIString|"End"}})
  {{APIPrefix|End Sub}}
{{APIComment|'----------------------------}}
  {{APIPrefix|Private Sub}} ads_ShowCalculationProgress()
  {{APIComment|'<Add code here to handle the event.>}}
    MsgBox ("ShowCalculationProgress event")
  {{APIPrefix|End Sub}}
'''VB.NET'''
{{APIComment|'Specify a variable to handle the event.}}
  {{APIPrefix|Private WithEvents}} ads {{APIPrefix|As}} ALTADataSet
{{APIComment|'----------------------------}}
  {{APIPrefix|Sub}} Main()
  {{APIComment|'Associate the event variable with an object.}}
    ads = {{APIPrefix|New}} ALTADataSet
  {{APIComment|'Set the application to use your event procedure.}}
    ads.UseEvents = True
  {{APIComment|'Define a stress type with a use stress level of 300.}}
    ads.AddStressDefinition({{APIString|"Stress1"}}, , 300) 
  {{APIComment|'To trigger the event, analyze a data set.}}
    ads.AddFailure(245, 1, 353)
    ads.AddFailure(110, 1, 373)
    ads.AddFailure(180, 1, 373) 
    ads.AddFailure(50, 1, 393)
    ads.AddFailure(70, 1, 393)
    ads.Calculate
    Msgbox({{APIString|"End"}})
  {{APIPrefix|End Sub}}
{{APIComment|'----------------------------}}
  {{APIPrefix|Private Sub}} ads_ShowCalculationProgress() {{APIPrefix|Handles}} ads.ShowCalculationProgress
  {{APIComment|'<Add code here to handle the event.>}}
    MsgBox ("ShowCalculationProgress event")
  {{APIPrefix|End Sub}}

Revision as of 17:17, 17 August 2016

APIWiki.png


Member of: SynthesisAPI.ALTADataSet Template:InProgress


Occurs when the calculation process is running. Displays a progress bar.


Remarks: To hide the messages or write your own code for the event procedure, set the UseEvents property of the object to True. The event is raised by the class methods.

Syntax

_ShowCalculationProgress()


Example

The following example provides a simple demonstration on how to customize the event procedure.

VBA

 'Specify a variable to handle the event. 
  Private WithEvents ads As ALTADataSet

 '---------------------------- 
 Sub Main()
   'Associate the event variable with an object. 
    Set ads = New ALTADataSet

   'Set the application to use your event procedure. 
    ads.UseEvents = True

   'Define a stress type with a use stress level of 300. 
    Call ads.AddStressDefinition("Stress1", , 300)  

   'To trigger the event, analyze a data set. 
    Call ads.AddFailure_2(245, 1, 353)
    Call ads.AddFailure_2(110, 1, 373)
    Call ads.AddFailure_2(180, 1, 373)  
    Call ads.AddFailure_2(50, 1, 393)
    Call ads.AddFailure_2(70, 1, 393)

    ads.Calculate
    Msgbox("End")

 End Sub

 '---------------------------- 
 Private Sub ads_ShowCalculationProgress()
   '<Add code here to handle the event.> 
    MsgBox ("ShowCalculationProgress event")
 End Sub
VB.NET

 'Specify a variable to handle the event. 
  Private WithEvents ads As ALTADataSet

 '---------------------------- 
 Sub Main()
   'Associate the event variable with an object. 
    ads = New ALTADataSet

   'Set the application to use your event procedure. 
    ads.UseEvents = True

   'Define a stress type with a use stress level of 300. 
    ads.AddStressDefinition("Stress1", , 300)  

   'To trigger the event, analyze a data set. 
    ads.AddFailure(245, 1, 353)
    ads.AddFailure(110, 1, 373)
    ads.AddFailure(180, 1, 373)  
    ads.AddFailure(50, 1, 393)
    ads.AddFailure(70, 1, 393)

    ads.Calculate
    Msgbox("End")

 End Sub

 '---------------------------- 
 Private Sub ads_ShowCalculationProgress() Handles ads.ShowCalculationProgress
   '<Add code here to handle the event.> 
    MsgBox ("ShowCalculationProgress event")
 End Sub