Pergunta

170 FOR J=1 TO 5
180 PRINT
190 NEXT J
200 REM *********************************
210 DIM A(2),B(2),C(2),D(2,100),E(2,100),F(2,100),G$(100)
220 REM *******ENTER INPUT
230 PI=3.141593

I got error: Error on line 210: Expected end of line

What does that mean? How can I fix it?

If I remove line 210, I'll get: Error on line 230: Expected undefined

How can I fix it?

Foi útil?

Solução

I suspect that the code you have is intended for a different flavor of BASIC. There are a lot of them and they all have their own subtleties. I'll take a guess: the BASIC you're using doesn't allow dimming multiple arrays in one dim statement. Breaking it up into separate colon-separated statements should fix it:

210 DIM A(2): DIM B(2): DIM C(2): DIM D(2,100): DIM E(2,100): DIM F(2,100): DIM G$(100)

If that doesn't fix it, or if you prefer, break it into multiple lines. Then the line number in the new error message should narrow down the problematic part:

210 DIM A(2)
211 DIM B(2)
212 DIM C(2)
213 DIM D(2,100)
214 DIM E(2,100)
215 DIM F(2,100)
216 DIM G$(100)

Outras dicas

The accepted answer is is completely right, but to address your second question, I prefer GW-Basic, it was simple and gives you an old timey feel.

To use it you'll need either a 32 bit computer, or a DOS emulator like DOSBox. If you are unsure how to use doxbox, see this article.

To turn off the hotkey strip at the bottom, type in KEY OFF

To save use "save" and to load use "load"

Everything else should be similar to Q-Basic

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top