0

I am trying to update a tuple in my array in solidity. I currently have an array that looks like this Array[(a,b),(x,y)]. What i would like to do is to later be able to update it to look like so Array[(a,b,c),(x,y,z)]. Is this possible?

4
  • Can you show the solidity code? When you say later update you mean a contract upgrade or something else?
    – Ismael
    Mar 24 at 23:40
  • This is what I am working on: mapping(uint => CLB) public CLBs; function addCLB(string memory _ACReg, uint _flightNo, uint _date, string memory _report, uint _IdNo) public { incrementPageNo(); CLBs[pageNo] = CLB(0, _ACReg, _flightNo, _day, _month, _year, _report, _IdNo, "", 0, 0); } function updateCLB(uint _pageNo, uint _date, uint _IdNo, uint _partNo, uint _serialNo, string memory _action) public{ incrementPageNo(); CLBs[pageNo] = CLBs[pageNo] + CLB(NEW); } I realize add them with the plus sign, it is just to show what i am trying to do. Mar 26 at 8:00
  • Figured it out, but thanks! Mar 26 at 10:36
  • Great! You can add your solution as an answer.
    – Ismael
    Mar 26 at 18:20
0

You can do it like so: CLBs[_pageNo].reportDate = _reportDate;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.