0

I have another problem with my code and I don´t know how to solve it. This is a part of my code:

function countUsuarios() view public returns(uint){ //here is the error
      return usuariosAd.length;
    }

Also if I comment that order this is what happen:

pragma solidity ^0.6.5;
contract Contract_Alba{
....
....
//function countUsuarios() view public returns(uint){ 
      //return usuariosAd.length;
   // }

} //Now I have the error here.

What do I have to do? Thanks!

  • What's your solc compiler version ? – clement Jun 26 at 15:54
  • I have change my code to Pragma solidity ^0.5.16 and also my compiler. – Alba Barrera Zulueta Jun 26 at 16:03
  • This might be a syntax error. Check your code carefully or add all of your code in here. Thanks – Masoud jt Jun 26 at 17:17
  • Perhaps it is a missing {, } or ; but without the whole source code it is just a guess. Are contracts being imported from another file? – Ismael Jun 26 at 19:08
  • Solved! It was a missing }. Thank you so much!! – Alba Barrera Zulueta Jul 1 at 10:54

Your Answer

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

Browse other questions tagged or ask your own question.