Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Prevent error on type mismatch
Message
De
11/03/2011 18:31:08
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
 
À
11/03/2011 16:47:16
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01503417
Message ID:
01503429
Vues:
40
>>In the following command (fln refers to file name)
>>
>>if fln = " " 
>>fln = "Temp"
>>endif
>>
>>
>>i get this error message
>>
>>Operator/operand type mismatch
>>
>>I cannot find the point in my programming at which this variable becomes a numeric reference - but nonetheless Is there a command line i can run immediately before to check if fln is text variable, if not then change it to a text variable before the error message comes up.
>
>The EMPTY() function can be useful for something like this:
>
>IF EMPTY( fln )
>  fln = "Temp"
>
>ENDIF
>
Unless fln is null. empty() always is .t. on a null value.

UPDATE. My mistake. I meant empty() always = .f.

>I can't remember if the VFP debugger supports conditional breakpoints i.e. you can set it to break when EMPTY( fln ) = .T.. Then your code will stop at the point that happens, which can make it easier to find the source of the problem.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform