I don't think it's a BBC-specific problem that you have here. The DATA line for the 2-dimensional array starts with 4,2 whereas the other (REMMED out line) starts with a 4. The 4 gets read in both cases, but the 2 seemingly never gets read as a numeric variable. It actually gets read as a string variable (which wouldn't crash the program but is not what you intended). The subscript error comes from using the 4 (read into 'ch') as an index into the second dimension of the array ... which only goes up to 2.
Also (BBC specific possibly):
- You don't need to keep repeating the DATA statement, it can just go at the start of the line and the have everything else following it separated by commas.
- REM is the only way to comment out a line.
Also (BBC specific possibly):
- You don't need to keep repeating the DATA statement, it can just go at the start of the line and the have everything else following it separated by commas.
- REM is the only way to comment out a line.
Statistics: Posted by jms2 — Tue Nov 19, 2024 12:25 pm