You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/identifier.md
+94-94Lines changed: 94 additions & 94 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,112 +1,112 @@
1
1
#Identifier
2
2
3
3
4
-
Identifiers are used in your ZX BASIC program to define _variable names_, _function names_, _subroutine names_ and _[labels](labels.md)_. ZX Basic identifiers **must** start with a letter (a..z / A..Z) followed by an arbitrary number of letters and or digits. Original Sinclair BASIC allows spaces within variable names, but ZX BASIC <u>does not</u> (in fact, I found it a bit confusing!)
4
+
Identifiers are used in your ZX BASIC program to define _variable names_, _function names_, _subroutine names_ and _[labels](labels.md)_. ZX Basic identifiers **must** start with a letter (a..z / A..Z) followed by an arbitrary number of letters and or digits. Original Sinclair BASIC allows spaces within variable names, but ZX BASIC <u>does not</u> (in fact, I found it a bit confusing!)
5
5
6
-
Some identifiers are **reserved words**. Most of them are either BASIC _statements_ or _functions_. Functions return a value to be used in an _expression_ whilst statements do not.
6
+
Some identifiers are **reserved words**. Most of them are either BASIC _statements_ or _functions_. Functions return a value to be used in an _expression_ whilst statements do not.
7
7
8
8
Note that there are a number of common statements that you may find in ZX BASIC programs that are not technically reserved words, but library functions. Some of the internal libraries form functions that may overlap with your subroutine and function names (such as POS). So while they may not be technically reserved, you should consider the library function names as ones you should avoid. Also, some Sinclair Basic statements are implemented as library functions, so you should be especially aware of identifiers of this type, such as INPUT, POINT and ATTR.
9
9
10
-
## Reserved Identifiers
10
+
## Reserved Identifiers
11
11
12
-
The following identifiers are _reserved words_, and can't be used as variables, functions or labels. Reserved identifiers are _case insensitive_ (it doesn't matter whether you write them in upper or lower case letters, or a mix of them). So **PRINT**, **print** and **PrInT** means all the same in ZX BASIC. On the other hand, non-reserved words can be either case sensitive or not (depending on the [options](options.md)) in effect.
12
+
The following identifiers are _reserved words_, and can't be used as variables, functions or labels. Reserved identifiers are _case insensitive_ (it doesn't matter whether you write them in upper or lower case letters, or a mix of them). So **PRINT**, **print** and **PrInT** means all the same in ZX BASIC. On the other hand, non-reserved words can be either case sensitive or not (depending on the [options](options.md)) in effect.
13
13
14
-
Identifiers shown in bold are taken from the Sinclair BASIC (beware their meaning here might be different, however). Some of them has been marked as _statements_, _functions_ or _operators_:
14
+
Identifiers shown in bold are taken from the Sinclair BASIC (beware their meaning here might be different, however). Some of them has been marked as _statements_, _functions_ or _operators_:
15
15
16
16
***[ABS](abs.md)****(function)**
17
-
***[ACS](acs.md)****(function)**
18
-
***[AND](operators.md#AND)****(operator)**
19
-
*[ALIGN](align.md)**(special)**
20
-
*[ASM](asm.md)**(special)**
21
-
***[ASN](asn.md)****(function)**
22
-
***[AT](at.md)**
23
-
***[ATN](atn.md)****(function)**
17
+
***[ACS](acs.md)****(function)**
18
+
***[AND](operators.md#AND)****(operator)**
19
+
*[ALIGN](align.md)**(special)**
20
+
*[ASM](asm.md)**(special)**
21
+
***[ASN](asn.md)****(function)**
22
+
***[AT](at.md)**
23
+
***[ATN](atn.md)****(function)**
24
24
***[bAND](bitwiselogic.md)****(operator)**
25
25
***[bNOT](bitwiselogic.md)****(operator)**
26
26
***[bOR](bitwiselogic.md)****(operator)**
27
27
***[bXOR](bitwiselogic.md)****(operator)**
28
-
***[BEEP](beep.md)****(statement)**
29
-
*[BOLD](bold.md)
30
-
***[BORDER](border.md)****(statement)**
31
-
***[BRIGHT](bright.md)****(statement)**
32
-
*[ByRef](byref.md)
33
-
*[ByVal](byval.md)
34
-
*[CAST](cast.md)**(function)**
35
-
***[CHR](chr.md)****(function)** (can also be written as **CHR$**)
36
-
***[CIRCLE](circle.md)****(statement)**
37
-
***[CLS](cls.md)****(statement)**
38
-
***[CODE](code.md)****(function)**
39
-
*[CONST](const.md)
40
-
***[CONTINUE](continue.md)****(statement)**
41
-
***[COS](cos.md)****(function)**
28
+
***[BEEP](beep.md)****(statement)**
29
+
*[BOLD](bold.md)
30
+
***[BORDER](border.md)****(statement)**
31
+
***[BRIGHT](bright.md)****(statement)**
32
+
*[ByRef](byref.md)
33
+
*[ByVal](byval.md)
34
+
*[CAST](cast.md)**(function)**
35
+
***[CHR](chr.md)****(function)** (can also be written as **CHR$**)
36
+
***[CIRCLE](circle.md)****(statement)**
37
+
***[CLS](cls.md)****(statement)**
38
+
***[CODE](code.md)****(function)**
39
+
*[CONST](const.md)
40
+
***[CONTINUE](continue.md)****(statement)**
41
+
***[COS](cos.md)****(function)**
42
42
***[DECLARE](declare.md)****<modifier>**
43
-
***[DIM](dim.md)****(statement)**
44
-
*[DO](do.md)**(statement)**
45
-
***[DATA](data.md)****(statement)**
46
-
***[DRAW](draw.md)****(statement)**
47
-
*[ELSE](if.md)
48
-
*[ELSEIF](if.md)
49
-
*[END](end.md)
50
-
*[EXIT](exit.md)**(statement)**
51
-
***[EXP](exp.md)****(function)**
52
-
*[FastCall](fastcall.md)
53
-
***[FLASH](flash.md)****(statement)**
54
-
***[FOR](for.md)****(statement)**
55
-
*[FUNCTION](function.md)
56
-
***[GO TO](goto.md)** or [GOTO](goto.md)**(statement)**
43
+
***[DIM](dim.md)****(statement)**
44
+
*[DO](do.md)**(statement)**
45
+
***[DATA](data.md)****(statement)**
46
+
***[DRAW](draw.md)****(statement)**
47
+
*[ELSE](if.md)
48
+
*[ELSEIF](if.md)
49
+
*[END](end.md)
50
+
*[EXIT](exit.md)**(statement)**
51
+
***[EXP](exp.md)****(function)**
52
+
*[FastCall](fastcall.md)
53
+
***[FLASH](flash.md)****(statement)**
54
+
***[FOR](for.md)****(statement)**
55
+
*[FUNCTION](function.md)
56
+
***[GO TO](goto.md)** or [GOTO](goto.md)**(statement)**
57
57
***[GO SUB](gosub.md)** or [GOSUB](gosub.md)**(statement)**
58
-
***[IF](if.md)****(statement)**
59
-
***[IN](in.md)****(function)**
60
-
***[INK](ink.md)****(statement)**
61
-
***[INKEY](inkey.md)****(function)** (can also be written as **INKEY$**)
58
+
***[IF](if.md)****(statement)**
59
+
***[IN](in.md)****(function)**
60
+
***[INK](ink.md)****(statement)**
61
+
***[INKEY](inkey.md)****(function)** (can also be written as **INKEY$**)
62
62
***[INPUT](input.md)****(function)** (not compatible with ZX BASIC)
0 commit comments