![]() |
Forum Index : Microcontroller and PC projects : CMM2: Bug(?) in INPUT of multiple variables from file
Author | Message | ||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Try this on for size, does INPUT not work the way I think it does? Colour Maximite 2 MMBasic Version 5.05.05 Copyright 2011-2020 Geoff Graham Copyright 2016-2020 Peter Mather > list "bug2.bas" Option Explicit Option Default Integer Dim i Dim a(9) For i = 0 To 9 a(i) = i + 1 Next i Open "out.dat" For Output As #1 Print #1,a(0),a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9) Close #1 For i = 0 To 9 a(i) = -1 Next i Open "out.dat" For Input As #1 Input #1,a(0),a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9) Close #1 For i = 0 To 9 Print a(i); Next i > run "bug2.bas" 1 0 0 0 0 0 0 0 0 0 > list "out.dat" 1 2 3 4 5 6 7 8 9 10 Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
Check the manual and then replicate in the file |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Right, values need to be comma separated in the file unlike BBC BASIC. Thanks, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |