8
0
2024-01-24 16:42:38 +01:00

38 lines
1.4 KiB
Plaintext

' GetNextFreeArticleRow(ArticleNumber : String)
' ----------------------------------------------------------------------------
' Gibt den Grid Index der nächsten freien Zeile für das Scan-Ergebnis zurück
'
' Returns: GetNextFreeArticleRow : Int
' ----------------------------------------------------------------------------
' Copyright (c) 2021 by Digital Data GmbH
'
' Digital Data GmbH • Ludwig-Rinn-Strasse 16 • D-35452 Heuchelheim
' Tel.: 0641/202360 • E-Mail: info-flow(at)digitaldata.works
' ----------------------------------------------------------------------------
' Creation Date / Author: 30.09.2020 / JJ
' Version Date / Editor: 30.09.2020 / JJ
' Version Number: 4.0.0.0
Function GetNextFreeArticleRow(ArticleNumber)
Set mywin = CWLStart.CurrentModule.Windows.Item(WINDOW_ID)
Set Grid = mywin.Controls.Item(GRID_ID).Grid
Dim NextFreeRow : NextFreeRow = -1
If DEBUG_ON = True Then
AddDebugLine "Getting next free row for Article: " & ArticleNumber
ShowDebugBox "GetNextFreeArticleRow"
End If
For GridIndex = 1 To Grid.LineCount
CurrentArticleNumber = Grid.GetCellValue(GridIndex, COLUMN_ARTICLENUMBER)
CurrentSerialNumber = Grid.GetCellValue(GridIndex, COLUMN_SERIALNUMBER)
If UCase(ArticleNumber) = UCase(CurrentArticleNumber) And Len(CurrentSerialNumber) = 0 Then
NextFreeRow = GridIndex
Exit For
End If
Next
GetNextFreeArticleRow = NextFreeRow
End Function