2

I get an error message on the line returnString("testing"); that says:

DeclarationError: Undeclared identifier. returnString("testing");

function returnString (string checkers) external view returns(string) {
    return checkers;
}

function getBidders() public {
    returnString("testing"); 
}

Why wont this work?

eth
  • 85,679
  • 53
  • 285
  • 406
Marc Alexander
  • 358
  • 4
  • 18

1 Answers1

3

It is because you are calling returnString function, declared as external from internal, declared as public function. Declare returnString function as public instead since you are calling it from inside.

function returnString (string checkers) public view returns(string) {
    return checkers;
}

Look at this answer for reference.