Hi Everyone,
Can you look at this code and tell me what I am doing wrong? I am trying to create a single row in the table only if that row is not already there. If it is there I wish to update the row.
ErrorCode() always return 35 even though the add statement adds the row in a previous call to this code.
Thanks.
Emad
Can you look at this code and tell me what I am doing wrong? I am trying to create a single row in the table only if that row is not already there. If it is there I wish to update the row.
ErrorCode() always return 35 even though the add statement adds the row in a previous call to this code.
Thanks.
Emad
Code:
! Calculate the weight to update or add.
!---------------------------------------
Clear (GoldAndScrapInStore)
If GOLD:Weight <> LOC:OriginalWeight |
Then
LOC:WeightToUpdate = GOLD:Weight - LOC:OriginalWeight
Else
LOC:WeightToUpdate = GOLD:Weight
End
! Update the in store gold weight.
!---------------------------------
Get (GoldAndScrapInStore, 1)
message (errorcode())
GoldScrap:TotalGoldWeight = GoldScrap:TotalGoldWeight + LOC:WeightToUpdate
If ErrorCode() |
Then
Add (GoldAndScrapInStore)
Else
Put (GoldAndScrapInStore)
End