freepascal - How to have an object with Text property equal to the character made from an integer from an array -


i'm trying write short program using lazarus. initialise array of integers; have tedit object x1 text value (after clicking 'initialise' button) want equal (character made from) first element of array. here relevant code segments:

var   w: array[0..3] of integer = (1,0,1,0);  

(...)

procedure tform1.initialiseclick(sender: tobject);   begin     x1.text:=inttostr(w[0]);   end;     

unfortunately, gives me following message:

unit1.pas(81,22) error: no default property available unit1.pas(81,22) fatal: syntax error, ")" expected "[" found 

with cursor right @ 'w' after 'inttostr('.

what doing wrong? googling 'properties of arrays' did not me (as can tell, i'm newbie...) in advance!

my guess different "w" in scope, e.g. field of tform1 class, or defined global variable/symbol unit usesd in implementation

in such cases, trying reduce source minimum example still exhibits bug, , makes disappear can shed light on happening.


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -