PdcCalculation.SaveAsArticle

From External Bemet Wiki
Revision as of 14:51, 4 November 2013 by TC (talk | contribs) (Notes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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