blob: a0ac1f238b2add70f8bc88c11f08f0ec5da89d80 (
plain)
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
|
#include <bu/sio.h>
#include <bu/variant.h>
#include <bu/list.h>
using namespace Bu;
Variant getThing( int i )
{
Variant v;
switch( i )
{
case 0:
v = 45;
break;
case 1:
v = true;
break;
case 2:
v = List<int>(5).append(10).append(15);
break;
}
return v;
}
int main()
{
Variant a;
Variant b;
Variant c;
a = getThing( 0 );
b = getThing( 1 );
c = getThing( 2 );
sio << "a = " << a << " or " << (int)a << sio.nl
<< "b = " << b << " or " << b.toString() << sio.nl
<< "c = " << c << " or " << c.toString() << sio.nl
<< sio.nl;
return 0;
}
|