[Gambas-user] I think I might have a corrupt project
Tobias Boege
taboege at ...626...
Tue Nov 11 17:52:34 CET 2014
On Tue, 11 Nov 2014, Martin McGlensey wrote:
> Hello,
>
>
>
> Have a large Gambas database app that I have been developing over the past
> year. It had been working well up until last night. I was adding a new form
> and debugging an older one. Now I'm getting strange error messages. For
> example - Message.Info("You are in bad trouble now!") gets "unable to load
> image" error. Originally this project was developed under Gambas 3.5.X now
> using 3.6.1 on Ununtu 12.04.
>
Did you do any update after you last checked that the project worked and
before it didn't work?
"Unable to load image" from the Message class is a possible runtime error
and does not necessarily indicate any corruption in your project. The
Message class tries to load the icon corresponding to the type of message
you display (in your case the "info" icon). An error loading it is not
caught so the interpreter will throw an error. The absence of this file
indicates either a problem in your installation or a corrupted
gb.form.stock component binary (or wherever the Picture class gets its
pictures from). From this error, I'd say the reason for the failure is more
likely to be found in the last update or maybe in how reliable your hard
drive is...?
>
> Worse than that this code, that had been ok before, returns "Type mismatch:
> Wanted Boolean got Function" on the line Neighborhood.Connection =
> modMain.$Con. The Query above the error works as it should. The connection
> appears OK since the query works. It's only the DataSource Neighborhood that
> errors out. This error occurs on all forms that have a DataSource object
> regardless of its name or datatable. If I create a new project with the same
> code, one form and datasource, and message.Info() it works. The problem has
> to be in the project.
>
This is also not a too exotic error. It indicates that something is used
incorrectly, in a syntax way. These things are sometimes hard to spot
because in Gambas functions are also used to implement properties which are
syntactically two very different things. But if you say, you didn't change
the project since it last worked, that's indeed weird.
I honestly don't think your project is corrupted because these two points
don't really fit into my experience with actually corrupted projects.
They're not wild enough.
In any case, be sure to recompile the entire project by doing
$ cd /your/project/directory
$ rm -r .gambas
$ gbc3 -ga
then try running it again. I don't think it can fix the first point but it
_could_ fix the second one.
Regards,
Tobi
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
More information about the User
mailing list