QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Ashish on September 23, 2019, 09:06:43 am

Title: IDE Strange Behaviour : Division By 0
Post by: Ashish 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 "\"
Title: Re: IDE Strange Behaviour : Division By 0
Post by: bplus 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)
Title: Re: IDE Strange Behaviour : Division By 0
Post by: SMcNeill 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.
Title: Re: IDE Strange Behaviour : Division By 0
Post by: Ashish 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]
Title: Re: IDE Strange Behaviour : Division By 0
Post by: bplus 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.
Title: Re: IDE Strange Behaviour : Division By 0
Post by: Petr 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
Title: Re: IDE Strange Behaviour : Division By 0
Post by: SMcNeill 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). 
Title: Re: IDE Strange Behaviour : Division By 0
Post by: Ashish on September 23, 2019, 10:04:00 am
Oh! Thanks Steve!
Title: Re: IDE Strange Behaviour : Division By 0
Post by: Ashish 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.

  [ This attachment cannot be displayed inline in 'Print Page' view ]  
Title: Re: IDE Strange Behaviour : Division By 0
Post by: SMcNeill 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?


 [ This attachment cannot be displayed inline in 'Print Page' view ]
Title: Re: IDE Strange Behaviour : Division By 0
Post by: Ashish on September 23, 2019, 11:56:18 am
@Steve
....

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

Title: Re: IDE Strange Behaviour : Division By 0
Post by: SMcNeill 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.

 [ This attachment cannot be displayed inline in 'Print Page' view ]


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.  :(
Title: Re: IDE Strange Behaviour : Division By 0
Post by: Jack002 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?
Title: Re: IDE Strange Behaviour : Division By 0
Post by: SMcNeill 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.  ;)