summaryrefslogtreecommitdiffstats
path: root/test/cbot/scenarios/pointer.txt
blob: 2d4d907ac646d9693115f18455da0e671e3c84df (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
extern public void x ()
{
	show ( 3 ** 4 );
	float z = 1e-3;
	show ( z );

	CPoint b ( 4,5 );
	show ( b );

	CPoint a ( ) ;
	a.x = 21;  a.y = 12;
	show ( a ) ;

	CPoint	test = new CPoint ( 1,1 );
	test = new CPoint ( 2, 2 );
	show ( test );
}

// cr�e un objet et retourne son pointeur
CPoint newcpoint()
{
	CPoint p = new CPoint ( 3, 3 );
	return p;
}

extern public void y ()
{
	CPoint test = newcpoint();
	println ( test );
	dontmodif( test );
	println ( test );
}

// ne doit pas modifier l'objet en param�tre
void dontmodif ( CPoint pp )
{
	pp.x = 5;
	pp.y = 2;
	println ( pp, pp.x, pp.y );
}