Really? I just typed "? VARTYPE(xyz)" into the command window and it returned "U".
>>In VFP 6, you can use the VARTYPE() function. It will return "O" for an object, and "X" for a .NULL. value.
>
>If the variable doesn't exist, VATYPE() smokes with a Variable "whatever" not found, so if the variable might not exist, or might be out of scope, TYPE() is still preferable.
>
>>
>>>Walter,
>>>
>>>I'm not sure you see the point:
>>>
>>>create cursor temp ( iID i, cFirstName c(40))
>>>insert into temp values ( 0, "Walter" )
>>>scatter name oRow
>>>
>>>? type( "oRow.Name" ) && U
>>>? type( "oRow.cFirstName" ) && C
>>>? type( "oRow" ) && O
>>>
>>>oRwo is indeed an object, it has no .Name property to test
>>>
>>>FWIW my IsObject() udf is:
>>>
>>>lparameter roObject
>>>
>>>return( ( type( "m.roObject" ) == 'O' ) and ( ! isnull( m.roObject ) ) )
>>>
>>>
>>>>Sure, but then you would use something like TYPE("Table.fields")=cType
>>>>I was only purposing anotherway for
>>>>
>>>>lExist=TYPE("oObject") AND !ISNULL(oObject)
>>>>
>>>>to determine if a object exists.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only