Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
1001 Things, xFrmMgr class, how do I use the parameters?
Message
From
21/11/2002 12:56:55
 
 
To
21/11/2002 12:07:38
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00724352
Message ID:
00725347
Views:
17
This message has been marked as the solution to the initial question of the thread.
Margaret,

They are creating a parameter object, and assigning the parameters to that object, with this code snippet from 10.4.3:
*   Code segments from 1001 Things, used without permission
*** Create the Parameter Object
oParams = NEWOBJECT( "xParam", "genclass.vcx" )
WITH oParams
*** First the Instance Name
    .AddProperty( 'cInsName', lcFmName )
    *** Add a property count 
    .AddProperty( 'nParamCount', lnFormParams )
    *** Add any additional parameters to be passed to the form
    IF lnFormParams > 0
        FOR lnCnt = 1 TO lnFormParams
            lcPName = "tuParm" + ALLTRIM(STR(lnCnt))
            .AddProperty( lcPName, &lcPName )
        NEXT
    ENDIF
ENDWITH
From 10.4.1, I think this is the init() of the form itself (not the form class)...the parameters are retreived from toParams.tuParm1, 2, etc:
LPARAMETERS toParams
    *** Extract Instance name from the parameter object
    IF VARTYPE( toParams ) = 'O' AND PEMSTATUS( toParams, 'cInsName', 5 )
         *** Pass Instance Name up to parent class method
         DODEFAULT( toParams.cInsName )

         IF toParams.nParamCount > 0

              thisform.property1 = toParams.tuParm1     && grab parameters here...
              thisform.property2 = toParams.tuParm2
           

              *** Extract additional parameters named as "tuParm1" through "tuParmn"

         ENDIF
    ELSE

        *** No Instance Name specified
        *** Take whatever action is appropriate at the time

   ENDIF

   *** Do whatever else is needed here
Is that what you are looking for?

>The parent class is already using the lparameters and seeding form objects with values from the parameters. At the same time it is reporting itself to the project's global form manager. What I can't seem to determine is where the class is storing the parameters tuparm1, tuparm2 and tuparm3 that are passed in to the form. These are what I am trying to get to once the form object exists.
>
>So this question is not about forms in general but very specifically how the xFrmStdManaged class functions. I was hoping that someone had also taken this class from the book and used it in a project and would have this information.
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform