Compare Ubound values when both are -1

if UBound(letterList) <> UBound(pzl.letterList) then Return 1

if UBound(letterList) <> UBound(pzl.letterList) then Return 1

(Sorry hit the wrong key and added an empty post).

I have the above line of code in an operator_compare method. Checking to see if a class has changed. In this case both arrays are empty (Ubound= -1 in both) but the IF is returning false and the method exits.
I would have expected this to be true and the method continue. Is my understanding wrong?

Jack

We need just a little more context to help you out. All we can say from what you’ve shared is that if the size of the arrays doesn’t match then it will return 1.

Do you have a sample project you can share, even if it just includes the class?

I’m running on a Mac, High Sierra with the latest version of Xojo.
In my app I have a method EnableSave that checks if the save menu item should enable.
The data is saved in a class where any changes are applied. During app open the data class is copied to an “old” version which remains untouched. When EnableSave runs it checks if all required values are present, if everything is okay then the last line is
if pzlist <> opzlist then save.Enabled = true

This runs the operator_compare method in the class, opzlist is the original values, accessed as pzl in the operator_compare method.
If about(letterList) <> pzl.letterlist) then return 1
letterList is a array of random letters used to pad out a grid (it’s a word puzzle app I’m writing).
In this case the working version Ubound and the original Ubound are both -1. There’s lots of code below that line, but the method jumps straight to the exit.

Ok … I’ve discovered where I went wrong. It amazing how obvious the solution is after you’ve scratched your head for an hour and asked for help.

Jack