- Notifications
You must be signed in to change notification settings - Fork316
Open
Description
Rubberduck version information
Rubberduck Version 2.5.9.6316
OS: Microsoft Windows NT 10.0.19045.0, x64
Host Product: Microsoft Office x86
Host Version: 16.0.18925.20168
Host Executable: EXCEL.EXE
Description
I'm getting a "False positive" on inspection "Variable is used but not assigned."
Seemingly when the initial assignment is with ReDim.
To Reproduce
I have a number of module-level arrays that get initialized as part of an 'upload' process with the push of a button.
e.g.
' Read INVSSTFields tablerowCount=invsstTable.DataBodyRange.Rows.CountReDimm_INVSSTFieldInfo(0TorowCount-1,0To4)' FieldName, Type, Length, Required, FormatDiminvsstKeyCountAsLong:invsstKeyCount=0Fori=1TorowCountm_INVSSTFieldInfo(i-1,0)=invsstTable.DataBodyRange.Cells(i,invsstTable.ListColumns("FieldName").Index).valuem_INVSSTFieldInfo(i-1,1)=invsstTable.DataBodyRange.Cells(i,invsstTable.ListColumns("Type").Index).valuem_INVSSTFieldInfo(i-1,2)=invsstTable.DataBodyRange.Cells(i,invsstTable.ListColumns("Length").Index).valuem_INVSSTFieldInfo(i-1,3)=invsstTable.DataBodyRange.Cells(i,invsstTable.ListColumns("Required").Index).valuem_INVSSTFieldInfo(i-1,4)=invsstTable.DataBodyRange.Cells(i,invsstTable.ListColumns("Format").Index).valueNexti
If I initializem_INVSSTFieldInfo withm_INVSSTFieldInfo = vbNullString, then the inspection is happy.
Additional context
I've been using a combination of AI and RubberDuck to get some interesting work done. Thank-you!