System: Windows
Xojo version: 2015r2.1
In a rather large project, I had to replace a lot of terms, and one of them was ‘GridXY’ by ‘ViewXY’. The order of replacing did not matter (replacing GridXY first or replacing it after doing some other replaces). It just happened with the term GridXY.
For reference, because I think this is where Replace All got confused:
-
GridXY was defined as Property in one Window.
-
GridXY was also used as a local variable in a method in another window:
dim GridXY as Integer = 24
Before the replace:
GridXY: 76 occurences
ViewXY: 0 occurences
After the replace all:
GridXY: 0 occurences
ViewXY: 76 occurences
However the program did not run anymore. Luckily I had a backup.
When I manually overtyped all 76 occurences of GridXY by ViewXY, I had the same result as doing the replace all (makes sense):
GridXY: 0 occurences
ViewXY: 76 occurences
But now the program works as espected! This made we wondering what had gone wrong so I saved both projects (the one using the ReplaceAll and the one I did the replace manually) to xml and did a file compare:
In the one I did manually,
' Manual change
<Property>
<ItemName>ViewXY</ItemName>
<Compatibility></Compatibility>
<Visible>1</Visible>
<ItemSource>
<TextEncoding>134217984</TextEncoding>
<SourceLine>ViewXY As Integer = 24</SourceLine>
<SourceLine></SourceLine>
</ItemSource>
<TextEncoding>134217984</TextEncoding>
<ItemDeclaration>ViewXY As Integer = 24</ItemDeclaration>
<ItemFlags>0</ItemFlags>
<IsShared>0</IsShared>
</Property>
<ViewProperty>
<ObjName>ViewXY</ObjName>
<PropertyGroup>Behavior</PropertyGroup>
<PropertyValue>24</PropertyValue>
<ItemType>Integer</ItemType>
</ViewProperty>
In the one done with Xojos Replace All:
' Xojo Replace All
<Property>
<ItemName>ViewXY</ItemName>
<Compatibility></Compatibility>
<Visible>1</Visible>
<ItemSource>
<TextEncoding>134217984</TextEncoding>
<SourceLine>ViewXY As Integer</SourceLine> ' the default value is gone
<SourceLine></SourceLine>
</ItemSource>
<TextEncoding>134217984</TextEncoding>
<ItemDeclaration>ViewXY As Integer</ItemDeclaration> ' the default value is gone
<ItemFlags>0</ItemFlags>
<IsShared>0</IsShared>
</Property>
<ViewProperty>
<ObjName>GridXY</ObjName> ' still using the old name GridXY
<PropertyGroup>Behavior</PropertyGroup>
<PropertyValue>24</PropertyValue>
<ItemType>Integer</ItemType>
</ViewProperty>
In the IDE, both gave no errors analysing.
Unfortunately, I cannot report this error through feedback as it keeps crashing on me. I would be grateful if someone could however, as this error has kept me searching for the best part of my day.