Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Here's what caused my C0000005 fatal error, any ideas??
Message
De
26/01/1999 12:18:27
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00180315
Message ID:
00180340
Vues:
21
>>>I set a filter in a report using a macro substitution. When building the filter it can build up to 4 long AND statments depending on the user input. When users selected all 4, it would give the fatal error. It turned out that changing the way I set the filter fixed this issue. It was:
>>>SET FILTER TO IIF(cPrtAlign=.T.,patient.f_precno>0,&lcFilter AND patient.f_precno>0)
>>>
>>>Changed to:
>>>IF cPrtAlign=.T.
>>> SET FILTER TO patient.f_precno>0
>>>ELSE
>>> SET FILTER TO &lcFilter AND patient.f_precno>0
>>>ENDIF
>>>
>>>I no longer get the C0000005 fatal error message. Any ideas why this would be. Do I need to avoid using IIF()? I'm hoping to find out why, although I am somewhat relieved just to have found a workaround. TIA, and YES this did work in my versions prior to VFP6.
>>>Marcus.
>>
>>Your former filter was prone to problems because all variables (if any exists) in literal filter expression will be evaluated when Foxpro will actually scan records and apply the filter to each one. So, if 'cPrtAlign' goes out of scope somewhere it may crash the system.
>
>Thanks, I'll keep an eye out for that one. In this case I do a Scan right after the filter and then reset the filter (SET FILTER TO) right after the scan. The fatal error message is reported to occur on the SCAN statement. I'll avoid using variables in filters as much as possible now, but do you think it was the cuplrit in this case?

Obviously, I cannot say it by sure, but it seems to be the only difference between bad and good case, so it's some indication at least.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform