How to get return values when function with argument is called

AkiAki Member Posts: 1
I am writing below simple contract which stores all results of questionnaires of each ID.

contract answer{
mapping(address => mapping(string => bool)) voters;

struct qList {
uint count; //The number of respondents
mapping(address => mapping(uint => uint)) answer;
}

mapping(string => qList) questionnaires;

function vote(string ID, uint qNum, uint ans) returns (bool) {
if(voters[msg.sender][ID]) throw;
voters[msg.sender][ID] = true;
questionnaires[ID].count += 1;
questionnaires[ID].answer[msg.sender][qNum] = ans;
return true;
}

function getNumResult(string ID) constant returns (uint res) {
return questionnaires[ID].count;
}
}

The function "vote" including arguments can be called and mined successfully, howerver I cannot get the return value with the status message "Waiting for transaction to be mined..." in solidity-browser screen when I call "getNumResult" with ID which has already registered via the function "vote".

Appreciate it if someone would advise the cause of this and solution to get the return value of function with arguments.






Comments

Sign In or Register to comment.