just add a new feature in a self contained window.
The window have a ListBox and some buttons: Open, Save, Close.
When I save the result, the application (running in the IDE) crash.
If I change the detination folder: works fine to save in its .Parent. If I go up to its .Parent, then choose the very same Folder: it works fine.
Before asking for help, I exported that window,
add it (drag and drop) to a brand new project,
Run, Open, Save: all is well in an imperfect world.
SAME CODE: no change. The “old” project is still loaded…
Run again the project and check the generated file: it is complete and correct: the result I was awaiting.
I even left El Capitan, boot with a High Sierra.
I fired Disk Utilities and check my hard disk.
I cleared the cache.
Before you ask, here is the code:
Sub Action()
Dim Save_Dlg As New SaveAsDialog
Dim Save_FI As FolderItem
Dim Save_TOS As TextOutputStream
Dim CharName As String
// Open the Dialog nto the Open folder
If gOpen_FI <> Nil Then
Save_Dlg.InitialDirectory = gOpen_FI
CharName = NthField(gOpen_FI.Name, " - ", 1) + " - Index.txt"
Else
CharName = "Set a character name.txt"
End If
Save_Dlg.PromptText = "Set a Name to the Text File"
Save_Dlg.SuggestedFileName = CharName
Save_Dlg.Title = "Exportation de la liste"
Save_Dlg.Filter = FT_IO.TEXT
Save_FI = Save_Dlg.ShowModal()
If Save_FI = Nil then
Return
End If
// Saves the ListBox contents
If Save_FI <> Nil Then
Try
// Get a TextOutputStream
Save_TOS = TextOutputStream.Create(Save_FI)
Try
// a. Save the Heading Contents
Save_TOS.WriteLine LB.Heading(-1)
// b. Save the Lists Rows Contents
Save_TOS.WriteLine LB.Cell(-1,-1)
Finally
// c. Close the now useless TextOutputStream
Save_TOS.Close
Save_TOS = Nil
End Try
Catch e As IOException
End Try
End If
End Sub
I am as blind as a normal person face to its own code.