Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New way
Message
De
27/11/2004 14:20:47
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
27/11/2004 13:56:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00965120
Message ID:
00965126
Vues:
11
I don't see any specific command that I would suspect is incompatible in VFP 5. But there are some things that might be improved; let's say, some inefficiencies.

For example, in the first, loop, after IF FOUND():

There is no need to run the loop, and not even to check IF FOUND() if you set the filter anyway. You can even omit the filter, and combine it with the DELETE statement.

Oh, and one more thing, don't use SELECT 1, better use SELECT 0 to make sure that VFP selects an empty work area.

Thus, this entire block:

>
>select 1
>*  USE MSTR EXCL
>  use mstr
>   LOCATE FOR BILLNO=THISFORM.TEXT1.VALUE  .AND. DATEIN=THISFORM.TEXT2.VALUE
>
>IF FOUND()
> DO WHILE .T. .AND. !EOF()
>  SET FILTER TO BILLNO=THISFORM.TEXT1.VALUE   .AND.     DATEIN=THISFORM.TEXT2.VALUE
> DELETE all
> *PACK
>* SKIP
> GO TOP
> IF EOF()
>   EXIT
> ENDIF
>
>ENDDO
>ENDIF
can be replaced with:
select 1
use mstr
delete for BILLNO=THISFORM.TEXT1.VALUE  .AND. DATEIN=THISFORM.TEXT2.VALUE
If no records match the criteria, simply, no records will be deleted.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform