PdcMaterial.SetPos

From External Bemet Wiki
Jump to navigation Jump to search

Declaration

SetPos(Value as String) as Boolean

Description

Returns true or false whether the posnumber could be succesfully changed with the supplied value

Notes

The method returns true of false after having changed the material's position number.

Code example

This code example adds 10 to the materials' position numbers and reports its succes.

dim objCalc
dim objMat
dim i
dim intPos

  set objCalc = pdc.ActiveCalculation
  for i = 0 to objCalc.MaterialList.Count - 1
    set objMat = objCalc.MaterialList(i)
    intPos = objMat.Pos
    if objMat.SetPos(intPos + 10) then
      msgbox "OK"
    else
      msgbox "Not OK"
    end if
  next
  objCalc.Save

Availability

Available since June 2006, improved to avoid duplicate position number in Januari 2008 (from version 3.8).