Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting if a parameter has been passed
Message
De
10/12/1997 11:52:06
Jay Shepherd
Construction DataFax, Inc.
Montevallo, Alabama, États-Unis
 
 
À
10/12/1997 11:47:10
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00065022
Message ID:
00065027
Vues:
66
>I thought I had the correct syntax to detect if a parameter has been passed.
>
>I have the following method which accept a parameter and I would like to know if the parameter was passed.
>
>Sub Cleanup(Optional tnError As Integer)
>
>' If we pass a parameter
>If VarType(tnError) = 2 Then
> lnLastError = tnError
>End If
>
>But, this is not working because even if the tnError is not passed, the type is still integer.

Couple things:

1) Use the IsMissing() function in VB.
2) Using IsMissing requries that your parameter be a variant.
Jay Shepherd
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform