Skip to content

Commit bb2af3b

Browse files
committed
check if macro language numeric variables are of correct type (fix issue #208)
1 parent 523753f commit bb2af3b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pcbasic/basic/mlparser.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ def parse_number(self, default=None):
4040
if len(c) == 0:
4141
raise error.BASICError(error.IFC)
4242
elif ord(c) > 8:
43-
step = self._parse_variable().to_int()
43+
stepval = self._parse_variable()
44+
step = values.pass_number(stepval).to_int()
4445
self.require_read((b';',), err=error.IFC)
4546
else:
4647
# varptr$
47-
step = self.memory.get_value_for_varptrstr(self.read(3)).to_int()
48+
stepval = self.memory.get_value_for_varptrstr(self.read(3))
49+
step = values.pass_number(stepval).to_int()
4850
elif c and c in DIGITS:
4951
step = self._parse_const()
5052
elif default is not None:

0 commit comments

Comments
 (0)