Question for gurus.
Following code worked in Xojo 2018:
If Mid > 0 Then //we have a record to update.
Save
End If
I have no idea how that was supposed to work.
I understand that Mid() was deprecated and should be replaced by String.Middle() but as you see in the code above there were no parameters specified, no error.
Can someone explain to me if this code was “normal” in old days and what it means really?
Alberto, I am not going to ask to fix anything that is older than latest version of Xojo as it is not relevant for what I need to do, but it is interesting to know that Xojo allowed reserved word to be used as variable name (aka property), the odd thing is that I don’t see declaration of Mid as integer as well. Oh well, it is what it is, thanks for your response.
The code I posted above also works on the latest version of Xojo.
If you think that using mid as a property should show an error because it is a reserved word, you can create a Feature Request (if you want).
Edit: mid needs, at least, source and start. If Mid > 0 is not using the function. It should be defined somewhere in your old program (afaik).
OK, the mystery is solved. I typically search in Xojo using whole words and matching case, but this time I have given up on the case.
I see “mID” class property declared as integer, so “mID” and “Mid” are the same.
This is really very confusing, I have never dealt with this inconsistencies in my previous years as developer using different programming tool (keep in mind I am pretty new to Xojo world and discover all these little things “on the go”). Oh well, life is full of surprises.
If you mouse-over the token in question, the suggestions area should show you which one is being referred to. A variable will show the line number the variable was defined on, a property will show the full class-name property definition. Functions will show their function signature.