Forum > General

Argument cannot be assigned to

(1/2) > >>

Neville:
Using Lazarus 2.2.0, I'm trying to assign to a set of byte variable which is a part of a record, in an array:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TIVClass.SetMemberAvailability(x:word;A:setofbyte);begin   Member[x].MemberAvailability := A;end; 
I have so far failed to find any way around the error "Argument cannot be assigned to".

Has anyone any helpful suggestions please?

howardpc:
To assign values to routine arguments they must be declared as var or out.
However, in the minimal code you show, you don't assign any value to the argument A, but just copy it.
Is your MemberAvailability  property read-only?
Perhaps you should post a compilable example that shows the error.

bytebites:
Use code tags please.

Martin_fr:
EDITED original message to add code tags.

@Nevile

[ code=pascal ]
[ /code ]

Neville:
Thank you all for your helpful comments.  I'll follow them up,  and it looks as if they may hold the solution.

Navigation

[0] Message Index

[#] Next page

Go to full version