Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a VFP function to...
Message
De
28/06/2006 11:01:37
 
 
À
28/06/2006 09:35:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01132372
Message ID:
01132429
Vues:
14
I think I found a way to do it by creating a function called OBJTYPE() using TRY...CATCH:

FUNCTION OBJTYPE
LPARAMETERS tcControlSource
LOCAL lnSelect, lcRetVal
lnSelect = SELECT()
lcRetVal = ''
IF VARTYPE(tcControlSource) # 'C' .OR. EMPTY(tcControlSource) .OR. VARTYPE(&tcControlSource) = 'U'
RETURN lcRetVal
ENDIF
TRY
SELECT (tcControlSource)
lcRetVal = 'C'
CATCH
lcRetVal = 'M'
ENDTRY
SELECT (lnSelect)
RETURN lcRetVal


Sorry about the formatting, but I prefaced the code inside the IF statement with four spaces but for some reason they were deleted before the message is sent...

Thanks!
Jim
Time is a wonderful teacher. Unfortunately it kills all of its students.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform