dim n() as Text
dim p as new xojo.io.FolderItem( SpecialFolder.Documents.NativePath.ToText )
if p<>nil and p.Exists then
For Each f As xojo.io.FolderItem In p.Children
n.Append f.DisplayName
next
end if
dim t as Text = text.Join( n, EndOfLine.UNIX.ToText)
#Edit:
I had some crap in the original code. You should check for f=nil although I think it should not be nil.
[quote=236274:@Christian Schmitz]maybe you check crash report?
or put some msgbox there to see which line crashes?[/quote]
I can’t set breaks as the app/debuggers crashes instantly after leaving the function. The original function is enclosed. R2015R3 works fine but R4 for some reasons not.
try
dim p as new FolderItem( Glob.cfg.value(clsConfig.CFG_KEY_FILEPATH) )
if p<>nil and p.Exists then
dim fName as Text
dim pattern() as Text = Glob.filePattern.Split( “.”, 0 )
dim fileBeginning as Text = pattern(0)+"."+pattern(1)
dim fileEnding as Text = pattern(pattern.Ubound)
dim trueFile as Boolean
for each f as FolderItem in p.Children
trueFile = (f<>nil and f.Exists and not f.IsFolder)
if trueFile then
fName = f.DisplayName
trueFile = fName.BeginsWith( fileBeginning ) and fName.EndsWith( fileEnding )
if trueFile then
SimpleBrowser1.addItem ( f )
end if
end if
next
end if
catch iae as InvalidArgumentException
msgbox “Fehler: Dateipfad nicht vorhanden”
end try[/code]
Got bit by this one just today. The crash report didn’t help, at all, so I ended up figuring out the sequence to make it crash reliably and only stepping through code.
It’s…disappointing that the new framework isn’t more stable. More reasons to not use it for a while yet.
[quote=238190:@Bob Keeney]Got bit by this one just today. The crash report didn’t help, at all, so I ended up figuring out the sequence to make it crash reliably and only stepping through code.
It’s…disappointing that the new framework isn’t more stable. More reasons to not use it for a while yet.[/quote]
Yeah, that this bug slipped by is very unfortunate because the new framework’s directory iteration is much better for performance and minimizing disk IO. This is fixed for the next release and tests added to make sure it doesn’t break again.
That will be great…in the future release (hopefully we don’t have to wait until March). Until then we’re screwed and have to revert to the old framework.
Honestly, we are regretting trying to use the new framework in our projects. The little inconsistencies and bugs are not only annoying but cost me a lot in time and effort to track down.