update screwed everything up

Post Reply
sadams54
Posts: 36
Joined: Monday 09th July 2018 3:43am

update screwed everything up

Post by sadams54 » Friday 10th January 2020 1:26am

I did the updates and now gambas is really screwed...

1.. global variables are handled differently and had to recompile everything to make it work again.
2.. after months of work making reports and other things print nicely, the update has randomly changed the print size of everything so font sizes are almost ignored.

Do I have to spend months rewriting software again to fix the problem? is there a easy fix?

Using fedora 30

User avatar
gbWilly
Posts: 34
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: update screwed everything up

Post by gbWilly » Monday 13th January 2020 5:34pm

Hi,

1. You mention Global variables!!! Gambas doesn't have Global variables, so what exactly do you mean?
2. Did your default font type for your OS maybe change? As far as I am aware gb.Report2 has a certain order of checking what font type to use. An other font type might make fonts bigger or smaller.
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


... there is always a Catch if things go wrong!

sadams54
Posts: 36
Joined: Monday 09th July 2018 3:43am

Re: update screwed everything up

Post by sadams54 » Thursday 16th January 2020 12:42am

there are global variables...

in the module section before and outside of any sub or function..
private A[300] as string this used to do it.
Public A As New String[300] is how it must be now... so yes there are global variables..

As for the printing I never mentioned anything about a report. I said printing and it is done directly using the paint object. The problem was similar to what you mentioned though. The paint.fontscale had to be set because it was made dynamic and in my printing I need static as paper sizes and fonts never change. benoit helped with that but still have problems with multiple page documents. after the first call of paint.end I get "no current object" error when creating the 2nd page. Still nothing about that anywhere and I can't do multiple page documents yet.

User avatar
gbWilly
Posts: 34
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: update screwed everything up

Post by gbWilly » Thursday 16th January 2020 1:21pm

Hi,

Gambas has Private and Public variables.
- Private can be used within the Class
- Public can be used in and outside a Class

Global variables is a term that comes from Visual Basic.
And seeing many of us used to program in Visual Basic it is still often used by former Visual Basic developers when talking about Gambas.
I can't even remember how it used to work in Visual Basic but I do remember from my beginning days in Gambas that it is slightly different opposed to Visual Basic.
Not that it is that important, it's just terminology, as long as we all can understand what we mean it should be fine ;)
private A[300] as string this used to do it.
Public A As New String[300] is how it must be now
The first one you used is an embedded array.
This is what the wiki has to say about them (http://gambaswiki.org/wiki/cat/arraydecl):
Embedded arrays were created to ease the interface between Gambas and external functions located in shared libraries.
Consequently, I strongly suggest to use them only if you cannot use normal arrays.
Or if your code run faster with embedded arrays than with normal arrays, as it's possible in some cases.
The latter method is the preferred manner of doing things in Gambas (see above quote).
The fact that things don't work anymore as used to seems to be a bug.
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


... there is always a Catch if things go wrong!

Post Reply