Active Forums => QB64 Discussion => Topic started by: Ed Davis on January 28, 2021, 12:54:13 pm
Title: Small syntax bug
Post by: Ed Davis on January 28, 2021, 12:54:13 pm
This code is intended to be used as a function, but I mistakenly used "exit sub", and "end sub" - and the QB64 compiler didn't catch it. It compiles and runs, and even seems to work, and passes my unit tests (this function is from a much larger program).
Title: Re: Small syntax bug
Post by: FellippeHeitor on January 28, 2021, 12:55:46 pm
Yeah, QB64 intentionally ignores the difference between END FUNCTION/END SUB, EXIT FUNCTION/EXIT SUB. Both have the same purpose and it's one less error.
Notice that QB4.5 would change it for you - we just let you be.
Also, internally both translate to a mere "}", that's why it doesn't really matter.
Title: Re: Small syntax bug
Post by: Pete on January 28, 2021, 12:59:13 pm
I don't want to make you guys extra work, but why not change it to...
EXIT WHATEVER
Okay, I was kidding. I do want to make you guys extra work!