Hi all,
I recently wrote a routine to load user preferences from an SQL file at load time. I put the code in the FormCreate procedure of Form1. Most of it works well, except for the following strange behaviour. Currently I only have 3 preferences, and after loading the data and placing it into global variables, I then need to update the preferences screen (which is Unit2) to correctly reflect the settings.
PreferencesForm.DefaultHomeScreen.Text := DefaultHomeScreenPref;
If OpenModuleWalkThroughPref = 'True' then PreferencesForm.OpenModuleWalkThrough.Checked := true;
PreferencesForm.UserFilesDirectoryField.text := UserFilesDirPref;
Now the strange thing is, this works perfectly fine if I put the code into a button on Form1. But if I put it in the FormCreate procedure then, it still compiles, but I get the following error:
"Project raised exception class 'External: SIGSEGV'.
In file 'unit1.pas' at line 1411:
PreferencesForm.DefaultHomeScreen.Text := DefaultHomeScreenPref;"
I even tried calling the button procedure from within the FormCreate procedure, but the same thing happens. If I comment out the first line of the code, then it complains about the second, and so on. What the...?