Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing parameters to a class
Message
De
30/10/1998 14:22:54
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
30/10/1998 14:04:47
Noman Aftab
Embry-Riddle Aeronautical University
Daytona Beach, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00152953
Message ID:
00152963
Vues:
19
Hi, Noman (?)
A few thoughts: I assume you are using VFP? You can use EVAL and SEEK() and SELECT (cAlias) now to lessen the need for using macro expansion.

So instead of
>SELECT &cChildTable
you can
SELECT (cChildTable)

If you're getting an error on that line, it might because cChildTable isn't what you expect it to be.

But, what's even cooler is you can do a seek in a work area other than the selected one. So, you could get rid of it all together. Look up SEEK() in the help. The only sneaky thing about it is that you have to put an "=" before it, or just assign it to a variable. I.E.:
lOK = SEEK( eexpression, cChildTable, cIndexTag )
You might also be able to change
>DO WHILE &cChildTable.&cChildField1 = &cParentTable.&cParentField1
to
DO WHILE EVAL(cChildTable+'.'+cChildField1) = EVAL( cParentTable+'.'+cParentField1)
or, even to
SELECT (cChildTable)
LOCAL lcParentKey
lcParentKey = EVAL( cParentTable+'.'+cParentField1)
SCAN FOR mychildtable.fk = lcParentKey
*...etc.
HTH

>I have put in local parameters in INIT, have already defined property for the container to put table and field names and in REFRESH
>
>(cParent....., cChild....., cDesc.. are added properties)
>
>cOriginalTable = THIS.cParentTable
>
>*selects a table
>SELECT &cChildTable
>
>*Looks for wcnumber from wcdet in wcad
>SEEK &cParentTable.&cParentField1
>
>*removes any items in the list
>DO WHILE THIS.cbInfo.LISTCOUNT > 0
> THIS.cbInfo.REMOVEITEM(1)
>ENDDO
>
>*clears the list box
>THIS.cbInfo.Clear
>
>lShowVal = .T.
>
>*fills the list box
>IF FOUND()
>
> DO WHILE &cChildTable.&cChildField1 = &cParentTable.&cParentField1 ....... Continuee
>
>My question is that how will I be able to use the properties in thsi code to work properly as I am getting error .. well the error which I am getting is Unrecgonized error for the line
>
>SELECT &cChildTable
>
>PLEASE help me out THANX!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform