PdcCalculation.SaveAsArticle: Difference between revisions
Jump to navigation
Jump to search
Created page with "== Declaration == == Description == == Notes == == Code example == <source lang="vb"> </source> == Availability ==" |
No edit summary |
||
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 == |
Revision as of 08:44, 21 May 2012
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