Page 1 of 1

Structure comparison

Posted: Tue Sep 22, 2009 12:43 am
by Mistrel
Now that we can assign structures in PureBasic 4.40 it would be nice to be able to perform comparison operations as well without the use of Compare Memory:

Code: Select all

If A.Point=B.Point
   Debug "True!"
EndIf

Re: Structure comparison

Posted: Tue Sep 22, 2009 12:52 am
by Demivec
Mistrel wrote:Now that we can assign structures in PureBasic 4.40 it would be nice to be able to perform comparison operations as well without the use of Compare Memory:
@Mistrel: The only comparison operators that would make sense are '=' and '<>' .

What would be the results of the others?

Re: Structure comparison

Posted: Tue Sep 22, 2009 1:08 am
by Kaeru Gaman
indeed, only equal or not equal

wich POINT is bigger?
ok, that could be a vector thingy..
but wich Dataset with Name, Adress and ZIP?
is Chicago bigger than Miami?

no, only "=" would make sense.
would be a special application of CompareMemory...

Re: Structure comparison

Posted: Tue Sep 22, 2009 2:58 am
by Mistrel
I only meant '=' and '<>'. The comparison would be bit-for-bit just like CompareMemory. It would just be easier to read using comparison operators instead of a function.