Thomas from Oraclize here.
When you call Oraclize the query is asynchronous, this means that one transaction is needed to send the query and another transaction to receive the result - this is the "callback transaction", it's sent by Oraclize and usually comes ~1-2 blocks after the first one.
The "callback transaction" is calling the
__callback method as described in our documentation. It is by implementing the __callback method that you can use the data Oraclize sends back as result.
In your use case you want to compare a given user input with the Oraclize answer, so the way to do it is:
- the user calls (via a transaction) a given contract method which does keep a copy in storage of the user input & which calls Oraclize (via oraclize_query)
- Oraclize will send back the "callback transaction" with the result, your contract implements the
__callback function and checks whether the Oraclize
result does match with the user input (we stored it before in the contract storage) or not
In our dedicated github respository you can find some Solidity examples which you might find helpful as well!
If this is not clear enough or if you have any other doubt feel free to comment below or to join our official gitter support channel.