Thanks for your response, Christian, but this problem is directly related with the problem that i sent before <Generating Material ID from Material Type plus a number incremented...> there are 6 values at the lookup table and i need 6 counters for these values, and i should initialize these counters to 0, and also they should keep their current values for the BeforeAdd operations. The script is as shown below;
Thanks
Emre
Function AfterAddChangeMaterialID(ApplHndl As Long,OpStr As String, _
FirstPar As Long,SecondPar As Long,ThirdPar As Long ) As Integer
Dim MaterialName As String
' Dim Counter As Integer
'Create SmSession object from ApplHndl
Dim Session As SmSession
Set Session = SCREXT_ObjectForInterface(ApplHndl)
'Create SmRecordList from input parameter
Dim RecListIn As Object
CONV_RecListToComRecordList SecondPar,RecListIn
Dim RecListOut As Object
CONV_RecListToComRecordList ThirdPar, RecListOut
RecListIn.PrintToFile "Input", ""
RecListOut.AddHeader "CN_ID",20,1
MaterialName = RecListIn.ValueAsString("CN_MATERIAL_TYPE", 0)
Select Case MaterialName
Case "9"
RecListOut.ValueAsString ("CN_ID", 0) = "Brass" + "-" + BraCounter
Case "8"
RecListOut.ValueAsString ("CN_ID", 0) = "Aluminum" + "-" + AluCounter
Case "6"
RecListOut.ValueAsString ("CN_ID", 0) = "Paper" + "-" + PapCounter
Case "5"
RecListOut.ValueAsString ("CN_ID", 0) = "Plastic" + "-" + PlaCounter
Case "4"
RecListOut.ValueAsString ("CN_ID", 0) = "Lubricant" + "-" + LubCounter
Case "3"
RecListOut.ValueAsString ("CN_ID", 0) = "Steel" + "-" + SteCounter
End Select
RecListOut.PrintToFile "Output", ""
CONV_ComRecListToRecordList RecListOut,ThirdPar
End Function
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP