Skip to main content
edited tags
Link
Rob Hitchens
  • 55.6k
  • 11
  • 91
  • 146
edited title
Link
userDSSR
  • 287
  • 2
  • 13

Solidity Implementing Events in Remix giving ParseError on Event definitionSolidity (Remix)

Source Link
userDSSR
  • 287
  • 2
  • 13

Solidity in Remix giving ParseError on Event definition

I have a test code on Remix and have been getting ParseError: Expected Primary Expression. The error happens in function Enquiry -- at event definition - line.

ParserError: Expected primary expression. event itemsListDisplay (bytes32 itemId, bytes32 itemDescription, bytes32 auctionStatus); ^

My reason for using event is to display a listing when the function is called by an approved participant. Each listing of items would be in a new line.

Any other suggestion for improved code style will also help.

Thanks. Below is the test code.

contract Request is MasterContract, 
ApprovedParticipantsContract, ApprovedItemsContract {


    function Enquiry (address _address) returns (bool flag) {

    event itemsListDisplay (bytes32 itemId, bytes32 itemDescription, bytes32 auctionStatus);        


    if (approvedParticipantsList[_address].isValue) {

        uint len = itemsList.keys.length;

        for (uint i = 0; i < len; i++)  {

            bytes32 myItemId = itemsList.keys[i].itemId;
            bytes32 myItemDescription = itemsList.keys[i].itemDescription;
            bytes32 myAuctionStatus = itemsList.keys[i].auctionStatus;

            itemsListDisplay(myItemId, myItemDescription, myAuctionStatus);


        }



        return true;

    }

    return false;

    }

}