Problem with Purebasic v6.00

Just starting out? Need help? Post your questions and find answers here.
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: Problem with Purebasic v6.00

Post by jak64 »

Thank you Marc56us for all this information, I will test it.

The only difference with you (I am French, I live near Biarritz...Very beautiful region) is that I have set the language to French in the preferences of Purebasic.
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: Problem with Purebasic v6.00

Post by jak64 »

Hello Marc56us,

Here is a program I wrote that works fine in v5.73 but not in V6.00

I refined this program: it normally contains more than 17000 photos but I removed them so that the zip is not too big but also because I do not have the copyrights to publish these photos.
I only use this game at home.

When you launch the program in v6.00, it hangs when you click on the "SUIVANT" button

https://u.pcloud.link/publink/show?code ... zxJzK5q3MV

It weighs 15MB.
thanks for your help
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: Problem with Purebasic v6.00

Post by jak64 »

My computer is a DELL Latitude 7290 with 16 GB of RAM with Windows 11 Professional French version 21H2
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1243
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: Problem with Purebasic v6.00

Post by Paul »

jak64 wrote: Wed Aug 17, 2022 2:03 pm When you launch the program in v6.00, it hangs when you click on the "SUIVANT" button
If you follow the debugger, you will see it is caught in a loop at line 7032

Code: Select all

  While MouseButton(#PB_MouseButton_Left)
    ExamineMouse()
  Wend
Image Image
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: Problem with Purebasic v6.00

Post by jak64 »

But this program works perfectly in v5.73!
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1243
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: Problem with Purebasic v6.00

Post by Paul »

I also have programs that worked fine prior to v6, so yes, I believe things have changed internally.
Are these bugs in v6 or bug fixes to previous version? Only Fred knows this ;)

I use to be able to use SpriteBlendingMode() then do various ZoomSprite() and DisplayTransparentSprite() operations.
In v6, graphics were messed up and the fix for me was to put SpriteBlendingMode() before every ZoomSprite() command.
Image Image
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Problem with Purebasic v6.00

Post by Marc56us »

Yes,

As suggested by Paul: remove the blocking loop: (28 times...)

Code: Select all

;   While MouseButton(#PB_MouseButton_Left)
    ExamineMouse()
;   Wend
ExamineMouse() is enough
and it works :)

For the DPI problem, it works fine at 100% but is not at 125% on my laptop.
This factor should be used when resizing the interface. DesktopResolutionX(), Y
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: Problem with Purebasic v6.00

Post by jak64 »

Hello Marc56us

I put this loop to be sure that the player has released the mouse button otherwise the click can be taken into account in the rest of the program (it has often happened to me, that's why I systematically put this loop in my programs ).

On the other hand, I'm not going to modify a program that works in V5.73 because it doesn't work in v6.00, especially since I would have lots of programs to modify.

For the DPI, I use it so that my programs adapt to the screens of other users and with v6.00 there are problems while there are not with v5.73

I repeat, for me it's v6.00 which has bugs and I won't use it anymore until there are fixes
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: Problem with Purebasic v6.00

Post by jak64 »

If for example, I have to left click on a button and then I have to do a second left click in the continuation of my program, if I do not put this loop, the program consider the second click done!
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Problem with Purebasic v6.00

Post by Marc56us »

I'm not going to debug any further because I don't do graphic programs (anymore). I only do command line programs (text only) or Windows GUI, so I won't be able to help you further.
PS. I find that there are a lot of WindowEvent() loops. Maybe there is also a global design to review?
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: Problem with Purebasic v6.00

Post by jak64 »

Mar56us,
You have already helped me a lot.
For WindowEvents, there are plenty of Screen windows in my program
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: Problem with Purebasic v6.00

Post by jak64 »

For my personal info, what kind of programs can be written in command lines?
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Problem with Purebasic v6.00

Post by Marc56us »

These are not programs written on the command line, but programs that run on the command line. (Console)
Mostly tools that do not need interactivity. Examples: retrieve and process files (transport schedule, logs, opendata)
Some retrieve images (ie: weather maps), cut out a part, reduce the number of colors in order to return it on devices where data transfer is expensive (ie: satellite phone)
These programs run by themselves (triggered by the Windows or Linux scheduler) and do not need an interface. They return me the status (success or error) by email.
I used to do all this in batch (cmd, autoit, perl or bash) but now with PB because the debugging tools save a lot of time.
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Problem with Purebasic v6.00

Post by infratec »

One Program ... one event loop.

No more, no less.

Everything else leads in lost of events.
Doesn't matter how many windows are open.
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: Problem with Purebasic v6.00

Post by jak64 »

For infratec,
It's one way of looking at things, but it's not necessarily the only one.

Personally, I find that developing stand-alone modules makes programming easier.

If, for example, we have a welcome screen and an end screen, which only run at the beginning and at the end of the program, I don't see the point of integrating them in a loop in which we would have to test whether to execute them or not.
Post Reply