QB64 Phoenix Edition v3.5.0 Released!
#31
I had a rant of my own that I had intended to post but I have decided against it. However, I will say that it isn't uncommon that a new version breaks compatibility with an OS or distro. I guess I am just lucky that I have been using operating systems that are most widely supported.
Ask me about Windows API and maybe some Linux stuff
Reply
#32
(01-11-2023, 12:51 PM)Kernelpanic Wrote:
(01-11-2023, 05:00 AM)mnrvovrfc Wrote: Why are you using "LOCATE" after "$CONSOLE:ONLY"?

If the console is 25 lines, the "LOCATE 27" which is the last cursor placement makes the screen roll. Either you make the "CMD.EXE" window longer up and down, or you take away the "$CONSOLE:ONLY" and add "WIDTH 80, 30" near the top of your program or something else.

EDIT: The screenshot indicates the program is working as expected. But it might benefit from a "CLS" first of all. Trying to treat the console like "SCREEN 0" is tricky on Windows.

No, it can not be, because under 3.4.1 it works as usual. I just tried that again. The locate in line 27 only serves to place the "Press any key ..." down a bit; I almost always do that with programs like this.

Also just tried: If I first run the program with 3.4.1 and then with 3.5.0 there are no problems, of course, because it was created with 3.4.1. If I now delete the exe file and create it again with 3.5.0, this strange behavior is there again.

If I take out the locate, it works again as usual after the second F5, then this strange behavior again. If I remove "$Console...", see screenshot.
So something goes wrong with the interaction of "$Console" and Locate on line 27, but only on 3.5.0.

Without "$Console ..."
[Image: Locatefehler2023-01-11-134646.jpg]

On my system (WIN 11) it runs without any problems.
[Image: 120.png]
Reply
#33
(01-11-2023, 12:51 PM)Kernelpanic Wrote: If I take out the locate, it works again as usual after the second F5, then this strange behavior again. If I remove "$Console...", see screenshot.
So something goes wrong with the interaction of "$Console" and Locate on line 27, but only on 3.5.0.

Without "$Console ..."
(image)

I repeat, you need a "WIDTH 80, 30" in the least, and without "$CONSOLE:ONLY", because by default "SCREEN 0" has only 25 lines and you're trying to put the cursor out of range by two lines. This is what you're showing with this screenshot. Maybe you have "CMD.EXE" console much taller up and down and that's why you don't notice it, while your program was printing to the console.

Ahhh... it's starting to come to me. With "$CONSOLE:ONLY" there should be a prompt given by "END" statement: "Press enter to continue". But if it's displaying "Press any key..." instead or alike, that's not expected behavior. The "Press any key to continue" at the bottom of the screen was derrived from QuickBASIC and QBasic, for "SCREEN 0" because remember many people ran their programs from the IDE. It wasn't noticed when the program was compiled and created with BC.EXE and LINK.EXE, and then run from MS-DOS command line.

But what is the message at the end of the program run, with the version of the program in post #26? If it's not "Press enter to continue" then it's a bug with QB64PE. If the screeen clears or something else then it's other-worldly behavior.
Reply
#34
@mnrvovrfc

Here's the previous release's console message. "Press any key to continue"
I'm pretty sure it's always been that way.

[Image: image.png]

And a regular screen:

[Image: image.png]
Ask me about Windows API and maybe some Linux stuff
Reply
#35
Thumbs Up 
Screenshots don't lie. I'm just trying to help out someone else.
Reply
#36
(01-10-2023, 09:01 PM)Kernelpanic Wrote: I have now discovered something that is very peculiar; maybe really a mistake. If I run the program below, i.e. press F5, then it works. But if I press F5 again, the output only appears like a flashlight, and nothing else. So, no more output.

I have now tested this with three other programs, but everything is normal there, as usual.

Well, what is go there wrong?

PS: It calculates my electricity price increase since October 2022

Code: (Select All)
$Console:Only

Option _Explicit

Dim As Double abOktVerbrauchPreis, jan2023VerbrauchPreis, bisOktVerbrauchPreis
Dim As Double alt2022Grundpreis, neuJan2023Grundpreis
Dim As Double okt2022ProzentErhoehung, jan2023ProzentErhoehung, grundpreisProzent
Dim As Double prozentualeGesamterhoehung, prozentGesamtAbOkt2022

'Grundpreis bis Ende 2022 und ab Januar 2023
alt2022Grundpreis = 7.90
neuJan2023Grundpreis = 9.90

'Alter Verbrauchspreis bis zum 1. Okt. 2022
bisOktVerbrauchPreis = 27.95

'Neuer Verbrauchspreis ab 1. Okt. 2022
abOktVerbrauchPreis = 32.25

'Verbraucherpreis ab Januar 2023
jan2023VerbrauchPreis = 40.54

Locate 2, 3
Print "Vattenfall Strompreiserhoehungen seit dem 1. Oktober 2022"
Locate 3, 3
Print "========================================================="
Locate 5, 3
Print "Erhoehung des Verbraucherpreises ab 1. Okt. 2022 pro Monat"
Locate 6, 3
Print "von 27.95 auf 32.25 Euro. Grundpreis blieb bei 7.90 Euro."

okt2022ProzentErhoehung = ((abOktVerbrauchPreis * 100) / bisOktVerbrauchPreis) - 100
Locate 8, 3
Print Using "Das entspricht einer Preiserhoehung von ##.##%"; okt2022ProzentErhoehung

Locate 11, 3
Print "Erhoehung des Verbraucherpreises ab 1. Januar 2023 pro Monat"
Locate 12, 3
Print "von 32.25 auf 40.54 Euro. Grundpreiserhoehung von 7.90 auf 9.90 Euro."

jan2023ProzentErhoehung = ((jan2023VerbrauchPreis * 100) / abOktVerbrauchPreis) - 100
Locate 14, 3
Print Using "Das entspricht einer Preiserhoehung von ##.##%"; jan2023ProzentErhoehung

grundpreisProzent = ((9.90 * 100) / 7.90) - 100
Locate 16, 3
Print Using "Beim Grundpreis entspricht dies einer Erhoehung um ##.##%"; grundpreisProzent

'Prozentuale Erhoehungen addieren
prozentualeGesamterhoehung = okt2022ProzentErhoehung + jan2023ProzentErhoehung + grundpreisProzent

Locate 18, 3
Print "Addiert man alle prozentualen Erhoehungen kommt man auf eine"
Locate 19, 3
Print Using "Erhoehung des Strompreises seit 1. Okt 2022 bis 1. Januar 2023 auf ##.##%"; prozentualeGesamterhoehung

prozentGesamtAbOkt2022 = ((jan2023VerbrauchPreis * 100) / bisOktVerbrauchPreis) - 100
Locate 22, 3
Print "Prozentuale Erhoehung des Verbraucherpreises ab 1. Oktober 2022"
Locate 23, 3
Print Using "bis 1. Januar 2023: ##.##%"; prozentGesamtAbOkt2022

'Fuer Press Key . . .
Locate 27, 0

End

[Image: QB64-3-5-Problem2023-01-10-215944.jpg]

From the error message that you're reporting, you're basically getting a "Locate out of bounds" type glitch.  Why are you getting it on the second run and not the first??   I dunno!  Maybe windows has some sort of setting where it tracks width and height of a console on a per instance ran.

Like mnrvovrfc mentioned, I think the problem will go away as long as you specify the size of the screen yourself.   Add a simple line WIDTH 120, 30 at the top of your code, under the $CONSOLE:ONLY, and I don't think you'll have any issues anymore.  

Give it a test or two, and let us know what happens for you.  Wink
Reply
#37
Quote:SMcNeill - From the error message that you're reporting, you're basically getting a "Locate out of bounds" type glitch.  Why are you getting it on the second run and not the first??   I dunno!  Maybe windows has some sort of setting where it tracks width and height of a console on a per instance ran.

Like mnrvovrfc mentioned, I think the problem will go away as long as you specify the size of the screen yourself.   Add a simple line WIDTH 120, 30 at the top of your code, under the $CONSOLE:ONLY, and I don't think you'll have any issues anymore.  

No change! It is as already described, once it works, then you only see the command line flashing briefly, but it doesn't stay. In this context, I noticed this flashing or a short flickering in all tested programs under 3.5.0, and only then does the command line appear. Only with the Vattenfall program does it not appear. I have now tested everything I could think of, I can not find an explanation for the behavior.

As a speculation I can think of, maybe this version does not get along with the long variable names. Pretty fantastic, but I have found over the years that there is no bug that does not exist!

To reiterate, with 3.4.1 this issue does not exist.

Same behavior.
Code: (Select All)
$Console:Only
Width 120, 30

Option _Explicit
. . .

'Fuer Press Key . . .
'Locate 27, 0

End

That is how it goes: No Console, and no Locate in row 67
Code: (Select All)
'$Console:Only
'Width 120, 30

Option _Explicit
. . .

'Fuer Press Key . . .
'Locate 27, 0

End

The Locate on line 67 has only this purpose:
[Image: Locate-Abstand-zu-Press.jpg]
Reply
#38
One can emulate some of these cursor movements using the virtual terminal codes here
Ask me about Windows API and maybe some Linux stuff
Reply
#39
(01-11-2023, 11:18 AM)mnrvovrfc Wrote: >sigh< To build QB64PE v3.5 on Gecko Linux (based on OpenSuSE "Leap") I had to exclude the "libqb_http" stuff.

First I tried to obtain the required libraries. There is no such thing as "libcurl4-devel" according to YaST and "zypper", although the regular library is there. There had been the "libcurl-devel". Tried to install "openssl-devel", version 1 and version 3, no success. Modified the Makefile to exclude HTTP(S) functionality, didn't work. Renamed "httpstub.cpp" to "http.cpp" while backing up the real source code component, more frustration. Finally I edited "libqb.cpp" and simply commented out all calls to whatever "libqb_http" functions.

It's "$UNSTABLE", right? I don't want to have to build a QB64 program on another Linux system, then bring that program over to this particular distro or any other that isn't like Arch or Debian, and it refuses to run because of one library.

This would have to be tested in "Tumbleweed", the rolling-release wing of OpenSuSE.

This is just for information. I don't expect every single Linux distro supported.


A few clarifications on
$Unstable
, it really has nothing to do with new dependencies, it's just a way for us to gradually introduce new functionality. The fact that we introduced the HTTP support as
$Unstable:Http
means that we may make breaking changes to it before it's stabilized as part of the language (though we'll avoid that if possible). Such a change could actually be related to whether
libcurl
is pulled in as a dependency, which is helpful to you. That is what we did with MIDI, for example.

With that, the
libcurl
dependency currently works the same as any other QB64 dependency, meaning it is only a dependency of your compiled program if your program actually makes use of that functionality. In this case, the requirements would be that you use networking (IE.
_OPENCLIENT
) and have the
$Unstable:Http
in your code. If you do not, then your executable will not depend on
libcurl
. The 'Generate License' option in the IDE is a good way to check what dependencies your program is using.

The issue you're running into is that the QB64 IDE/compiler makes use of
$Unstable:Http
for downloading the wiki (as it is about twice as fast as our previous method). That is unlikely to change, so to compile and run the IDE libcurl will be required. That said, libcurl is very common and I would be surprised if any distro does not offer a package for it. Unfortunately though I'm not that familiar with OpenSuSE.

Currently if you remove the
DEP_HTTP := y
around line 178 in the Makefile then you can build the IDE without including HTTP support. Note however that the Wiki downloading will not work, and also this Makefile change is unlikely to stay the same in the future.

@kernelpanic I did take a look at your code, unfortunately we really haven't made any changes that I think could impact that behavior, and also it seems to work fine for me even after running it multiple times Undecided I'll keep thinking about it though, maybe I'm missing something.
Reply
#40
@Kernelpanic I can't, for the life of me, see anything that would bug out the console.  When I run and test it, it runs fine on both my laptop and my home PC, without any indication of any problems.  If it runs once for you, as you say it does, then why wouldn't it run a second time??  I dunno!!

Check your task manager and make certain that the first instance is actually leaving memory, before the second one tries to start up.  From all I know, I don't think there was a single change made to QB64 which would alter the console processes which we have, between v3.41. and v3.5.  They *shouldn't* perform any differently for you, so the question becomes, "Why is the OS handling one different than the other??"

And that's hard to say, without being able to reproduce the issue as well.  It's like hunting squirrels while blindfolded in the midst of the thickest forest.  Sure, you can take a shot in the dark and hope you hit the target, but unless you get very lucky, all you ever end up really hitting is air.
Reply




Users browsing this thread: 4 Guest(s)