Author Topic: IDE Strange Behaviour : Division By 0  (Read 2095 times)

0 Members and 1 Guest are viewing this topic.

This topic contains a post which is marked as Best Answer. Press here if you would like to see it.

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
IDE Strange Behaviour : Division By 0
« on: September 23, 2019, 09:06:43 am »
Hello everyone!
Try to type following into your QB64 IDE
Code: QB64: [Select]
  1. const a = 14 \ 3
  2.  

Reply to this, if you get "Division by 0 error".
Remember, I am using integral division "\"
« Last Edit: September 23, 2019, 09:09:24 am by Ashish »
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: IDE Strange Behaviour : Division By 0
« Reply #1 on: September 23, 2019, 09:42:12 am »
Hi Ashish, what version QB64 are you using? (assuming you are getting a division by 0 error, I am not with QB64 1.3 on Windows 10)

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
Re: IDE Strange Behaviour : Division By 0
« Reply #2 on: September 23, 2019, 09:43:16 am »
I'm not getting an error either.  When I print a, I get a value of 4.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
Re: IDE Strange Behaviour : Division By 0
« Reply #3 on: September 23, 2019, 09:47:51 am »
There is no problem with printing the value. The problem is with just one line - "CONST a = 14 \ 3".

DON'T COPY AND PASTE THAT CODE IN IDE!!!!
I already said try to *type* that line in QB64 IDE.

I am using QB64 V1.3 Dev Build [git 729557f]
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: IDE Strange Behaviour : Division By 0
« Reply #4 on: September 23, 2019, 09:51:42 am »
Ah yes! QB64 bugs out as soon as I type the \  wow! I don't even get an error notice.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
Re: IDE Strange Behaviour : Division By 0
« Reply #5 on: September 23, 2019, 10:00:17 am »
Hi Ashish. The ide crashes after entering the command. Windows reports that the program has stopped working. If i start it again and clicking YES for restoring previous program, IDE crash again. Version 1.3 96937f0

Marked as best answer by Ashish on September 23, 2019, 06:04:13 am

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
Re: IDE Strange Behaviour : Division By 0
« Reply #6 on: September 23, 2019, 10:01:10 am »
https://www.qb64.org/forum/index.php?topic=1554.msg107768#msg107768

This has been fixed in the development version, and in my personal repo (for those who have cloned it). 
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
Re: IDE Strange Behaviour : Division By 0
« Reply #7 on: September 23, 2019, 10:04:00 am »
Oh! Thanks Steve!
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
Re: IDE Strange Behaviour : Division By 0
« Reply #8 on: September 23, 2019, 10:08:05 am »
Ah yes! QB64 bugs out as soon as I type the \  wow! I don't even get an error notice.
I am using Dev build, and that's the reason I can see the reason of the error.

  [ You are not allowed to view this attachment ]  
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
Re: IDE Strange Behaviour : Division By 0
« Reply #9 on: September 23, 2019, 11:45:23 am »
What version/OS?  The IDE is picking up the glitch and reporting it as a standard error for me, as illustrated in the screenshot below.  There's a difference in our systems somewhere, but what the heck is it, to make it behave differently for you?


 [ You are not allowed to view this attachment ]
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
Re: IDE Strange Behaviour : Division By 0
« Reply #10 on: September 23, 2019, 11:56:18 am »
@Steve
....

I am using QB64 V1.3 Dev Build [git 729557f]

if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
Re: IDE Strange Behaviour : Division By 0
« Reply #11 on: September 23, 2019, 12:07:30 pm »
You must not have the latest dev build, which corrects the issue.  As you can see from your screenshot, and mine (which I just downloaded a few moments ago for testing), the version numbers don't match at all.

 [ You are not allowed to view this attachment ]


At this point, all I can suggest is to grab a fresh copy from the repo and see if the glitch persists for you.  If so, are you on Linux/Mac, or Windows?  I don't have a clue where to start debugging a glitch which I can't seem to reproduce.  :(
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Jack002

  • Forum Regular
  • Posts: 123
  • Boss, l wanna talk about arrays
Re: IDE Strange Behaviour : Division By 0
« Reply #12 on: September 23, 2019, 04:15:17 pm »
I have version 1.2, I see what Steve sees. However, if you keep typing, it goes away.
You type up to the \
you see the error
you type the 3, now its gone.
Is that a bug?
QB64 is the best!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
Re: IDE Strange Behaviour : Division By 0
« Reply #13 on: September 23, 2019, 04:18:30 pm »
I have version 1.2, I see what Steve sees. However, if you keep typing, it goes away.
You type up to the \
you see the error
you type the 3, now its gone.
Is that a bug?

Nope.  That's the IDE telling you what it should be telling you -- you're trying to divide by zero; finish filling in that formula properly.  ;)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!