Skip to main content
deleted 5 characters in body
Source Link
Badr Bellaj
  • 18.9k
  • 4
  • 60
  • 75

it works for me this is the code with minor changes

contract test{ struct Record { string value; address owner; } mapping(string => Record) records; Record lastRecord; function addRecord(string _recordId, string _value, address _owner) returns (bool) { Record r = records[_recordId]; r.value = _value; r.owner = _owner; lastRecord = r; return true; } function getLastRecordOwner() returns (address addr) { return lastRecord.owner; } } 

enter image description here

it works for me this is the code with minor changes

contract test{ struct Record { string value; address owner; } mapping(string => Record) records; Record lastRecord; function addRecord(string _recordId, string _value, address _owner) returns (bool) { Record r = records[_recordId]; r.value = _value; r.owner = _owner; lastRecord = r; return true; } function getLastRecordOwner() returns (address addr) { return lastRecord.owner; } } 

enter image description here

it works for me this is the code with minor changes

contract test{ struct Record { string value; address owner; } mapping(string => Record) records; Record lastRecord; function addRecord(string _recordId, string _value, address _owner) returns (bool) { Record r = records[_recordId]; r.value = _value; r.owner = _owner; lastRecord = r; return true; } function getLastRecordOwner() returns (address) { return lastRecord.owner; } } 

enter image description here

Source Link
Badr Bellaj
  • 18.9k
  • 4
  • 60
  • 75

it works for me this is the code with minor changes

contract test{ struct Record { string value; address owner; } mapping(string => Record) records; Record lastRecord; function addRecord(string _recordId, string _value, address _owner) returns (bool) { Record r = records[_recordId]; r.value = _value; r.owner = _owner; lastRecord = r; return true; } function getLastRecordOwner() returns (address addr) { return lastRecord.owner; } } 

enter image description here