Menu

INPUT A

2015-12-02
2018-07-10
  • Ronald Herrera

    Ronald Herrera - 2015-12-02

    I have a suggestion. There shall be always a numeric answer for variable A, but what happens when you hit enter without writing any number? Probably the user is saying that the default value (of no entered value) should be 0. My suggestion is for that let PC-BASIC accepts value 0 for a none entered value instead of the error message: “?Redo from start.” Of course the programmer can work around this using a string value A$ and then converting the null into a 0, using A=VAL(A$).

    This is useful for users hitting just enter in knowledge that they are choosing the default value like in GWBASIC..

    Ron.
    P.D. The new release 15.08.02 works marvelously. Thank You!

     
    • Rob Hagemans

      Rob Hagemans - 2015-12-02

      Hi Ronald, you are right once more, INPUT should accept empty values as it does in GW-BASIC. I think this used to work correctly in an older version, but a bug has come in while refactoring this code. It's easily fixed an will be in the next bugfix release.

       

      Last edit: Rob Hagemans 2015-12-02
  • Robert MacKenzie

    May I put in my 2 cents here? I seem to remember GW-BASIC just not changing A if [ENTER] is pressed before an value is input. If A is defined, it leaves it alone. If A is not defined, it creates a new A variable with a value of 0. It never used to go back and change A to 0 if it already had a value. This allows a program user to just press [ENTER] over values that were previously input.

     
    • Rob Hagemans

      Rob Hagemans - 2018-07-10

      It does set the value to zero if nothing is entered. This has been checked and confirmed with GW-BASIC 3.23

       
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.