Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 10 Monaten, 2 Wochen
Letzter Beitrag:
vor 10 Monaten, 2 Wochen
Beteiligte Autoren:
Ola, GuenterP

[WD21] Changing a global variable messed up my app 10 times faster!

Startbeitrag von Ola am 06.10.2016 09:05

Hi All

I changed the name of a global variable.
say, from gVariableX to gVariableY, just to make the code more readable and the variable name more easily rememberable..
There were 390 occurrences.
Windev then started to "synchronize" the app.
Took longer than normal.
Ended up in a mess:
in the code the variable name became a combination of the new and old names: gVariableYgVariableX!!!!
And WD did not change all the occurrences!
390 compilation errors: The identifier 'gVariableYgVariableX' (and gVariableX) is unknown or inaccessible.
And the app was partly locked. Cannot fix the errors and cannot change anything in code editor in those elements that use this variable. Other elements can be edited..
Cannot search and replace these errors.
Repairing the project does not help.
Recompiling the project does not help.
Closed the app without saving.
Re-opened it. It did re-open! But the mess was still there.
And the problem elements were still locked.
Closed again.
Deleted the .cpl sub-directory.
Re-opened the app. It did re-open. The mess still there. And the problem elements still locked.
Luckily, I made a back-up just before doing all this.
Still, my time was wasted.
But the most important thing, of course, is that there are nice girls and big WX boxes in the 1000 or so new features brochure. Who cares about bugs? Bugs are so boring...

Best regards
Ola

Antworten:

Hi Ola, sorry, I never had that. Didn't even know that it synchronizes after changing a variable's name. Be a wise guy and don't let it synch such things. But: synching after changing the analysis worked fine most times. Changing a variable's name ... first thing the code editor should show a zillion compiler errors ... next I'd recommend to "synchronize" simply with Search + Replace.

von GuenterP - am 06.10.2016 09:20
Hi Guenter,

This was a new feature for me, too.
Usually the variable name change synchronization works OK, but usually also the number of necessary replacements is considerably lower.

Actually there were 443 occurrences.

I restored the project, and changed the variable name with search and replace.
WD did it for all except for 11 occurrences!
These are locked! Cannot be fixed, not even manually.
So it's another restore.

Maybe WD run out of memory?!?!? I only have 16 GB of it.

Bad show:sneg:

But the brochure girls are nice and the boxes are big:spos:

Well, maybe I don't really want to change the variable's name...

Best regards
Ola

von Ola - am 06.10.2016 10:23
I just realized that the locked codes must have been template generated code sections, and therefore they could not be fixed directly.

Still, there were over a hundred other windows fixed with the same generated code...

If I do this again, I will
- first just add the new global variable
- change it in the templates
- re-generate the template-based windows
- only then search and replace the rest of the code
- finally delete the old variable.

Where's my Nikon and Kodachrome?

Best regards
Ola

von Ola - am 06.10.2016 10:45
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.