Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you handle run-time errors
Message
 
 
To
15/03/2006 10:36:35
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01104502
Message ID:
01104518
Views:
16
>>I'd like to incorporate gathering local vars and local parameters in each procedure.
>
>DISPLAY MEMORY simply does it ;-)
>

I don't think so. I have these two procedures in our common utility, but it didn't return useful info. I believe it was not returning parameters in the procedure what caused the error.
FUNCTION GetLocalVars()
LOCAL lcVars
DISPLAY MEMORY LIKE l* TO FILE 'Variables.txt' NOCONSOLE && assuming the local vars always start with l
lcVars = FILETOSTR('Variables.txt')
ERASE ('Variables.txt')
IF NOT 'foxtools.fll' $ LOWER(SET('library'))
	SET LIBRARY TO foxtools.fll additive
ENDIF
lcVars = reduce(m.lcVars)	
RETURN m.lcVars
ENDFUNC

************************************************************
*  FUNCTION GetParameters()
************************************************************
*  Author............: VCS  Developers Team               
*  Project...........: Visual Collections System          
*  Created...........: 03/08/2006  23:50:53
*  Copyright.........: (c) Jzanus, 2006
*) Description.......: Returns string with all parameters (vars starting with t)
*  Calling Samples...: 
*  Parameter List....: 
*  Major change list.: 
FUNCTION GetParameters()
LOCAL lcVars
DISPLAY MEMORY LIKE t* TO FILE 'Variables.txt' NOCONSOLE
lcVars = FILETOSTR('Variables.txt')
ERASE ('Variables.txt')
IF NOT 'foxtools.fll' $ LOWER(SET('library'))
	SET LIBRARY TO foxtools.fll additive
ENDIF
lcVars = reduce(m.lcVars)	
RETURN m.lcVars
ENDFUNC
>There is also an ability to gather property values for all objects with DISPLAY OBJECTS but I decided not to use it because it produces very large output (mostly not useful) and can cause errors when reading properties with access methods.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform