delphi - Using "for in" sentence and compiler error E2064 -



delphi - Using "for in" sentence and compiler error E2064 -

i want utilize for in sentence in test case under d2010.

if want write in param.value variable compiler reports error 2064, allows write in param.edit.text same record, why?

test case:

type // tparamset = (param_a, param_b, param_c, param_d, param_e, param_f); tparam = record edit :tedit; value :integer; end; var dtcp :array [tparamset] of tparam; procedure resetparams; var param :tparam; :integer; begin param in dtcp begin param.edit.text:= 'test'; //no problem := param.value; //no problem param.value := 0; //error: e2064 left side cannot assigned to; end; end;

records value types. for in loop returning re-create of each record in array , compiler error telling modifying futile.

you'll need utilize old fashioned loop:

for := low(dtcp) high(dtcp) dtcp[i].value := 0;

delphi delphi-2010 for-in-loop

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -