I have some issues trying to return a string with a function, when the first function has to return the string from a 2nd function.
Here some details :
contract A {
string myString = "someString";
function getMyString() returns (string thatString) {
return myString;
}
}
this works perfectly. But this :
contract A {
string myString = "someString";
function getMyString() returns (string thatString) {
return myString();
}
}
contract B {
function getMyStringFromA(address contractA) returns (string thatString) {
return A(contractA).myString();
}
}
It doesn't work.
I wasn't neither able to find doc about string in solidity, like if it's possible to concatenate 2 strings or not.
I'have spend the last day on this problem, I don't understand where is my mistake, if you have any tips for me, it would be great !
Thank you.
Comments
The only thing you can do is return a Bytes32 which is a finish value. (that's what I did).
Or you can return the length of the string, and then extract every bytes one by one. But if you use Js to speak with your chain, this doesn't work. (I do use Js).
Hope this will help someone with the same problem i had, because i lost a lot of time with it