ich bin relativ unbeleckt in der Basic/StarBasic Programmierung und habe ein kleines Problem mit einem wehrhaften Array, das sich sehr erfolgreich gegen die Zuweisung von Objekten vom Typen meiner Wahl sträubt.
Folgeder Code ist existent:
Code: Alles auswählen
' Eigener Typ....
type TTimeRecord
ProjectNo as string
FakturaEH as string
Faktura as string
Consultant as string
RKYes as string
AddCosts as string
dateFrom as date
dateTo as date
factmonth as integer
Invoice as string
InvoicePlaced as date
InvoicePayed as date
end type
...
function getIvoiceDataForMonth(selMonth as integer, optional myDoc as object) as TTimeRecord
dim TimeRecs() as TTimeRecord
dim TimeRec as TTimeRecord
lastRow = getLastTimerecRow(myDoc)
actualSheet = myDoc.Sheets(TimeTable)
for i = 1 to lastRow
Invoicecell = actualSheet.getCellByPosition(9, i)
monthcell = actualSheet.getCellByPosition(8, i)
if Invoicecell.string = "" and (monthcell.value = selMonth or monthcell.value < selMonth) then
redim preserve TimeRecs(iCount)
iCount = iCount + 1
TimeRec = fillRecord(actualSheet,i)
TimeRecs(iCount-1) = TimeRec
end if
next i
getActiveRecordsForPeriod = TimeRecs()
end function
Code: Alles auswählen
TimeRecs(iCount-1) = TimeRec
Ich sehe den Fehler einfach nicht. Ich danke Euch für jegliche Bemühung m Eurerseits mein Brett vom Kopf zu entfernen!
Jens