Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Global variable name replacement everywhere in project
Message
From
20/05/2001 15:10:34
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
18/05/2001 03:41:43
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00508597
Message ID:
00509243
Views:
26
>Could anyone advise the fast way to replace all occurences of global variable with the different name. Are there any automated tools ? It is VFP6.

I had an utility like that back in FPD, and while it could be easily converted into VFP, it still covers .prg files only. I'd have to do a massive rewrite if I wanted to include classes, reports, menus and screens. The utility would have to touch only the methods, and recompile, and also to make sure it searches for whole words only etc etc. It should have to go down all the name fields within one project.

But then, there are a few things to consider:
- does it kill something which may be in use in a different project
- how does one recompile a report (there may be some code in its Dataenvironment)
- how to make sure a variable name doesn't coincide with a table, field, function or other name?

Thus, when searching for a string, I actually search down one or two directories (and subdirectories) and I use Win Explorer for that. Once it lists all the files found, I drag and drop each one of them into the command window, and then find the string within them. It's somewhat hard to do with classes, though - there may be just too many of them in the same classlib - but then it does force me to revisit the code and make sure I don't break something while doing this.

Anyway, a better way would be to get rid of the global variables. If that's what you're trying to accomplish, maybe this semimanual way is better, because you stay in control. Any automatic search/replace may introduce some interesting new bugs and cost you even more time.

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