Menu

#56 INPUT - fix bugs

Unstable_(example)
open
None
5
2017-08-16
2017-08-16
No

Hi Jim,

This update fix the INPUT statement.


FIX INPUT Crash

Run a simple program like this:

input a

Do not hit Enter. Just click Stop.
After a few attempts you will get a crash.
To speed up test keep pressing F5 while you click on Stop button many times.

The problem occurs when Interpreter reach OP_ASSIGN with a NULL element on stack.
It should stop in the middle of OP_INPUT, but some times it manages to reach OP_ASSIGN because of poor comunication between threads.

00000000 OP_CURRLINE          1
00000002 OP_PUSHSTRING        ""
00000004 OP_PUSHINT           0
00000006 OP_INPUT            
00000007 OP_ASSIGN            a

FIX INPUT text

Run this program:

input a
print "User imput: [";a;"]"

Tests:
1) write some text, put currsor in middle of string and hit enter
2) write some text, select a part of this text and hit enter

The entered text will be wrong in both cases


Respectfully,
Florin Oprea

Discussion


Log in to post a comment.

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.