I've noticed that on ZX81 BASIC, I can use PI as a variable name (not the token PI), like this:

Code: Select all

```
1 LET PI=3.14
2 PRINT PI
```

Code: Select all

```
1 FOR PI=0 TO 3
2 PRINT PI
3 NEXT PI
```

Thanks,

Shaun.

Hi,

I've noticed that on ZX81 BASIC, I can use PI as a variable name (not the token PI), like this:

However, I can't use PI in a FOR loop, like:

Is this a limitation of the FOR command (i.e., can you only use single-character variable names in FOR loops)?

Thanks,

Shaun.

I've noticed that on ZX81 BASIC, I can use PI as a variable name (not the token PI), like this:

Code: Select all

```
1 LET PI=3.14
2 PRINT PI
```

Code: Select all

```
1 FOR PI=0 TO 3
2 PRINT PI
3 NEXT PI
```

Thanks,

Shaun.

Loop variables can only be one character.

Variables can also contain SPACES:

Code: Select all

```
10 LET NOT PI = 0
20 PRINT NOT PI
```

My ZX81 web-server: online since 2007

http://zx81-siggi.endoftheinternet.org/index.html

http://zx81-siggi.endoftheinternet.org/index.html

There is a distinction between keywords and plain letters.

So PI is not PI (P and I).

Also this is valid

I guess this is handled wrong with the ZX-IDE but this unusual programming style ...

So PI is not PI (P and I).

Also this is valid

Code: Select all

```
10 LET LET=99
20 PRINT LET
30 LET PRINT=88
40 PRINT PRINT
```

I guess this is handled wrong with the ZX-IDE but this unusual programming style ...

That is just so wrong!

Finish what you start. Truth is over the mountaintop or six feet under.

4 x TS1000, 2 x TS1500 , 2 x timex 2040 printer, 1/2 x timex 2020 cassette deck, ZXPAND+AY, ZeddyNET, ZXBlast..., unfinished Spectrum...Still no life!

4 x TS1000, 2 x TS1500 , 2 x timex 2040 printer, 1/2 x timex 2020 cassette deck, ZXPAND+AY, ZeddyNET, ZXBlast..., unfinished Spectrum...Still no life!

The real question isRe: PI or not PI, that is the question.

Code: Select all

```
10 if two beer or not two beer ....
```

Siggi

My ZX81 web-server: online since 2007

http://zx81-siggi.endoftheinternet.org/index.html

http://zx81-siggi.endoftheinternet.org/index.html