PdcCalculation.SaveAsArticle: 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 =="
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Declaration ==
== Declaration ==
 
SaveAsArticle as Boolean


== Description ==
== Description ==
 
Stores the calculation materials file


== Notes ==
== Notes ==
 
This method saves the calculation object in the materials file. 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, reads a standard article into it, adds a material and operation to it and saves it as a standard article. Whether the save was succesful is reported to the user.


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


  set objCalc = pdc.NewCalculation
  objCalc.ReadFromArticle("1234")
  objCalc.MaterialList.Add("12345")
  if objCalc.SaveAsArticle 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 ==

Latest revision as of 14:51, 4 November 2013

Declaration

SaveAsArticle as Boolean

Description

Stores the calculation materials file

Notes

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

Code example

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

dim objCalc

  set objCalc = pdc.NewCalculation
  objCalc.ReadFromArticle("1234")
  objCalc.MaterialList.Add("12345")
  if objCalc.SaveAsArticle 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