Skip to content

Bug fix for when reading raw exernal text files with sequencial input mode "I" #218

@EmmanuelAsmFun

Description

@EmmanuelAsmFun

Bug report

Problem

Read reading raw exernal text files with sequencial input mode "I" does not work correctly
when the array type is a string, it needs to use comma's, when the array is numeric, it needs to uses spaces.

Steps

  1. Run the program below

Program
65 OPEN "I",3,AL:O=1
66 IF EOF(3) THEN CLOSE 3:O=O-1:RETURN ELSE INPUT #3,O(O),O1(O),AO(O):O=O+1:GOTO 6510
File content
1 1990 MrTest,

Crash log

Notes
Fix

Replace in
use default string and not decimal
The type needs to by found by the complete name
basic/implementation.py
line 785
def _input_file(self, finp, readvar):
"""INPUT: retrieve input from file."""
for v in readvar:
name, indices = v
typechar = self.memory.complete_name(name)[-1:]
word, _ = finp.input_entry(typechar, allow_past_end=False)
value = self.values.from_repr(word, allow_nonnum=True, typechar=typechar)
self.memory.set_variable(name, indices, value)

Full method fix
def _input_file(self, finp, readvar): """INPUT: retrieve input from file.""" for v in readvar: name, indices = v typechar = self.memory.complete_name(name)[-1:] word, _ = finp.input_entry(typechar, allow_past_end=False) value = self.values.from_repr(word, allow_nonnum=True, typechar=typechar) self.memory.set_variable(name, indices, value)
PC-BASIC version:
Operating system version:

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions