• Print

Author Topic: Input bug  (Read 127 times)

eoredson

  • Hero Member
  • *****
  • Posts: 633
  • I programmed myself into a psychiatric conniption!
    • QB45 Oredson files at Filegate Network
Input bug
« on: May 21, 2018, 11:36:41 pm »
BUG?

In qb45 the following

   INPUT x, y ,z

happens to display "Redo from start"

if input 1, 2

however, in qb64 it returns z = 0

(is this a bug?)
Games: DNDDOOR - https://bit.ly/EriksDNDDoor DUNGEON - https://bit.ly/EriksDungeon
Interpreter - https://bit.ly/EriksSICK Hex Editor - https://bit.ly/EriksHexEditor
Utilities - https://bit.ly/EriksUtils Old QB64 - https://bit.ly/OldQB64
QB64 shell - https://bit.ly/QB64shell

FellippeHeitor

  • QB64 Partner Site Owner
  • Hero Member
  • *
  • Posts: 1901
  • LET IT = BE
    • QB64.org
Re: Input bug
« Reply #1 on: May 22, 2018, 07:17:48 am »
Noted.

I disagree with the bug status in that it makes sense to have an empty field to result in 0. I do acknowledge that the behavior is different from QuickBASIC 4.5, with which we strive to be compatible, but I also don't see where this would be harmful for a vintage program that would expect more than one input.

Provided that the input prompt is clear enough to state that more than one variable is required, I don't see it as an urgent fix.

Also: Galleon worked hard with data type validation for INPUT so that we don't get "Redo from start" errors at all in QB64. This looks like by design to me.
- InForm for QB64 http://qb64.org/inform

- vWATCH64 (debugger for QB64) http://bit.ly/vWATCH64v1-103

- Games: http://bit.ly/2048_qb64 * http://bit.ly/ClonedShades_qb64source * http://bit.ly/2aqK866 * http://bit.ly/SpaceshipQB64 * http://bit.ly/2rD1pPP

eoredson

  • Hero Member
  • *****
  • Posts: 633
  • I programmed myself into a psychiatric conniption!
    • QB45 Oredson files at Filegate Network
Re: Input bug
« Reply #2 on: May 22, 2018, 08:03:35 pm »
I also wanted to note the qb45 keyboard activities for INPUT X$ which are:

Code: [Select]
It is possible to edit a line of input before you press ENTER. The
following list describes the key combinations that allow you to
move the cursor, delete text, and insert text on the input line:

  Keys                Action commands, INPUT statement

  CTRL+\ or RIGHT     Moves cursor one character to the right.

  CTRL+] or LEFT      Moves cursor one character to the left.

  CTRL+F or           Moves cursor one word to the right.
  CTRL+RIGHT

  CTRL+B or           Moves cursor one word to the left.
  CTRL+LEFT

  CTRL+K or HOME      Moves cursor to the beginning of the input line.

  CTRL+N or END       Moves cursor to the end of the input line.

  CTRL+R or INS       Toggles insert mode on and off. When insert
                      mode is on, characters above and to the right
                      of the cursor are shifted to the right as new
                      characters are entered.

  CTRL+I or TAB       Tabs right and inserts (insert mode on), or
                      overwrites (insert mode off).

  DEL                 Deletes the character at the cursor.

  CTRL+H or           Deletes the character to the left of the
  BACKSPACE           cursor, unless the cursor is at the beginning
                      of the input, in which case it deletes the
                      character at the cursor.

  CTRL+E or CTRL+END  Deletes to the end of the line.

  CTRL+U or ESC       Deletes entire line, regardless of cursor
                      position.

  CTRL+M or RETURN    Stores input line.

  CTRL+T              Toggles function key label display on and off
                      at bottom of screen.

  CTRL+BREAK or       Terminates input (exits compiled program).
  CTRL+C


and are not supported by qb64.
Games: DNDDOOR - https://bit.ly/EriksDNDDoor DUNGEON - https://bit.ly/EriksDungeon
Interpreter - https://bit.ly/EriksSICK Hex Editor - https://bit.ly/EriksHexEditor
Utilities - https://bit.ly/EriksUtils Old QB64 - https://bit.ly/OldQB64
QB64 shell - https://bit.ly/QB64shell

Bert22306

  • Hero Member
  • *****
  • Posts: 1389
Re: Input bug
« Reply #3 on: May 23, 2018, 02:16:10 pm »
In my view, along the same lines as Fellippe's, QB64 needs to be backward compatible with QB 4.5 programs, but that doesn't mean it has to have all the same quirks. It just means that a program written for QB 4.5 needs to run correctly, hopefully without any errors.

So, this INPUT quirk in QB 4.5, in my opinion, should not need to be replicated. In fact, my preference would be that the behavior NOT be replicated, in this case.

On the other hand, the keyboard shortcuts, that's a different issue. More like the issue of allowing entry of the IBM extended character set, through the keyboard. That was most welcome.

And while we're talking about opinions, I guess I missed the part where a lot of QB64 users wanted all of the nonsensical IDE color changes within REM comment statements. It makes a lot more sense that REM and ' behave exactly the same, as far as forcing colors on certain key words. I like the colors - they have saved me from typos - but in the REM statements, honestly, what's the point??

FellippeHeitor

  • QB64 Partner Site Owner
  • Hero Member
  • *
  • Posts: 1901
  • LET IT = BE
    • QB64.org
Re: Input bug
« Reply #4 on: May 23, 2018, 03:19:25 pm »
When it was decided that REM shouldn't get comment coloring I wasn't around either and there was no keyword coloring so it was probably not a concern at the time.

A future release may offer the possibility to make REM behave like the apostrophe for coloring as well.
- InForm for QB64 http://qb64.org/inform

- vWATCH64 (debugger for QB64) http://bit.ly/vWATCH64v1-103

- Games: http://bit.ly/2048_qb64 * http://bit.ly/ClonedShades_qb64source * http://bit.ly/2aqK866 * http://bit.ly/SpaceshipQB64 * http://bit.ly/2rD1pPP

SMcNeill

  • Moderator
  • Hero Member
  • *****
  • Posts: 6253
Re: Input bug
« Reply #5 on: May 24, 2018, 04:39:04 am »
Quote from: Bert22306 on May 23, 2018, 02:16:10 pm
And while we're talking about opinions, I guess I missed the part where a lot of QB64 users wanted all of the nonsensical IDE color changes within REM comment statements. It makes a lot more sense that REM and ' behave exactly the same, as far as forcing colors on certain key words. I like the colors - they have saved me from typos - but in the REM statements, honestly, what's the point??

Back when I added some basic colors to the IDE, I first had it set so that REM and ' both used the same colors....

And then I got fussed at and had to make REM uncolored as QB64 regards it as BOTH a statement AND a remark.

For example:

IF whatever THEN REM

The above is a perfectly valid and self-reliant line of code.  That REM isn't just counted as a remark, but also as a valid command to be executed after THEN.

IF whatever THEN '

And the above, by itself, with generate an IF WITHOUT END IF error.   That apostrophe designates itself and whatever is after it as being nothing more than a comment.

In other words, as it was explained to me, in QB64:

REM is a COMMAND to add a remark, and as such must be colored and treated like any other command.

Whereas the apostrophe (') doesn't parse as a command and is simply a remark alone.



Personally, I preferred them to be the same -- even to the point of THEN REM being treated exactly like THEN ', and generating that IF WITHOUT END IF error -- but that wasn't a choice I got to make.  It was decided REM is a COMMAND and ' is a COMMENT, and thus the two are colored differently in the IDE.
http://bit.ly/Color32BI -- A set of color CONST for use in 32 bit mode, as a BI library.

Bert22306

  • Hero Member
  • *****
  • Posts: 1389
Re: Input bug
« Reply #6 on: May 24, 2018, 11:34:02 am »
Well, sumbich, Steve. I only ever use REM as a comment line, so I missed all this nuance.

At least, I now get where they were coming from. You had mentioned this debate before, which I evidently missed whenever it occurred, but you hadn't explained the reason. So, thanks!

  • Print