PdcStatusManagement.SetManualStatus: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Declaration == SetManualStatus(CalculationNo as String,ID as long) as Boolean == Description == == Notes == This function allows the user to set an manual status for the..."
 
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 10: Line 10:


== Code example ==
== Code example ==
This code example shows the calculationnumber, current status and previous status of the active status object.  
This code example changes the status of the active calculation to status 5 (which has ID 32).  


<source lang="vb">
<source lang="vb">
pdc.Calculations.StatusInfo.SetManualStatus("11-08451",1)
dim objCalc
   msgbox "Cn: " & objStat.CalculationNo
 
   msgbox "Cur: " & objStat.CurrentStatus
  set objCalc = pdc.ActiveCalculation
   set objStat = nothing
  if pdc.Calculations.StatusManagement.SetManualStatus(objCalc.CalculationNo, 32) then '32 is the integer ID of the status
    objCalc.Refresh
   else
    msgbox "Changing status for calculation " & objCalc.CalculationNo & " failed!" & vbCrLf & _
          "Message: " & pdc.LastError
  end if
</source>
<br>
This code example does the same, without opening the calculation object.<br>
<br>
<source lang="vb">
   if not pdc.Calculations.StatusManagement.SetManualStatus("01288", 32) then '32 is the integer ID of the status
    msgbox "Changing status for calculation " & "01288" & " failed!" & vbCrLf & _
          "Message: " & pdc.LastError
   end if
</source>
</source>


== Availability ==
== Availability ==
Available since version 4.3 onwards.
Available since version 4.3 onwards.

Latest revision as of 06:11, 17 September 2013

Declaration

SetManualStatus(CalculationNo as String,ID as long) as Boolean

Description

Notes

This function allows the user to set an manual status for the calculation. When the given id is an id of an automatic status the function returns false. The error given is stored in pdc.LastError.

Code example

This code example changes the status of the active calculation to status 5 (which has ID 32).

dim objCalc

  set objCalc = pdc.ActiveCalculation
  if pdc.Calculations.StatusManagement.SetManualStatus(objCalc.CalculationNo, 32) then '32 is the integer ID of the status
    objCalc.Refresh
  else
    msgbox "Changing status for calculation " & objCalc.CalculationNo & " failed!" & vbCrLf & _
           "Message: " & pdc.LastError
  end if


This code example does the same, without opening the calculation object.

  if not pdc.Calculations.StatusManagement.SetManualStatus("01288", 32) then '32 is the integer ID of the status
    msgbox "Changing status for calculation " & "01288" & " failed!" & vbCrLf & _
           "Message: " & pdc.LastError
  end if


Availability

Available since version 4.3 onwards.