Bug? B4J Rename To: - possible bug?

Computersmith64

Well-Known Member
Licensed User
Longtime User
In v6.00 Beta 2, when I do a Find All References (F7) search, then type a new name into the Rename To box & hit Rename, I get a toast message pop up saying "Name already exists".

In this particular case, I am porting a B4A app to B4J & have copied the Starter service to a code module & renamed it to "Startup". I am trying to rename all the references in my code from Starter to Startup - so I do an F7 search, but then run into this issue when I type "Startup" into the Rename To box & hit Rename. If I type something else (eg: "crap") into the Rename To box, it works fine.

I thought it might be getting confused because of the code module name ("Startup"), however if I type in "Options" - which is also a code module name - it works fine.

- Colin.
 

Computersmith64

Well-Known Member
Licensed User
Longtime User
Hi Erel - I have attached a project that shows the issue. If you highlight the "Starter" reference in the main form & press F7, then type "Startup" in the Rename To box & click the Rename button, you'll get the "Name already exists" error.

- Colin.
 

Attachments

  • renamebugtest.zip
    1.1 KB · Views: 318

Computersmith64

Well-Known Member
Licensed User
Longtime User
Fyi - as another test, I just added another module called "TestModule" & was able to rename "Starter" to "TestModule" (using the Rename To function) without problems - however then I added the var as Int variable to TestModule & tried again & got the error.

- Colin.
 

Computersmith64

Well-Known Member
Licensed User
Longtime User
I'm not sure I understand. I'm not trying to change the variables to match the module names, I'm trying to rename an incorrect module name reference

I have a public variable called "var" in a code module called Startup & another public variable called "var" in a code module called TestModule.

If I want to reference the variables from my Main code module I can use:
B4X:
Startup.var
TeatModule.var
There is no problem doing this. However if I mis-type my references & make them:
B4X:
Starter.var
TestMod.var
then try to change them to the correct module name references with the Rename To function, I get the "Name already exists" error. I can change them manually & they work fine.

It's not a big deal, but it seems like a bug in the IDE to me & it's inconvenient because in a case where I have multiple references to variables in a code module that I have since renamed, I have to go through the code & change each one manually.

- Colin.
 
Top