Structure comparison

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Structure comparison

Post 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
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Structure comparison

Post 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?
Last edited by Demivec on Tue Sep 22, 2009 2:11 am, edited 1 time in total.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: Structure comparison

Post 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...
oh... and have a nice day.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: Structure comparison

Post 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.
Post Reply