[Gambas-user] Settings problem (crash)

wig wig at noxqs.org
Tue Oct 4 14:45:40 CEST 2022


 

I learned something interesting about the use of the Gambas IDE: 

1) I always did do "run", but then you don't see these warning messages
at all, it just says "compiling ok". 

I'll be handling more the F7 and less the F5 in the future.. 

2) The "find", "Search in all files" does not give me this occurrence of
"Settings" 

This name slipped in via an accidental paste I think 

Normally I give the menu items names like mnuHelp or mniHelpAbout, or
indeed mniSpacer. 

But I didn't know I had to be so carefull with names there.. 

Thank you! 

Bruce Steers schreef op 2022-10-04 12:22: 

> 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 [1] ]----

 

Links:
------
[1] http://gambaswiki.org/wiki/doc/netiquette
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221004/3f269b0d/attachment.htm>


More information about the User mailing list