Strange behavior in the Code Editor

I saw that days ago and removed the space.

I was stoned to:
• see I do not get an error at run time,
• see the space back after I remove it (and still no error)

In short: “what a strange behavior” !

PS: the method I extracted this code from reads a Folder contents, keeping the childs folders but exclude it if the name ends with " - Data", is “image " and “Graphics”.
A report in a TextArea is done, so I know the code is executed (I also had some System.DebugBuild).

I nearly forget: I will replace .InStr with .IndexOf

Tahoe 26.5,
Xojo 26r1.2

image

image

I would change instr to not endswith(“”) as your current implementation only looks to see if - data is somewhere in the string, not ending with it

1 Like

The dot . character is an operator, so whitespace is ignored. a. b is equivalent to a.b in the same way that a+ b is equivalent to a+b.

3 Likes

In more than 20 years using Xojo and its ancestors, I was unaware of this :sweat_smile:.

1 Like

I’m here since REALbasic 1 (1998)… and so I am.

I removed this InStr (but I have to remplace all).

THANK you Graham for reminding me with EndsWith (I use it… in the Finder ! for objects search)