Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert into dbf()
Message
De
07/08/2001 14:27:27
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00540471
Message ID:
00540855
Vues:
28
I notice that the excerpt says "(that is, in the work area whose rules are being checked)". This is not in my 5.0a help file.

Does that mean that if I open the table in a different work area with a different alias and insert a record into the other alias there isn't an error generated in VFP 7 ?

In 5.0a this code still produces the "illegal recursion in rule evaluation" error. The VFP 7 help seems to imply that it would not produce an error.
Procedure SomeTable_Valid()
if Some_Test
    ***** Some_Test is .f. in a new record
    *****   prevents the new record from inserting another record.
    use SomeTable in 0 again alias 'Temp'
    insert into Temp ......
    use in Temp
endif
>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?
Bill Morris
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform