VFP7 Code that should crash but doesn't?  
Author Message
jimgazz





PostPosted: Wed Dec 15 04:33:12 CST 2004 Top

Exchange Servers >> VFP7 Code that should crash but doesn't?

I have a program that has code that looks like it should crash but doesn't on
my pc where it does on another pc. The code looks something like this:

******************************
SELECT redecor
SCAN FOR redecnext>DATE()
IF !USED(ALLTRIM(rec_type)) &&rec_type contains parent file name
SELECT 0
USE (fp_ldata+ALLTRIM(redecor.rec_type))
endif
SELECT (ALLTRIM(redecor.rec_type))
lcidfield=ALLTRIM(LEFT(redecor.rec_type,7))+"_ID"
LOCATE FOR &lcidfield=redecor.parent_id
IF !FOUND()
*parent record not found - just ignore it
LOOP
ENDIF
*ignore redecors attached to non current records
IF redecor.rec_type="LHOLD" AND !verified
LOOP
ENDIF
etc
etc
SELECT redecor
ENDSCAN
**********************************

Why do the LOOPs not crash on my machine? When I trace the code on my pc,
the alias automatically changes to Redecor after the loop even though it was
sitting on the parent alias before the loop. Is there a VFP setting that
causes this do work on my pc and not others? I know the code should have a
Select Redecor before the loop but it would be interesting to know why it
doesn't crash consistently.

Thanks for any help.

Bernie

Exchange Server8  
 
 
Andrew





PostPosted: Wed Dec 15 04:33:12 CST 2004 Top

Exchange Servers >> VFP7 Code that should crash but doesn't?

> Why do the LOOPs not crash on my machine? When I trace the code on
> my pc, the alias automatically changes to Redecor after the loop even
> though it was sitting on the parent alias before the loop. Is there
> a VFP setting that causes this do work on my pc and not others? I
> know the code should have a Select Redecor before the loop but it
> would be interesting to know why it doesn't crash consistently.
>
> Thanks for any help.

At least as far back as FPW2.6, each iteration of a SCAN loop implicitly
selects the work area of the table you began scanning.

The question is why does it crash on the other PCs?

--
Regards
Andrew Howell