Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datatoclip with zero records
Message
De
31/03/2006 15:27:57
 
 
À
31/03/2006 15:08:31
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
01108844
Message ID:
01109662
Vues:
28
>>>>I disagree. You only really know you need to code against it because you get an error. It's not like trying to access record 5 in an empty table. You'd know intuitively that would fail. I don't feel that _vfp.datatoclip with an empty table is necessarily the sort of thing you'd code against intuitively.
>>>>
>>>>I agree with Peter and Cetin that it's a bug in the documentation.
>>>
>>>But then I'd rather see the code fixed, not the documentation. The function could simply return empty string for zero records. Wouldn't that be nice?
>>
>>But then you couldn't use TRY/CATCH to process easily. You'd still have to check for "no records" situation for that code to work (unless no records was OK).
>
>You could just test for empty(_cliptext)... well, pretty much the same number of lines as it is now - presently we have to
>
>
if recc()>0
>   _vfp.datatoclip(,,3)
>   && do something with _cliptext here
>endif
>
>and then it'd be
>
>
_vfp.datatoclip(,,3)
>if not empty(_cliptext)
>   && do something with _cliptext here
>endif
TRY
  _VFP.DataToClip(,,3)
CATCH
  MESSAGEBOX("No data")
ENDTRY
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform