Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you handle run-time errors
Message
 
 
À
15/03/2006 10:36:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01104502
Message ID:
01104518
Vues:
18
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform