I’m interested in being able to report this problem explained here in Feedback and I would like to be able to explain it when I report it.
I am horrible at organizing things. It’s taken me years to be able to explain this to myself.
This problem all revolves around my preferences fileS and 3 windows and how the file is saved and accessed. I don’t know if access is part of the problem.
The line that causes the problem is a RE-assignment of a folderitem
ThPrefsF = ThColl.Child("PrefsFile.ini")
The windows are StrtUpPrefs, Preferences, MainList.
-
StrtUpPrefs controls which set of files are accessible as in various preferences and data files. It is also the first window to be opened.
-
Preferences manages various preferences but can also open StrtUpPrefs. It can only manage one set of Preferences at a time. The close of this window under these circumstances opens the MainList window. The saving of this Preferences file does not cause a reopening of the Preferences file.
-
MainList is a window that enables access to the data / exercise files. It also allows access to its preferences.
The only time this happens is when the preferences file is saved, but the MainList is NOT accessed.
The order of Windows for not having a problem is:
StrtUpPrefs >> MainList >> Preferences (File modified) >> MainList.
The order for causing the error is:
StrtUpPrefs >> MainList >> Preferences (File modified) >> StrtUpPrefs. Error is now caused on the close
I have this set of lines of code with folderItems that cause different platform errors but consistently cause errors of assignment.
The order of windows which are related to this error(s) is possibly part of the error.
The code:
ThColl = PFolderProp//IniFolder.Child(titPthLdArray(PthLIndex))
If ThColl.Child("PrefsFile.ini") <> Nil And ThColl.Child("PrefsFile.ini").Exists Then
ThPrefsF = ThColl.Child("PrefsFile.ini")//Failure on this line
ThColl and PhPrefsF are global folderItems in a module and not shared, and not in App.
The particular code is in a window and in the close event. PFolderProp is a property of the window.
The line which causes a problem is ThPrefsF = ThColl.Child("PrefsFile.ini")
ThColl is the Parent folder and gets reassigned properly.
ThPrefsF is the location of an ini file.
ThPrefsF is interestingly only a problem if it has been saved (not accessed?) and the StrtUpPrefs and the ThColl is changed and therefore the ThPrefsF is then accessed instead of MainList.
I hope I’ve explained HOW the setup for the error is made.
Now for the error on ThPrefsF = ThColl.Child("PrefsFile.ini")
Under all circumstances the assignment is NOT reapplied.
On Mac this causes a crash of the debugger. The line isn’t finished.
On PC the ThPrefsF becomes Nil.
Suggestions on how to report this and what could be the problem???