On 26-Feb-02 Also-Antal Csaba wrote: > Hi, > > When I use this code: > temp = (*house[index].numb).temperature; > the picc make good result. > > But if I want change the value of temperature in the struct, with this: > (*house[index].numb).temperature=temp; > I get this message: > varibles.c: 108: Can't generate code for this expression (error) Your definitions and typedefs seem more complex than is needed, but I think I've worked them out. house is an array of blokks so house[index] is a blokk a blokk contains a single element numb which is a pointer to a ship so house[index].numb is a pointer to a ship so house[index].numb->temperature is the temperature member in a ship Note the use of the "->" operator. Try that and see it is works. It should be equiv to the expression you used but maybe there is a compiler bug or restriction. Peter. > > This code is work: > ship1.temperature = 999; > > and this not: > > cost ship * p; > p=&ship1; > (*p).temperature=123; > the error message is same. > > Why??? > > > typedef struct { > char address; > > int temperature; > char adjust; > char max_alarm; > char min_alarm; > signed char tem_cal; > > int relhum; > int pwm; > char spay_time; > char spay_dlay; > char min_hum; > char max_hum; > char str_time; > char stp_time; > signed char rh_cal; > > int light; > int optimum; > int close_time; > }ship; > > typedef struct { > const ship * numb; > }blokk; > > > > static bank3 ship ship1 = 111,210,0,400,40,-123, > 550,1000,10,100,40,80,81,150,0, 134,300,4000; > > etc... > > const blokk house[] ={ & ship1, > & ship2, > & ship3, > & ship4, > & ship5, > & ship6, > & ship7, > & ship8 > }; > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads ---------------------------------- E-Mail: Peter Onion Date: 26-Feb-02 Time: 10:50:21 This message was sent by XFMail ---------------------------------- -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads