-
-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathbyte.xml
More file actions
executable file
·71 lines (47 loc) · 1.59 KB
/
byte.xml
File metadata and controls
executable file
·71 lines (47 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>byte</name>
<category>Data</category>
<subcategory>Primitive</subcategory>
<usage>Web & Application</usage>
<example>
<image></image>
<code><![CDATA[
// Declare variable 'a' of type byte
byte a;
// Assign 23 to 'a'
a = 23;
// Declare variable 'b' and assign it the value -128
byte b = -128;
// Declare variable 'c' and assign it the sum of 'a' and 'b'.
// By default, when two bytes are added, they are converted
// to an integer. To keep the answer as a byte, cast them
// to a byte with the byte() conversion function
byte c = byte(a + b);
]]></code>
</example>
<description><![CDATA[
Datatype for bytes, 8 bits of information storing numerical values from 127 to -128. Bytes are a convenient datatype for sending information to and from the serial port and for representing letters in a simpler format than the <b>char</b> datatype. The first time a variable is written, it must be declared with a statement expressing its datatype. Subsequent uses of this variable must not reference the datatype because Processing will think the variable is being declared again.
]]></description>
<syntax>
byte <c>var</c>
byte <c>var</c> = <c>value</c>
</syntax>
<parameter>
<label>var</label>
<description><![CDATA[variable name referencing the value]]></description>
</parameter>
<parameter>
<label>value</label>
<description><![CDATA[a number between 127 to -128]]></description>
</parameter>
<returns></returns>
<related>
int
float
boolean
</related>
<availability>1.0</availability>
<type>Datatype</type>
<partof>PDE</partof>
</root>