Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
_Screen and ActiveForm and SYS(1272)
Message
 
À
10/05/2001 11:48:31
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00505800
Message ID:
00505877
Vues:
17
>>>I'm using SYS(1272) to return a reference to the current page in a pageframe. Then I store this in an array and try to use it to return to the last page (before the new current one). The problem I seem to be having is that SYS(1272) is returning "Form1.PageFrameA.PageA3" and any code I try when evaluating says that Form1 doesn't exist. Using "_Screen.Form1" or "_Screen.ActivePage" doesn't work either. If I check the Parent in the debugger it doesn't exist. I could do something pathetic like strip off the "Form1" from the returned string, but I just can't bring myself to do it yet. Can anyone give me some insight into working with hiarchy at these levels? Thanks!
>>>
>>>Regards, Renoir
>>
>>Renoir,
>>sys(1272) always starts hierarchy with formName. If formname and scx name was same it would work for the 'first' instance of that form. But there what you need to have 'thisform', right ? So just stuff() it there :
>>lcObject = sys(1272)
>>lcRef = stuff(lcObject, 1, at('.',lcObject), 'thisform.')
>>
>>with eval(lcRef)
>>...
>>
>>Cetin
>
>Ahhhh... I didn't understand about the form name and scx being different and how it would affect the hierarchy. It worked fine...Thanks!
>
>Renoir

And here is my GETHIERARCHY routine which also deals with formset issue.
cHierarchy = GETHIERARCHY(sys(1272, loObject))
* GetHierarchy (function or method)
LPARAMETER tcHierarchy
LOCAL lcReturn, lnParents, lcParents, lcFirstObject
*Check for the formset presence
lnParents = OCCURS(".", SYS(1272, this) )
lcParents = REPLICATE(".PARENT", lnParents )
lcFirstObject = "this" + lcParents && We use THIS to get the first object in hierarchy as it might be the Formset
IF !EMPTY(lcFirstObject)
	loFirstObject = EVAL(lcFirstObject) && refer to it not by name, but by parents sequence.
	IF UPPER(loFirstObject.BASECLASS) = "FORMSET"
		tcHierarchy = STRTRAN(tcHierarchy, LOWER(loFirstObject.NAME) + ".", "") && get rid of formset name
	ENDIF
	loFirstObject = .NULL.
ENDIF
*end formset check
lcReturn = STRTRAN(tcHierarchy, LOWER(THISFORM.NAME) + ".", "thisform.")
RETURN lcReturn && like "thisform.pageframe1.page1.container1.text1"
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform