[Gambas-user] Settings problem (crash)

Bruce Steers bsteers4 at gmail.com
Tue Oct 4 12:22:26 CEST 2022


PS. I was able to tell that right away as when i compiled it I got a
warning message...

FMain, 9, "Class name hidden by global declaration: Settings"
(it made no sense for FMain.class, line 9 where the debugger said it was
because the warning was in fact coming from FMain.form not FMain.class)

but it told me there was something declared as "Settings" somewhere that
probably should not be.

I could not find a definition in the code but then i found it in the Menu
editor. I renamed the spacer from Settings to mnuSpacer and then everything
worked okay.

Well wishes
BruceS


On Tue, 4 Oct 2022 at 10:58, Bruce Steers <bsteers4 at gmail.com> wrote:

> You have a spacer in your menu and it's name is "Settings"
>
> It is causing a conflict, rename the spacer to something else.
>
> BruceS
>
>
> On Mon, 3 Oct 2022 at 14:24, wig <wig at noxqs.org> wrote:
>
>> In a big project, when retrieving settings, I started to have the error
>> message:
>>
>> "Not an array (23)"
>>
>> in FMain 2288:
>>   Settings["Report/TitlesOn"] = mniReportTitles.Checked
>>
>> I checked the syntax again and again, but had it on all instances of use
>> of settings from then on, in FMain.  Not in my FAbout.
>>
>> The project used several libraries, settings for database access, menu
>> state etc, so it took me about a week to trim out all non-relevant
>> possibilities.
>>
>> Now I have the demonstration of the problem in this small project, where
>> I just save and retrieve a counter in the settings:
>> SettingsProblem-0.0.1.tar.gz.
>>
>> The program crashes on it except when I use Try in front of the settings
>> line.
>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221004/d4bb5843/attachment.htm>


More information about the User mailing list