Global search and replace?

Morganl

Senior Member
Hi again

It was about a year and half since i was here, but probably i will do small projects with PICAXE now and then.

I was half finished with a large flexible "multitasking" structure and now intend to finish it.

I remember i asked and there was some answer about having the search and replace functions work on all files at once (also include files) which is pretty important so changes are consistent.
What is the state of that feature?

Or do you recommend to use another multi-file editor for that?

/Morgan
 

oracacle

Senior Member
I don't see any need for this. I completed a project with 4 programme slots and 3 include files. There was no hard ship hitting ctrl+r in each file and replacing in each.
I suspect the problem with global is how you define when what files you are editing. all the ones added to the work book, just the ones that are open or something else.
If you were to go for the files in the work book that may well cause an issue if you keep notes (heck it may turn comments into something garbage). I normally keep a file in the workbook with all the changes I make so that I can, I don't normally don't wont to replace words in that - so if I note I that a changed a variable name for x to y, global change may change that to y to y which is no good.
 

techElder

Well-known member
I normally (try very hard to) keep my variable/constant definitions in one INCLUDE file. I found that most of the time my need for search/replace was because I was defining variable/constant values multiple times across files for a project. I only have to go to one file to change a constant for all instances of that constant throughout my project.

I don't know from your post just why/what it is that you are needing to change with search/replace. Can you elaborate?
 

Morganl

Senior Member
I often find after a bit of programming that some variable could better have another name that describes its use better.

And sometimes i invent or change a scheme such as all bit variables begins with b_ and all bytes with B_ words W_ constants with... you get it... and i need to change that part of many/all variables.

Or maybe if i want to translate from my language to english before posting in forum

Yes not often, it is not critical at all, would just be a help.
 

srnet

Senior Member
I don't see any need for this.
Agreed, I have been programming for a while now, cant say I have needed to use such a feature.

Whilst it may appear to be a 'useful' feature, I can see how it could make a real mess of a set of slots or programs or documentation.

I tend to give reasonably meaningful names to symbols when I first create them, then I dont need to worry about changing them all later.
 

Morganl

Senior Member
It is a good idea to always have variables names distinguished from any normal word.
- For searching them in program and in documentation.

In my opinion, having a working global replace makes it easier to update names of variables in every place including comments and code synchonised, and *less* error prone.
 

srnet

Senior Member
In my opinion, having a working global replace makes it easier to update names of variables in every place including comments and code synchonised, and *less* error prone.
Whether it does make it easier or not is highly debatable in my opinion.

There does not appear to be an overwhelming demand for such a feature.

However, if it could be implemented in such a way that Rev Ed could do it so that the cost of PICAXEs was not affected, I cannot see how anyone could object.
 
Top