I have coded the following and the windows freezes after a few seconds with the message 'not responding'. The progressbargadget gets stuck and the counter also stops.
What am I doing wrong here? (Dont get upset about the Dutch language)
BTW, I get this problem often with the same sort of constructions.
Code: Select all
;- CRC32 info ophalen uit bestanden
; scherm openen voor presentatie voortgang
OpenWindow(0, 0, 0, 320, 90, "Ophalen CRC32 info", #PB_Window_ScreenCentered)
ProgressBarGadget (0, 10, 10, 300, 30, 0, Aantal)
TextGadget (1, 150, 50, 200, 30, "")
UseCRC32Fingerprint()
Structure info
Bestandsnaam.s
CRC32.s
EndStructure
Dim Bestanden.info(0)
ExamineDirectory(0, PathData$, "*.jpg")
AantalBestanden = 0
While NextDirectoryEntry(0)
AantalBestanden = AantalBestanden + 1
ReDim Bestanden(AantalBestanden)
Bestandsnaam$ = DirectoryEntryName(0)
Bestanden(AantalBestanden)\Bestandsnaam = Bestandsnaam$
Bestanden(AantalBestanden)\CRC32 = UCase(FileFingerprint(PathData$ + Bestandsnaam$, #PB_Cipher_CRC32))
SetGadgetState(0, AantalBestanden)
SetGadgetText(1, Str(AantalBestanden) + " / " + Str(Aantal))
Wend
FinishDirectory(0)
SortStructuredArray(Bestanden(), #PB_Sort_Ascending, OffsetOf(info\Bestandsnaam), TypeOf(info\Bestandsnaam))
CloseWindow(0)
// Code Tags added (Kiffi)