Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is this a bug with Round or is it just me
#1
If I was smart being a new forum user I would comment on a few things to start off positive, but I never claimed to be smart so I'm wondering if this is a bug in the new editor version.  This is my first time running a Chromebook with QB64 in the Linux container, Arm64 processor.  The QB64 editor shows no errors, the program compiles without problems, but when I run the program nothing is printed out. I do realize the command should be _Round.

Code: (Select All)

$Console:Only

num = 203.5
rounded_num = round(num)
Print rounded_num

System
Reply
#2
You shouldn't print, but you should get an Out of Bounds error pop-up.

round, undefined like that, is an array from 0 to 10 elements.  num would automatically round to 204, and there's no 204th element in that array.

You should error here, not print.
Reply
#3
Oh interesting, it thinks round is an array,  My brain was stuck in the fact I was trying for _Round and I was confused why it didn't tell me.  

thanks Smile
Reply
#4
I would end up replacing the (system) with (end).
So the program is finished so quickly that you can"t see anything.


Code: (Select All)

$Console:Only

num = 203.5
rounded_num = _Round(num)
Print rounded_num

End
Reply
#5
Seffan-68,

Code in post #4 works just fine. If I change 203.5 to 204.4 it round the number down. No errors in the way you got it. I'm running Windows 11 with 4.2 in IDE. Hope this helps. 

- GareBear
Reply
#6
(07-05-2025, 05:45 PM)Steffan-68 Wrote: I would end up replacing the (system) with (end).
So the program is finished so quickly that you can't see anything.

what is being said here.  is after the person ran the program from the qb64 ide.  even on linux.

a program started with $console:only should be run from the terminal.  in that case end becomes annoying.  it yields a prompt which says press enter to continue.  use system to avoid it.
Reply
#7
As @Steve McNeill mentioned, there is an error message and you can see the result by using Sleep.

Code: (Select All)

$Console:Only

num = 203.5
rounded_num = round(num)
Print rounded_num

Sleep 5

End
Reply
#8
I'm running QB64PE in the Linux container of a Chromebook so there isn't any "Desktop GUI" just a terminal, so I don't get any kind of a pop-up.  Makes me wonder what other kinds of info I'm missing.  When I first started the IDE I had to remove the check on the GUI Dialogs in the options menu and revert to the old style menu's, which is fine by me.
Reply
#9
(07-07-2025, 12:54 PM)BarrySWTP Wrote: I'm running QB64PE in the Linux container of a Chromebook so there isn't any "Desktop GUI" just a terminal, . . .
I don't really know what you mean by that, but the output looks like this under Win10:

[Image: rounded.jpg]
Reply
#10
(07-07-2025, 12:54 PM)BarrySWTP Wrote: I'm running QB64PE in the Linux container of a Chromebook so there isn't any "Desktop GUI" just a terminal, so I don't get any kind of a pop-up.  Makes me wonder what other kinds of info I'm missing.  When I first started the IDE I had to remove the check on the GUI Dialogs in the options menu and revert to the old style menu's, which is fine by me.

I did some testing on a Chromebook with QB64-PE a few years ago. I do not have the Chromebook anymore. But I remember that the Linux container is Debian-based.

Running sudo apt install yad xdialog zenity made the GUI dialogs work for me.

Honestly, I do not remember which of those three packages worked for me. I'd say try only yad first.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Exiting FOR NEXT, maybe a bug? Version 4.1.0 on Linux Circlotron 4 843 05-09-2025, 02:22 AM
Last Post: Circlotron
  I have fallen in a bug or weird behaviour TempodiBasic 2 671 10-08-2024, 06:09 PM
Last Post: TempodiBasic
  3.13.1 bug report - keyboard characters swapped Circlotron 3 999 06-03-2024, 05:16 AM
Last Post: Circlotron
  I need input on a possible bug in v3.5.0 TerryRitchie 50 8,411 05-22-2024, 07:03 PM
Last Post: TerryRitchie
  Is this a bug? TerryRitchie 6 1,215 05-16-2024, 10:51 PM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: