PdcCalculation.Save: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Declaration == == Description == == Notes == == Code example == <source lang="vb"> </source> == Availability =="
 
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Declaration ==
== Declaration ==
 
Save


== Description ==
== Description ==
 
Store the calculation in the database


== Notes ==
== Notes ==
 
This method saves the calculation object. It is not necessary to have the calculation shown on screen to save it.


== Code example ==
== Code example ==
 
This code example creates a new calculation, adds a material and operation to it and saves it. Whether the save was succesful is reported to the user.


<source lang="vb">
<source lang="vb">
dim objCalc


  set objCalc = pdc.NewCalculation
  objCalc.MaterialList.Add("12345")
  objCalc.OperationList.Add 0,"3075"
  objCalc.Save
  if pdc.LastError = "" then
    msgbox "Calculation " & objCalc.CalculationNo & " was saved successfully"
    objCalc.Show
  else
    msgbox "An error has occurred while saving calculation " & objCalc.CalculationNo & ": " & pdc.lasterror
  end if
</source>
</source>


== Availability ==
== Availability ==
Available in version 1.5 onwards

Latest revision as of 13:00, 15 April 2014

Declaration

Save

Description

Store the calculation in the database

Notes

This method saves the calculation object. It is not necessary to have the calculation shown on screen to save it.

Code example

This code example creates a new calculation, adds a material and operation to it and saves it. Whether the save was succesful is reported to the user.

dim objCalc

  set objCalc = pdc.NewCalculation
  objCalc.MaterialList.Add("12345")
  objCalc.OperationList.Add 0,"3075"
  objCalc.Save
  if pdc.LastError = "" then
    msgbox "Calculation " & objCalc.CalculationNo & " was saved successfully"
    objCalc.Show
  else
    msgbox "An error has occurred while saving calculation " & objCalc.CalculationNo & ": " & pdc.lasterror
  end if

Availability

Available in version 1.5 onwards