Hello Bruce and all others,
this a StringTheory-question, but as it concerns my Nettalk SOAPserver / FatClient-project, I will ask here.
When I get a QUEUE back from the server, I want to compare it to the existing on the clientside. If identical, I need no further process.
The Clarion function CHANGES(myQueue) does not do what I want. Manual says:
The CHANGES procedure returns a LONG integer containing a
unique "hash" value for the current QUEUE contents.
Saving this value then later comparing the saved value to the
current return value from CHANGES allows you to easily
detect that the contents of the QUEUE have changed (in any way at all).
However, when I compare two completely unchanged queues, I always get different "hashes".
How about using a StringTheory object for this?
LOOP RECORDS(myQueue) Times
GET(MyQueue, counter)
st.Append(mQ:RECORD)
counter += 1
END
hash = st.MD5()
First question: is that possible and useful in general?
My example from above does not work, Clarion says "mQ:RECORD: Unknown Identifier". It works, when I add each field of the queue record on its own.
Second question: Would a new method like .QueueHash(pQueue) a reasonable feature request? The more I think about it, I doubt that. But relentless as I am, I ask anyway.
Thanks for reading,
Wolfgang