Help with struct

Sorry, I know this has been asked before and I read the forum responses. I think I’m coding these statements correctly but I still get errors on the verify in the Arduino IDE, in the last line. I’ve tried a couple of different formats, checked the C++ tutorial on the subject but no luck. I want to run an x10 interface and loop through the array of event records, turning things on and off depending on the record data and day/time info. Can someone show me where the error is?

typedef struct // x10 event record definition
{
String ev_name;
String ev_time;
byte house_code;
byte unit_no;
byte action;
} x10_Event_Type;

x10_Event_Type x10_events[10]; // array of x10 event records
x10_events[1].ev_name = “Unit ON”; // <== error: ‘x10_events’ does not name a type

You have placed executable code outside a function, loop() or setup() for example.

Put that assignment inside setup()

Thanks for the help! It was a stupid rookie mistake and now works as expected.