Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete
Message
De
04/08/2008 11:05:46
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Delete
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01336237
Message ID:
01336240
Vues:
12
>SELECT PGREEMBOLSO
> GOTO 1
> aa = RECNO()
> if ("ME") $ pgReembolso.valor
> DELETE FOR RECNO() = aa
>= MESSAGEBOX("deleted")
>brow
> endif
>
>the message box confirms deletion but in browse the record is still there

The program logic is somewhat confusing. What do you want to do?

To delete all records that satisfy a certain condition, you don't need to GO TOP first. Also, after giving the DELETE command, check the value of _tally, to see how many records really were deleted. It is possible that no record satisfies a certain condition.

On the other hand, to delete the currently selected record, just give the command "DELETE" - no FOR is required if the record is already selected.

In your case, perhaps record #1 was already 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