Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Browse and 'Variable is not found'
Message
From
22/11/2004 03:39:07
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00962939
Message ID:
00963412
Views:
8
>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'
Workaround, force VFP to use a expressions:
...
calcfield = (somefunc( effe1 ))
....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform