Information générale
Catégorie:
Codage, syntaxe et commandes
Bob,
There was a thread on VARTYPE() in combination with objects a few months back.
You will get the expected result as long as the object actually exists, but you will get an error reported if it does not. At least that's how I remember it as going.
I believe the the upshot of the thing was to steer clear of VARTYPE where objects may be concerned.
Cheers,
Jim N
>>>if vartype(thisform.command1) == "O"
>>>** object exists
>>endif
>>
>>I thought so too, until yesterday I ran some code that looked like this:
>>
>>IF VARTYPE(Thisform) = T_OBJECT AND Thisform.lSomething
>>
>>VFP gave me a Thisform is not an object error. Supposedly VFP doesn't evaluate
>Curious.. did you suspend at this line and put...
>
>vartype(thisform)
>
>Into the watch window to see what it evaluated to?
>
>BOb
>
>PS: Asking cause I use the above extensivly, and so far no problems. But I usually use excataly equal ( == )
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement