Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Browse and 'Variable is not found'
Message
From
19/11/2004 07:44:10
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Browse and 'Variable is not found'
Miscellaneous
Thread ID:
00962939
Message ID:
00962939
Views:
40
Hi All,

I'm sure I have found a bug in the BROWSE command. It exists since long. I'm not sure about vfp9. Can other confirm it?
create cursor c_effe ( effe1 i, effe2 c(10) )

insert into c_effe values ( 1234, 'hoihoi' )

*	This browse will crash immediately: 'Variable is not found'
browse fields ;
	calcfield = somefunc( effe1 )

*	This browse will crash when clicking on the second column: 'Variable is not found'
*	Also note that tabbing will not select the second column.
*browse fields ;
	effe1, ;
	calcfield = somefunc( effe1 ), ;
	effe2

*	This browse too will crash when clicking on the second column: 'Variable is not found'
*browse fields ;
	effe1, ;
	calcfield = somefunc( effe1 ) :P='999,999,999', ;
	effe2

*	This browse will not crash.
*browse fields ;
	effe1, ;
	calcfield = transform( somefunc( effe1 ), '999,999,999' ), ;
	effe2

*	This browse will also not crash.
*	Somefunc2() handles a character type field.
*browse fields ;
	effe1, ;
	calcfield = transform( somefunc( effe1 ), '999,999,999' ), ;
	calcfield2 = somefunc2( effe2 ), ;
	effe2

*	But this browse will crash. The only difference with the previous line 
*	is that somefunc2() now receives a numerical value.
*browse fields ;
	effe1, ;
	calcfield = transform( somefunc( effe1 ), '999,999,999' ), ;
	calcfield2 = somefunc2( effe1 ), ;
	effe2

*	This browse will not crash.
*	Once more, the transform() appears to have a beneficial effect.
*browse fields ;
	effe1, ;
	calcfield = transform( somefunc( effe1 ), '999,999,999' ), ;
	calcfield2 = transform( somefunc2( effe1 ) ), ;
	effe2

return


function somefunc( tnValue )
	RETURN tnValue * 2
	
function somefunc2( tnValue )
	RETURN 'hoihoi'
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Next
Reply
Map
View

Click here to load this message in the networking platform