Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert into dbf()
Message
 
 
À
06/08/2001 19:49:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00540471
Message ID:
00540491
Vues:
24
It didn't change in VFP 7 and below is the reason why you shouldn't do it.

There is excerpt from VFP 7 help Record-Level Rule Checking:
"Caution Do not include any commands or functions in your validation rules that attempt to move the record pointer in the current work area (that is, in the work area whose rules are being checked). Including commands or functions such as SEEK, LOCATE, SKIP, APPEND, APPEND BLANK, INSERT, or AVERAGE, COUNT, BROWSE, and REPLACE FOR in validation rules may cause them to trigger recursively, creating an error condition".


>I'm using VFP 5.0a
>I'm looking to insert a record into a table from the validation rule of the same table.
>
>
Procedure SomeTable_Valid()
>if Some_Test
>    insert into SomeTable .......
>endif
>
>I've discovered that this will generate an error "illegal recursion ....", but it still inserts the new record and executes SomeTable_Valid() on the new record.
>
>My question:
>Is there any reason to believe that this action will change in future versions? IOW: Does any one know of any reason why I can't put in a test to trap for this particular error and ignore it?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform