Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programatically find Return within WITH / ENDWITH
Message
From
23/06/2008 23:54:53
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
23/06/2008 23:40:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01326207
Message ID:
01326254
Views:
14
>Dragan --
>
>Your approach made me wonder why I couldn't do the same thing using Code References -- but without the need to analyze all code in .PRG files and the like. (Fairly sure I could do it if needed, also fairly sure it would take me a while.)
>
>Instead, I've been working on a solution that looks more or less like:
>
>(1) Using Code References to find all lines containing WITH, ENDWITH and RETURN
>(2) Export to a DBF
>(3) Analyze the results with a single pass through the file (essentially mimicking your sample code).
>
>This seems to work fairly well (so far).
>
>I've noted that
>(1) I only search for WITH, ENDW and RETU, since these abbrevations are allowed. I avoid them, but that's not true for all code I've gotten from other places.
>(2) There's some possibility for "false negatives", as I have lines that begin with a difference usage of WITH:
 Replace all SomeField;
>with SomeValue
Again, not the way I would write code now, but I must have done so in the past.
That's easy - check for continuation lines like this:

skip while right(alltrim(line),1)=";"

Of course, that's for the original "all code in a dbf" approach, not the "take code ref's output" approach. But code references can help you know which pieces of code to look for.

>I've actually found 137 possible problems that I must investigate; most look like real problems that will need to be corrected.

Doesn't even your own code look quite different when you start treating it like data :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform