[ver]
	4
[sty]
	
[files]
[charset]
	82
	ANSI (Windows, IBM CP 1252)
[revisions]
	0
[sequence]
	46
	0
	0
	0
	12
	0
	Numbered List
	346
	bullet
	346
	indent bullet
	346
	Note
	346
	indent Note
	346
	tip
	346
	Caution
	346
	indentCaution
	346
	find
	0
	Footnote
	346
	indent Tip
	346
	indent Find
[prn]
	Apple LaserWriter II NTX
[port]
	LPT1:
[lang]
	1
[fldnames]
	Field1
	Field2
	Field3
	Field4
	Field5
	Field6
	Field7
	Field8
[desc]
	File ch04.rtf was converted from Rich Text Format on 4/6/94
	
	
	
	
	802475772
	62
	765649932
	1544
	12
	0
	0
	0
	0
	
	
	
	
	
	
	1
[fopts]
	0
	1
	0
	0
	
	
[lnopts]
	2
	Body Text
	1
[docopts]
	5
	2
[GramStyle]
	
[ParaNum]
	1
[tag]
	Body Text
	2
	[fnt]
		Palatino
		200
		0
		49152
	[algn]
		1
		3
		720
		0
		0
	[spc]
		24
		200
		4
		120
		120
		4
		100
	[brk]
		36
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		0
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		280
		1
		2
		.
		,
		$
	1Body Text
	3
	1
	600
	1
	1200
	1
	3720
	0
[tag]
	Ahead
	3
	[fnt]
		Helvetica
		280
		0
		16385
	[algn]
		1
		1
		0
		0
		0
	[spc]
		40
		300
		4
		360
		120
		4
		100
	[brk]
		80
	[line]
		9
		0
		4
		0
		1
		1
		1
		110
		10
		1
	[spec]
		0
		2
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Body Text
	0
	0
[tag]
	Bhead
	4
	[fnt]
		Helvetica
		240
		0
		16385
	[algn]
		1
		3
		0
		0
		0
	[spc]
		40
		280
		4
		100
		90
		4
		100
	[brk]
		80
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		2
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Body Text
	0
	0
[tag]
	Chead
	5
	[fnt]
		Helvetica
		200
		0
		16385
	[algn]
		1
		3
		720
		0
		0
	[spc]
		40
		240
		4
		80
		0
		4
		100
	[brk]
		80
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		2
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Body Text
	0
	0
[tag]
	Numbered List
	6
	[fnt]
		Palatino
		200
		0
		49152
	[algn]
		1
		3
		744
		336
		336
	[spc]
		40
		240
		4
		0
		80
		4
		100
	[brk]
		0
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		3
		<*:>.
		0
		3
		1
		1
		2
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Numbered List
	0
	0
[tag]
	bullet
	7
	[fnt]
		Palatino
		200
		0
		49152
	[algn]
		1
		3
		720
		300
		300
	[spc]
		40
		240
		4
		80
		80
		4
		100
	[brk]
		0
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		<*1>
		0
		3
		1
		1
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	bulleted list
	0
	0
[tag]
	1st lev para
	8
	[fnt]
		Palatino
		200
		0
		49152
	[algn]
		1
		3
		1080
		0
		0
	[spc]
		40
		240
		4
		0
		80
		4
		100
	[brk]
		4
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		
		0
		1
		1
		1
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	1st lev para
	0
	0
[tag]
	mono
	9
	[fnt]
		Courier
		180
		0
		32769
	[algn]
		1
		3
		720
		0
		0
	[spc]
		24
		220
		4
		120
		120
		4
		100
	[brk]
		36
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		280
		1
		2
		.
		,
		$
	mono
	22
	1
	864
	1
	1209
	1
	1555
	1
	1900
	1
	2246
	1
	2592
	1
	2937
	1
	3283
	1
	3628
	1
	3974
	1
	4320
	1
	4665
	1
	5011
	1
	5356
	1
	5702
	1
	6048
	1
	6393
	1
	6739
	1
	7084
	1
	7430
	1
	7776
	1
	8121
	0
[tag]
	indent bullet
	11
	[fnt]
		Palatino
		200
		0
		49152
	[algn]
		1
		3
		1104
		216
		216
	[spc]
		40
		240
		4
		0
		80
		4
		100
	[brk]
		0
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		<*1>
		0
		3
		1
		1
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	indent bullet
	0
	0
[tag]
	Note
	12
	[fnt]
		Helvetica
		200
		0
		16384
	[algn]
		1
		3
		720
		600
		0
	[spc]
		40
		240
		4
		0
		80
		4
		100
	[brk]
		0
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		Note
		0
		3
		1
		1
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Note
	0
	0
[tag]
	2nd lev para
	0
	[fnt]
		Palatino
		200
		0
		49152
	[algn]
		1
		3
		1320
		0
		0
	[spc]
		40
		240
		4
		0
		80
		4
		100
	[brk]
		4
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		
		0
		1
		1
		1
		2
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	2nd lev para
	0
	0
[tag]
	Table Text
	0
	[fnt]
		Palatino
		180
		0
		49152
	[algn]
		1
		1
		0
		0
		0
	[spc]
		40
		200
		4
		79
		0
		3
		100
	[brk]
		4
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		0
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Table Text
	0
	0
[tag]
	Body Text1
	0
	[fnt]
		Palatino
		200
		0
		49152
	[algn]
		1
		3
		720
		0
		0
	[spc]
		40
		240
		4
		20
		40
		4
		100
	[brk]
		36
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		1
		
		18944
		1
		1
		0
		2
		0
		0
	[nfmt]
		280
		1
		2
		.
		,
		$
	Body Text1
	4
	1
	2390
	1
	2869
	1
	3347
	1
	3826
	0
[tag]
	indent Note
	0
	[fnt]
		Helvetica
		200
		0
		16384
	[algn]
		1
		3
		1080
		600
		0
	[spc]
		40
		240
		4
		0
		80
		4
		100
	[brk]
		0
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		Note
		0
		3
		1
		1
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	indent Note
	0
	0
[tag]
	tip
	0
	[fnt]
		Helvetica
		200
		0
		16384
	[algn]
		1
		3
		720
		480
		0
	[spc]
		40
		240
		4
		0
		80
		4
		100
	[brk]
		4
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		Tip
		0
		3
		1
		1
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	tip
	0
	0
[tag]
	Caution
	0
	[fnt]
		Helvetica
		200
		0
		16384
	[algn]
		1
		3
		720
		900
		0
	[spc]
		40
		240
		4
		0
		80
		4
		100
	[brk]
		4
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		Caution
		0
		3
		1
		1
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Caution
	0
	0
[tag]
	indentCaution
	0
	[fnt]
		Helvetica
		200
		0
		16384
	[algn]
		1
		3
		1080
		900
		0
	[spc]
		40
		240
		4
		0
		80
		4
		100
	[brk]
		4
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		Caution
		0
		3
		1
		1
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	indentCaution
	0
	0
[tag]
	Term
	0
	[fnt]
		Palatino
		200
		0
		49153
	[algn]
		1
		3
		720
		0
		0
	[spc]
		24
		240
		4
		0
		0
		4
		100
	[brk]
		80
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		2
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		280
		1
		2
		.
		,
		$
	Body Text
	0
	0
[tag]
	indent Term
	0
	[fnt]
		Palatino
		200
		0
		49153
	[algn]
		1
		3
		1080
		0
		0
	[spc]
		24
		240
		4
		0
		0
		4
		100
	[brk]
		16
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		2
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		280
		1
		2
		.
		,
		$
	indent Term
	0
	0
[tag]
	find
	0
	[fnt]
		Helvetica
		200
		0
		16384
	[algn]
		1
		3
		720
		1800
		0
	[spc]
		40
		240
		4
		0
		80
		4
		100
	[brk]
		4
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		Finding Out More
		0
		3
		1
		1
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	find
	0
	0
[tag]
	procdure Bhd
	0
	[fnt]
		Helvetica
		220
		0
		16385
	[algn]
		1
		3
		0
		0
		0
	[spc]
		40
		260
		4
		100
		90
		4
		100
	[brk]
		80
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		2
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Numbered List
	0
	0
[tag]
	procdure Chd
	0
	[fnt]
		Helvetica
		200
		0
		16385
	[algn]
		1
		3
		720
		0
		0
	[spc]
		40
		240
		4
		80
		80
		4
		100
	[brk]
		80
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		2
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Numbered List
	0
	0
[tag]
	formula
	0
	[fnt]
		Helvetica
		180
		0
		16384
	[algn]
		1
		3
		1080
		0
		0
	[spc]
		40
		220
		4
		0
		80
		4
		100
	[brk]
		4
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		
		0
		1
		1
		1
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	formula
	0
	0
[tag]
	Table Title
	0
	[fnt]
		Helvetica
		180
		0
		16385
	[algn]
		1
		3
		720
		0
		0
	[spc]
		40
		220
		4
		40
		80
		4
		100
	[brk]
		16
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Table Title
	0
	0
[tag]
	Column Head
	0
	[fnt]
		Palatino
		180
		0
		49154
	[algn]
		1
		3
		0
		0
		0
	[spc]
		40
		220
		4
		0
		0
		3
		100
	[brk]
		4
	[line]
		11
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Column Head
	0
	0
[tag]
	call-out
	0
	[fnt]
		Helvetica
		160
		0
		16384
	[algn]
		1
		3
		0
		0
		0
	[spc]
		40
		180
		4
		0
		0
		1
		100
	[brk]
		0
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	call-out
	0
	0
[tag]
	chap number
	0
	[fnt]
		Helvetica
		720
		0
		16385
	[algn]
		1
		3
		0
		0
		0
	[spc]
		40
		520
		4
		0
		0
		4
		100
	[brk]
		0
	[line]
		17
		1680
		4
		0
		1
		1
		1
		420
		10
		1
	[spec]
		0
		2
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	chap number
	0
	0
[tag]
	Chapter Title
	0
	[fnt]
		Helvetica
		320
		0
		16385
	[algn]
		1
		3
		720
		0
		0
	[spc]
		40
		360
		4
		0
		480
		3
		100
	[brk]
		81
	[line]
		17
		8520
		3
		0
		1
		3
		1
		644
		10
		1
	[spec]
		0
		2
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Body Text
	0
	0
[tag]
	1st Pg Footer
	0
	[fnt]
		Palatino
		180
		0
		49153
	[algn]
		2
		3
		0
		0
		0
	[spc]
		33
		273
		1
		0
		0
		1
		100
	[brk]
		0
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	1st Pg Footer
	0
	0
[tag]
	right footer
	0
	[fnt]
		Palatino
		180
		0
		49153
	[algn]
		4
		1
		0
		0
		0
	[spc]
		33
		216
		1
		60
		0
		3
		100
	[brk]
		32
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	right footer
	1
	3
	8640
	0
[tag]
	left footer
	0
	[fnt]
		Palatino
		180
		0
		49153
	[algn]
		4
		1
		0
		0
		5212
	[spc]
		33
		216
		1
		60
		0
		3
		100
	[brk]
		32
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	left footer
	1
	3
	8640
	0
[tag]
	Footnote
	0
	[fnt]
		Times New Roman
		180
		0
		49152
	[algn]
		1
		3
		0
		244
		0
	[spc]
		40
		2400
		3
		0
		0
		1
		100
	[brk]
		4
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		0
		<*:>
		0
		1
		1
		256
		0
		0
		0
	[nfmt]
		280
		1
		2
		.
		,
		$
	Footnote
	0
	0
[tag]
	Figure Title
	0
	[fnt]
		Helvetica
		180
		0
		16385
	[algn]
		1
		3
		720
		0
		0
	[spc]
		40
		220
		4
		40
		80
		4
		100
	[brk]
		80
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	Body Text
	0
	0
[tag]
	indent Tip
	0
	[fnt]
		Helvetica
		200
		0
		16384
	[algn]
		1
		3
		1080
		480
		0
	[spc]
		40
		240
		4
		0
		80
		4
		100
	[brk]
		4
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		Tip
		18944
		3
		1
		1
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	indent tip
	0
	0
[tag]
	indent Find
	0
	[fnt]
		Helvetica
		200
		0
		16384
	[algn]
		1
		3
		1080
		1800
		0
	[spc]
		40
		240
		4
		0
		80
		4
		100
	[brk]
		4
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		4
		Finding Out More
		18944
		3
		1
		1
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	indent find
	0
	0
[tag]
	copyrt
	0
	[fnt]
		Palatino
		180
		0
		49152
	[algn]
		1
		3
		0
		0
		0
	[spc]
		24
		220
		4
		0
		60
		4
		100
	[brk]
		36
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		1
		
		18944
		1
		1
		0
		2
		0
		0
	[nfmt]
		280
		1
		2
		.
		,
		$
	copyrt
	4
	1
	2390
	1
	2869
	1
	3347
	1
	3826
	1200
[tag]
	seealso
	0
	[fnt]
		Helvetica
		200
		0
		16385
	[algn]
		1
		3
		720
		0
		0
	[spc]
		40
		240
		4
		80
		0
		4
		100
	[brk]
		16
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		2
		
		0
		1
		1
		0
		0
		0
		0
	[nfmt]
		272
		1
		2
		.
		,
		$
	seealso
	0
	0
[tag]
	crossref
	0
	[fnt]
		Palatino
		200
		0
		49152
	[algn]
		1
		3
		720
		0
		0
	[spc]
		40
		240
		4
		0
		0
		4
		100
	[brk]
		36
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		1
		
		18944
		1
		1
		0
		2
		0
		0
	[nfmt]
		280
		1
		2
		.
		,
		$
	crossref
	4
	1
	2390
	1
	2869
	1
	3347
	1
	3826
	0
[tag]
	popref
	0
	[fnt]
		Palatino
		200
		0
		49152
	[algn]
		513
		3
		720
		0
		720
	[spc]
		40
		240
		4
		0
		0
		4
		100
	[brk]
		36
	[line]
		8
		0
		1
		0
		1
		1
		1
		10
		10
		1
	[spec]
		0
		1
		
		18944
		1
		1
		0
		2
		0
		0
	[nfmt]
		280
		1
		2
		.
		,
		$
	popref
	4
	1
	2390
	1
	2869
	1
	3347
	1
	3826
	0
[frm]
	2
	1572932
	1941
	4720
	7984
	6633
	0
	3
	1
	1 0 0 0 0 0 0
	0
	16777215
	5
	0
	0
	720 20992
	[frmlay]
		9040
		6043
		3
		0
		0
		3
		4720
		0
		0
		2
		0
		1
		1
		0
		1
		720
		5040
		0
	[tbl]
		 5 2 0 86 1440 0 5 43 43
		[h]
			 0 240 86 18 0 2 0
			 1 400 86 2 0 1 0
			 2 200 86 2 0 2 0
			 3 400 86 2 0 1 0
			 4 200 86 2 0 2 0
		[e]
		[w]
			 0 1320 120 6 0
			 1 4560 0 2 0
		[e]
		[data]
			 0 0 0 0 0 0 0 1 0 0 0 0
@Column Head@Element

>
			 0 1 0 0 0 0 0 1 0 0 0 0
@Column Head@Description

>
			 1 0 0 0 0 0 0 1 0 0 0 0
<:f><+!>ByVal<-!>

>
			 1 1 0 0 0 0 0 1 0 0 0 0
Optional. A ByVal argument is passed by value. If this is omitted, the argument is passed by reference.

>
			 2 0 0 0 0 0 0 1 0 0 0 0
<+"><:f>arg_name

>
			 2 1 0 0 0 0 0 1 0 0 0 0
<-"><:f>The name of the argument.

>
			 3 0 0 0 0 0 0 1 0 0 0 0
<:f><:f><+!>()<-!> | <+!>List<-!>

>
			 3 1 0 0 0 0 0 1 0 0 0 0
Optional. Parentheses mean the argument is an array. List means the argument is a list.

>
			 4 0 0 0 0 0 0 1 0 0 0 0
<+"><:f>data_type

>
			 4 1 0 0 0 0 0 1 0 0 0 0
<-">Optional. The data type of the argument.

>
		[e]
	[tble]
[lay]
	Standard
	3079
	[rght]
		12960
		10166
		1
		960
		1200
		3
		960
		720
		0
		1
		0
		1
		0
		2
		1
		960
		9446
		5
		1
		720
		1
		1440
		1
		2880
		1
		4320
		1
		5760
	[lft]
		12960
		10166
		1
		720
		1200
		3
		960
		960
		0
		1
		0
		1
		0
		2
		1
		720
		9206
		5
		1
		720
		1
		1440
		1
		2880
		1
		4320
		1
		5760
	[hlft]
	[lyfrm]
		1
		3008
		0
		0
		10166
		960
		0
		1
		3
		1 0 0 0 0 0 0
		0
		0
		1
	[frmlay]
		960
		10166
		1
		720
		180
		3
		480
		960
		0
		1
		0
		1
		1
		0
		1
		720
		9206
		0
	[txt]
@right footer@LotusScript Language Reference	10/03/94

>
	[hrght]
	[lyfrm]
		1
		11200
		0
		0
		10166
		960
		0
		1
		3
		1 0 0 0 0 0 0
		0
		0
		2
	[frmlay]
		960
		10166
		1
		960
		180
		3
		480
		720
		0
		1
		0
		1
		1
		0
		1
		960
		9446
		0
	[txt]
@right footer@10/03/94<:f>	LotusScript Language Reference

>
	[flft]
	[lyfrm]
		1
		5056
		0
		11760
		10166
		12960
		0
		1
		3
		1 0 0 0 0 0 0
		0
		0
		3
	[frmlay]
		12960
		10166
		1
		720
		480
		3
		11940
		960
		0
		1
		0
		1
		1
		0
		1
		720
		9206
		0
	[txt]
@right footer@page <:P10,0,>	Lotus Strictly Private

>
	[frght]
	[lyfrm]
		1
		13248
		0
		11760
		10166
		12960
		0
		1
		3
		1 0 0 0 0 0 0
		0
		0
		4
	[frmlay]
		12960
		10166
		1
		960
		480
		3
		11940
		720
		0
		1
		0
		1
		1
		0
		1
		960
		9446
		0
	[txt]
@right footer@Lotus Strictly Private	page <:P10,0,>

>
[elay]
[l1]
	0
[pg]
	5
	14 0 71 0 0 0 0 240 65535 Standard	65535 0 0	0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
	32 0 43 0 0 0 0 200 65535 Standard	65535 0 0	0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
	45 0 46 0 0 0 0 240 65535 Standard	65535 0 0	0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
	64 45 51 32 1 1 0 220 65535 Standard	65535 0 0	0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
	77 90 27 32 0 0 0 200 65535 Standard	65535 0 0	0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
[edoc]
@Chapter Title@<:#1364,8486><:f>Chapter 4  <**>Functions, Subs, and Properties

@Ahead@<:#410,8486><:f>Defining Functions and Subs<:X8,1;Index "Functions" # "defining"><:X8,1;Index "Subs" # "defining">

@1st Paragraph@<:#200,8486><:f><:f>Functions and subs are named sections of a script that you can invoke by name.

@bullet@<:#240,8486><:f><:f>Use a function to perform an action and return a value

@bullet@<:#240,8486><:f><:f>Use a sub to perform an action without returning a value

@bullet@<:#240,8486><:f><:f><:f><:f>Design<+"> <-">the function or sub to perform a specific task

@bullet@<:#240,8486><:f><:f>Call the function or sub at each point where you want to perform the task

<:#800,8486>To define a function or sub, you must name it and describe the arguments to be passed to it. For a function, you must also define the data type of the function</R>s return value (the value returned by the function). The default data type of a function</R>s 
return value is Variant.

@Chead@<:#240,8486><:f>Example

@mono@<:#2640,8486>'Define the function TestFunc and the sub TestSub<**>FUNCTION TestFunc (X AS INTEGER, Y AS INTEGER) AS INTEGER<**>  TestFunc = X * Y<**>END FUNCTION<**><**>SUB TestSub (X AS INTEGER, Y AS INTEGER)<**>  PRINT X * Y<**>END SUB<**><**>'Call the function TestFu
nc and the sub TestSub<**>PRINT TestFunc(3, 4)   	'Prints 12<**>TestSub 5, 6    
			'Prints 30

<:#400,8486><:f>TestFunc is a function that multiplies its two integer arguments and returns the product. TestSub multiplies its two input integer arguments and prints the product.

@Chead@<:#240,8486><:f><:f><:f>Related topics

@popref@<:#480,8486><:f>Function and Sub Arguments: to declare data types and variable names for arguments to the function or sub

@popref@<:#240,8486><:f>Returning a Value from a Function: to return a value from a function

@popref@<:#240,8486>Passing Arguments: to pass arguments on which the function or sub operates

@Ahead@<:#410,8486><:f>Function and Sub Arguments<:X8,2;Index "Functions" # "arguments to"><:X8,2;Index "Subs" # "arguments to"><:X8,2;Index "Arguments" # "to functions and subs">

@1st Paragraph@<:#400,8486><:f>The arguments you declare for a function or sub define the types of the data you will pass when you call the function or sub.

@Bhead@<:#280,8486>Declaring Arguments

@Chead@<:#240,8486><:f>Syntax

<:#200,8486><:f><[><+!>ByVal<-!>] <+">arg_name<-"> <[> <+!>()<-!> | <+!>List<-!> ] <[><+!>As<-!> 
<+">data_type<-">]

<:#400,8486><:f>The elements of an argument definition in an argument list are described in the following table.

<:t0>

@Chead@<:#240,8486><:f><:f><:f><:f>Example

@mono@<:#220,8486>FUNCTION DeCalc (BYVAL X AS INTEGER, Y() AS STRING, Z$) AS INTEGER

<:#200,8486><:f>The function DeCalc takes three arguments:

@bullet@<:#240,8486><:f><:f>X, an integer that is passed by value

@bullet@<:#240,8486><:f><:f>Y, an array of strings

@bullet@<:#240,8486><:f><:f>Z, a string as declared by the $ suffix character

<:#200,8486><:f>DeCalc returns an integer to the function caller.

<:#400,8486><:f><:f>If <+">data_type<-"> is omitted and <+">arg_name<-"> has a suffix character, the data type of the returned value is determined by the suffix character.

<:#600,8486><:f>If <+">data_type<-"> is omitted and <+">arg_name<-"> does not have a suffix character to declare the return value data type, 
<+">arg_name<-"> is of data type Variant unless a Def<+">type<-"> statement is in effect.

<:#200,8486><:f>Enclose an argument list in parentheses.

<:#200,8486>Separate argument definitions with commas.

<:#200,8486>Declare arguments immediately after the function or sub name.

<:#200,8486>A function or sub can be declared with no arguments.

@Bhead@<:#280,8486><:f>Use of Parentheses Around Arguments<:X8,3;Index "Parentheses" # "around function arguments"><:X8,3;Index "Arguments" # "parentheses around">

@1st Paragraph@<:#400,8486><:f>Whether or not you use parentheses around function and sub arguments depends on how you decide to invoke the function or sub.

@1st Paragraph@<:#400,8486>If you invoke the function or sub with the Call keyword, you must use parentheses around the argument list.<:f>

@mono@<:#1760,8486>FUNCTION Test (arg AS INTEGER)<**>	If arg = 80 Then<**>	  Test = True<**>	Else<**>	  Test = False<**>	END IF<**>END FUNCTION<**>CALL Test (81)	' Returns 0 (False).

<:#400,8486>If you call a function or sub without the Call keyword, you do not need to use parentheses around the argument list.<:f>

@mono@<:#1760,8486>FUNCTION Test (arg AS INTEGER)<**>	If arg = 80 Then<**>	  Test = True<**>	Else<**>	  Test = False<**>	END IF<**>END FUNCTION<**>Test 81			' Returns 0 (False).

@1st Paragraph@<:#600,8486>If you invoke a function or sub that has no arguments, and you use the Call keyword, you do not have to use empty parentheses. This is equivalent to invoking the sub without the Call keyword.

@mono@<:#1100,8486>SUB Test<**>	PRINT "Hello!"<**>END SUB<**>CALL Test				' Prints Hello!<**>Test						' Also prints Hello!

@Chead@<:#240,8486><:f>Related topics

@popref@<:#240,8486><:f>Call Statement: to call a sub or a function

@Bhead@<:#280,8486><:f>Passing Arguments<:X8,4;Index "Value, passing arguments ><:X8,4;Index "Reference, passing arguments by" # "passing"><:f><:X8,4;Index "Arguments" # "passing"><:X8,4;Index "Passing arguments" #>

@1st Paragraph@<:#200,8486><:f>LotusScript provides two ways to pass arguments to functions and subs:

@bullet@<:#240,8486><:f><:f>By reference:  The function operates on the actual variable

@bullet@<:#480,8486><:f><:f>By value:  A copy of the variable is passed, and the function operates on the copy, not on the actual variable

@bullet@<:#240,8486>By default, arguments are passed by reference.

<:#200,8486><:f>Arrays, lists, type instances, and objects must be passed by reference.

<:#200,8486>Constants and expressions must be passed by value.

@Chead@<:#240,8486>Passing by reference

<:#400,8486><:f><:f><:f>A variable passed to a function or sub by reference must match exactly the data type of the argument in the function definition, unless the argument is declared as Variant.

<:#400,8486>A variable passed to a function or sub by reference,<+"> <-">and modified by the function or sub, has the modified value when the function or sub ends.

@Chead@<:#240,8486>Passing by value

@1st Paragraph@<:#200,8486><:f>LotusScript provides two ways to pass a function or sub argument by value:

@bullet@<:#480,8486><:f><:f>By definition. If you always want the function or sub to receive an argument by value, use this method. Use the ByVal keyword in the function or sub definition.

@bullet@<:#480,8486><:f><:f>By call. If you want to control whether an argument is passed by reference or by value at the time when the function or sub is called, use this method

<:#600,8486><:f>A value (not a reference) passed to a function or sub is automatically converted to the data type of the function or sub argument if possible. A Variant argument will accept a value of any build-in data type, list, array, or object.

<:#400,8486><:f>A variable passed to a function or sub by value,<+"> <-">and modified by the function or sub, has the original value when the function or sub ends.

@Chead@<:#240,8486>Example 1

@1st Paragraph@<:#200,8486>This example demonstrates passing an argument by definition:

@mono@<:#880,8486>FUNCTION Func1 (BYVAL X%)<**>  '...<**>END FUNCTION<**>RetVal = Func1(W%)	'W% is passed by value to Func1

@Chead@<:#240,8486><:f>Example 2

@1st Paragraph@<:#400,8486>This example demonstrates passing an argument by call: e<:f>nclose the argument in an extra pair of parentheses.

@mono@<:#1100,8486>FUNCTION Func2 (X%)		'The declaration specifies that X% will be<**>	'...						'passed by reference, unless a call<**>END FUNCTION				'specifies by value<**><**>RetVal = Func2((abc%))	'In this call, abc% is passed by value

@Chead@<:#240,8486>Related topics

@popref@<:#240,8486><:f>Use of Parentheses Around Arguments

@Bhead@<:#280,8486><:f>Arrays and Lists as Arguments<:X8,5;Index "Arguments" # "arrays and lists as"><:X8,5;Index "Arrays" # "as function arguments"><:X8,5;Index "Lists" # "as function arguments">

@1st Paragraph@<:#200,8486><:f>Arrays and lists can be passed as arguments to functions and subs.

<:#1000,8486>To define an array argument, use the name of the array, followed by an optional set of empty parentheses. Do not include dimensions for the array. You can also pass an array as an argument declared as Variant. You can pass a Variant containing an array to a
n argument declared as Variant; however, you can not pass a Variant containing an array to an argument declared as an array.

<:#1000,8486><:f>To define a list argument, use the name of the list, followed by an optional set of empty parentheses, followed by the keyword List. You can also pass a list as an argument declared as Variant. You can pass a Variant containing a list to an argument dec
lared as Variant; however, you can not pass a Variant containing a list to an argument declared as a list. 

@Chead@<:#240,8486>Example

@mono@<:#1980,8486>FUNCTION MyFunc(MyArray() AS INTEGER)<**>  '...<**>END FUNCTION<**>DIM Array1(3,3) AS INTEGER<**>DIM Array2(3,3) AS LONG<**>X = MyFunc(Array1())	'Works fine<**>X = MyFunc(Array2())	'Error, since Array2 is of a different data<**>							'type than the corresp
onding argument<**>							'in the function definition

@Ahead@<:#410,8486><:f>Returning a Value from a Function<:X8,5;Index "Functions" # "returning values from"><:X8,5;Index "Returning values" # "from functions">

@1st Paragraph@<:#400,8486><:f>To return a value from a function, assign a value to the function name within the body of the function definition.

<:#400,8486><:f>To use the return value after a function call, put the function call anywhere in an expression where a value of the type returned by the function is legal.

<:#600,8486><:f>It is not necessary to use the value returned by a function defined by the Function...End Function statement. To call a function without using the return value, use the Call statement.  (The value returned by a built-in function must be used.)

@Chead@<:#240,8486><:f>Example

@mono@<:#2420,8486>FUNCTION IsTen(X AS INTEGER) AS INTEGER<**>  IF X = 10 THEN<**>    IsTen = TRUE<**>  ELSE<**>    IsTen = FALSE<**>  END IF<**>END FUNCTION<**><**>PRINT IsTen(10.4)	'Prints -1 (TRUE)<**>CALL IsTen(11.4)		'Returns 0 (FALSE). The return value is not used<**>		
					'because the function was called with CALL.

<:#800,8486>The function IsTen tests its argument X, and returns the value TRUE (-1) if X equals 10, and FALSE (0) otherwise. The call IsTen(10.4) returns TRUE because the argument 10.4 is rounded to the integer 10 when IsTen is called. In the statement Call IsTen(11.4
), the function returns FALSE.

@Chead@<:#240,8486><:f>Related topics

@popref@<:#240,8486><:f>Call Statement: to call a sub or a function

@popref@<:#240,8486>Function...End Function Statement: to define a function

@Ahead@<:#410,8486><:f>Recursive Functions<:X8,6;Index "Functions" # "recursive"><:X8,6;Index "Recursive functions" #>

@1st Paragraph@<:#400,8486><:f>A user-defined function can call itself. The function is called a recursive function. A call to itself from within the function is called a recursive call.

<:#200,8486><:f><:f>Make sure the definition of a recursive function provides a way to end the recursion.

<:#200,8486>The depth of recursion is limited by available memory.

<:#400,8486><:f>Recursion can always be avoided by an iterative method using a statement such as Do...Loop or For...Next.

<:#400,8486>All of these forms can be used whether the function is the name of a user-defined function or a declared function (a C function).<:f>

@mono@<:#2200,8486>PUBLIC FUNCTION Factorial (N%) AS LONG<**>  IF N% <<= 1 THEN		'Ends the recursive calling chain<**>    Factorial = 1<**>  ELSE<**>    Factorial = N% * Factorial (N% - 1)<**>  END IF<**>END Function<**>PRINT Factorial(2)	'Prints 2<**>PRINT Factorial(3)	'Prin
ts 6<**>PRINT Factorial(5)	'Prints 120

@1st Paragraph@<:#800,8486><:f>When recursively calling a function that has no arguments, you must include empty parentheses if you use the function's return value. The empty parentheses distinguish a function invocation from the variable that contains the return value of the functio
n. For example:

@mono@<+@><:#1540,8486>FUNCTION recurse AS INTEGER<**>'x gets the current value of the "recurse" variable<**>x = recurse  
<**>'x gets the result of a call to recurse<**>x = recurse() <**>...<**>END FUNCTION<:>

@Ahead@<:#410,8486><:f>Calling C Functions in DLLs<:X8,7;Index "C functions" # "calling"><:X8,7;Index "DLLs" # "calling functions from"><:X8,7;Index "DLLs" # "calling functions in"><:X8,7;Index "Dynamic Link Libraries" # "calling functions in"><:X8,7;Index "External C functions" # "calling">

@1st Paragraph@<:#200,8486><:f>LotusScript allows you to call external C-language functions.

<:#600,8486><:f>You implement external C-language functions inside a named library module. Under Windows this is a Dynamic Link Library (DLL). Such a library module generally contains several C-language functions.

<:#400,8486><:f>In order to call C-language functions contained in an external library module from LotusScript, you must use the Declare statement for each function you want to call.

<:#400,8486>To avoid declaring library functions in multiple scripts, use Declare Public statements in a module which remains loaded.

<:#200,8486><:f>All external functions must use the PASCAL calling convention.

<:#800,8486><:f>The data type of a function can be established by explicit data type declaration, by a data type suffix character, or by an applicable Def<+">type<-"> statement. If none of these are in effect, the data type of the return value defaults to Single (a 4-b
yte floating point value), not Variant.

<:#1000,8486>If you</R>re using a 32-bit version of Windows, the names of exported DLL functions are case sensitive; however, LotusScript automatically converts them to uppercase in the Declare statement. To successfully call an exported DLL, use the Alias clause in the
 Declare statement to specify the function name with correct capitalization (LotusScript leaves the alias alone).

<:#400,8486><:f>For example, the statements below declare an exported DLL with an alias (preserving case sensitivity) and then call that function:

@mono@<:#880,8486>DECLARE FUNCTION MyDLL LIB "C:\myxports" _<**>  ALIAS "_MyExportedRoutine" (I1 AS LONG, I2 AS LONG)<**><**>MyDLL(5,10)

@Chead@<:#240,8486><:f>Related topics

@popref@<:#240,8486><:f>C Function Argument Types and Passing Values

@popref@<:#240,8486>Declare (External C Calls) Statement: to declare an external function or subroutine

@popref@<:#240,8486>Passing String Arguments to C Functions

@popref@<:#240,8486>Passing Arguments of Unspecified Data Type to C Functions

@popref@<:#240,8486>Passing Numeric Data Types to C Functions

@popref@<:#240,8486>Passing Types and Classes to C Functions

@popref@<:#240,8486>Passing Arrays to C Functions

@popref@<:#240,8486>Passing NULL Pointers to C Functions

@Bhead@<:#280,8486><:f>C Function Argument Types and Passing Values<:X8,8;Index "C functions" # "argument types"><:X8,8;Index "Arguments" # "to C functions">

@1st Paragraph@<:#400,8486><:f>By default, you pass arguments to C functions by reference. Use the ByVal keyword in the declaration to pass arguments by value.

<:#400,8486><:f>When an argument is passed by reference, the C function receives a 4-byte pointer to the value area.

<:#200,8486>When an argument is passed by value, the C function receives the actual value.

@Bhead@<:#280,8486><:f>Passing String Arguments to C Functions<:X8,8;Index "Strings" # "passing to C functions"><:X8,8;Index "C functions" # "passing strings to">

@1st Paragraph@<:#600,8486><:f>When a string is passed by reference, LotusScript passes a 4-byte pointer to an internal buffer. The C function cannot safely modify the contents of this buffer unless it is written specifically for LotusScript.

<:#800,8486><:f>When a string is passed by value, LotusScript passes a 4-byte pointer to a Null-terminated string. The C function can modify the contents of this string, as long as it doesn</R>t lengthen the string. Any changes to the string will be reflected in the sc
ript variable on return from the function.

<:#800,8486>You can specify the use of non-platform-native characters as arguments and return values using the LMBCS and Unicode keywords. Unicode indicates a Unicode string of two-byte characters (words) using the platform-native byte order. LMBCS indicates a LMBCS op
timization group 1 string (multi-byte characters).

<:#600,8486><:f>For fixed-length strings passed by value, the string is first converted to a Null-terminated string. The C function can modify this string, just as for a normal string. (The string cannot be lengthened.)

@Chead@<:#240,8486><:f><:f>Example

@mono@<:#660,8486>DECLARE SUB BRef LIB "CLib.dll" (strval$)<**>DECLARE SUB BVal LIB "CLib.dll" (BYVAL strval$)<**>DECLARE FUNCTION StrFun "lib.dll" (MyIStr AS LMBCS STRING)

@Bhead@<:#280,8486>Passing Arguments of Unspecified Data Type to C Functions<:X8,9;Index "Unspecified data types" # "passing to C functions"><:X8,9;Index "C functions" # "passing unspecified data types to"><:f><:X8,9;Index "Arrays" # "passing to C functions"><:f><:X8,9;Index "Lists" # "passing to C functions">
<:f><:X8,9;Index "Objects" # "passing to C functions"><:f>

@1st Paragraph@<:#400,8486><:f>You can pass an argument to a C function without specifying its data type by using the keyword Any to suppress type checking.

@bullet@<:#960,8486><:f><:f>For an Any argument passed by value using the ByVal keyword, LotusScript passes the argument in a manner that depends on the actual data type passed; it behaves as if the argument was specified as ByVal of that type (the argument</R>s type doesn</R>
t get checked).

@bullet@<:#480,8486>For an Any argument passed by reference (that is, not using the ByVal keyword), LotusScript passes the argument as a 4-byte pointer (reference) to the value.

@Bhead@<:#280,8486><:f>Passing Numeric Data Types to C Functions<:X8,9;Index "Values" # "passing to C functions"><:X8,9;Index "C functions" # "passing values to"><:f>

@1st Paragraph@<:#600,8486><:f>By default, an argument whose data type is not specified as Any or String is passed by reference as a 4-byte pointer to the value. If an argument is declared ByVal, the value is passed.

@Chead@<:#240,8486><:f>Example

@mono@<:#1320,8486>DECLARE SUB SemiCopy LIB "mylib.dll" _<**>  (ValPtr AS INTEGER, BYVAL MyVal AS INTEGER)<**>DIM Val1 AS INTEGER, Val2 AS INTEGER<**>Val1 = 1<**>Val2 = 2<**>SemiCopy Val1, Val2

<:#1200,8486><:f>The C function receives a four-byte pointer to a two-byte integer containing the value of Val1, and a two-byte integer containing the value of Val2. Since Val1 is passed by reference, the C function can dereference the four-byte pointer and assign a dif
ferent two-byte integer to that location. When control returns to LotusScript, Val1 contains the modified value. Since Val2 was passed by value, any changes made by the C function are not reflected in Val2 after the function call.

@Bhead@<:#280,8486><:f>Passing Types and Classes to C Functions<:X8,9;Index "Classes" # "passing to C functions"><:X8,9;Index "Types" # "passing to C functions"><:X8,9;Index "C functions" # "passing types and classes to">

@1st Paragraph@<:#1000,8486><:f>Some C functions can require a data structure as a parameter. An example is the Windows API function GetBrushOrgEx, which requires a pointer to a point structure. You can define a suitable type, such as Point, and use that type definition to declare the
 C function. Type variables are always passed by reference, so the C function receives a four-byte pointer to the storage for the type.

@Chead@<:#240,8486><:f>Example

@mono@<:#1980,8486>TYPE Point<**>  X AS INTEGER<**>  Y AS INTEGER<**>END TYPE<**><**>DECLARE FUNCTION GetBrushOrgEx(BYVAL hDC AS INTEGER, Pt AS Point)<**>DIM P AS POINT<**>'...<**>GetBrushOrgEx(hDC,P)

<:#800,8486><:f>Instances of user-defined classes can also be passed by reference to C functions. However, some items such as product classes, other objects, lists, and dynamic arrays are assigned to objects as pointers to internal structures. It is inadvisable to pass
 classes with such elements to a C function.

@Bhead@<:#280,8486><:f>Passing Arrays to C Functions<:X8,10;Index "Arrays" # "passing to C functions"><:f><:f,,><:X8,10;Index "C functions" # "passing arrays to">

@1st Paragraph@<:#800,8486><:f>You can pass arrays by reference only to C functions that are specifically written for LotusScript. However, some C functions require an array, such as the Windows API call SetBitmapBits. You can still pass the array by passing the first element by refe
rence (with the Any keyword).

@Chead@<:#240,8486><:f>Example

@mono@<:#880,8486>DECLARE SUB SetBitmapBits _<**>  (BYVAL hBM AS INTEGER, BYVAL cBytes AS LONG, pBits AS ANY)<**>  '...<**>SetBitmapBits(hBitmap, cBytesInArray, BitArray(0))

@Bhead@<:#280,8486><:f>Passing NULL Pointers to C Functions<:X8,10;Index "NULL pointers" # "passing to C functions"><:X8,10;Index "C functions" # "passing NULL pointers to">

@1st Paragraph@<:#400,8486><:f>You can use ByVal 0& as an argument to specify a null pointer to a C function expecting a null pointer.

@Ahead@<:#410,8486><:f>Properties<:X8,10;Index "Properties" #>

<:#400,8486><:f>A property is a named pair of subprograms that can be used as if they were a single variable. It combines the features of a variable with the features of subprograms:

@bullet@<:#480,8486><:f><:f>Like a variable, a property can be used in a statement or expression to set or get a single value.

@bullet@<:#480,8486><:f><:f>Like a subprogram, a property can perform other activities besides returning or changing a single value.

<:#600,8486><:f>Properties are a syntactic convenience. If your script uses a property, you can write an equivalent script that doesn</R>t. But the script that uses a property is easier to read than its equivalent without a property.

<:#200,8486><:f>Consider the following example:

@mono@<:#1540,8486><:f>SUB SetSubDir(todir AS STRING)<**>  CHDIR "C:\WORK\" + todir		'Set the current directory on C:<**>END SUB<**>FUNCTION GetSubDir<**>  GetSubDir = MID$(CURDIR$, 9, 255)	'Chop off "C:\WORK\",<**>									'leaving the subdirectory name<**>END FUNCTION

<:#400,8486><:f>The sub SetSubDir and the function GetSubDir together let you work in any subdirectory of C:\WORK:

@mono@<:#1320,8486>X$ = GetSubDir()			'Remember the current<**>								'subdirectory<**>SetSubDir "123"			'Change to the 123 subdirectory<**>								'Work with 123 files...<**>SetSubDir X$				'Go back to the original<**>								'subdirectory

<:#400,8486>SetSubDir and GetSubDir can be re-implemented as the property SubDir. The Property Set and  Property Get subprograms that define SubDir look like this:

@mono@<:#880,8486><:f>PROPERTY SET SubDir AS STRING<**>  CHDIR "C:\WORK\" + SubDir			'Append SubDir contents to<**>												'"C:\WORK\"<**>END PROPERTY

@mono@<:#660,8486><**>PROPERTY GET SubDir AS STRING<**>  SubDir = MID$(CURDIR$, 9, 255)		'Chop off "C:\WORK\"<**>END PROPERTY

<:#200,8486>Then the example above, re-written to use the property, looks like this:

@mono@<:#1540,8486>X$ = SubDir		'Remember the current subdirectory<**>						'(this calls PROPERTY GET SubDir)<**>SubDir = "123"	'Change to the 123 subdirectory<**>						'Work with 123 files...<**>SubDir = X$		'Go back to the original<**>						'subdirectory<**>						'(this cal
ls PROPERTY SET SubDir)

<:#400,8486>The property version is easier to read and understand. Its effect is the same as the version using the pair of subprograms SetSubDir and GetSubDir.

<:#600,8486><:f>The example also illustrates that when the name of a property is on the left side of an assignment or Set statement, the Property Set subprogram is called. In all other contexts, the Property Get subprogram is called.

<:#1000,8486><:f>Properties are especially useful inside class definitions, where the act of changing an attribute of an object can require a script to be called. For example, suppose that Square has been defined as a class representing squares drawn on your display; an
d that one property of an object of the class Square is the drawn color of the square. Consider the following:

@mono@<:#1540,8486>DIM X AS Square			'The variable X will refer to a square<**>SET X = NEW Square(10)	'Draws a square on the screen<**>								'and sets X to refer to that square<**>OldColor = X.Color		'Color is a property of squares 
<**>								'Remember the current color<**>X.Color = "RED"			'Actually changes the color of X as drawn<**>X.Color = OldColor		'Changes X's color back to its original

<:#800,8486>The property Color looks like a simple member variable of the class Square. However, since it is a property, changing its value causes the Property Set for Square to be called. The Property Set subprogram can do whatever is necessary to actually change the 
color of the square on the screen.

@Chead@<:#240,8486><:f>Related topics

@popref@<:#240,8486><:f>Class...End Class Statement: to define a class

@popref@<:#240,8486>Property Get/Set...End Property Statements: to define a property<:f> 

>

[Embedded]
00043859
