Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
#Define oddity
Message
From
12/12/2004 10:42:49
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
#Define oddity
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00968604
Message ID:
00968604
Views:
42
hi,

Anyone can reproduce / explain the code below ?
=DefineTest()

*---------------------------------------------
function DefineTest()

	local a
	*------------------------------------------	
	&& this will create variable aa and it should not
	release aa
	#define	ALINEDEFINED	aa = aa
	
	a=1
	
	#define aa	a
	
	ALINEDEFINED
	
	#undefine ALINEDEFINED
	#undefine aa
	
	?vartype(aa), 'should be U', '  Error'
	?aa
	
	*------------------------------------------	
	
	&& this will not create variable aa
	release aa
	#define	ALINEDEFINED	m.aa = m.aa
	
	a=1
	#define aa	a

	ALINEDEFINED
	#undefine ALINEDEFINED
	#undefine aa
	
	?vartype(aa), 'should be U', ' OK'
	
endfunc
*---------------------------------------------------------------------------
Gregory
Next
Reply
Map
View

Click here to load this message in the networking platform