Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete
Message
From
04/08/2008 11:05:46
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Delete
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01336237
Message ID:
01336240
Views:
11
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform