rem: const etable *e = encoding_table; int i = 0; while(e->name){ BMessage *msg = new BMessage(MENU_ENCODING); msg->AddInt32("op", (int32)e->op); if (flag) { eMenu->AddItem(new BMenuItem(e->name, msg, e->shortcut)); } else { eMenu->AddItem(new BMenuItem(e->name, msg)); }  if ( i == coding) { (eMenu->ItemAt(i))->SetMarked(true); } e++; i++; }
add: const etable *e = encoding_table; int i = 0; while(e->name) { BMessage *msg = new BMessage(MENU_ENCODING); msg->AddInt32("op", (int32)e->op); if (flag) eMenu->AddItem(new BMenuItem(e->name, msg, e->shortcut)); else eMenu->AddItem(new BMenuItem(e->name, msg));  if ( i == coding) { (eMenu->ItemAt(i))->SetMarked(true); } e++; i++; }
context: MakeEncodingMenu(BMenu *eMenu, int coding, bool flag){  const etable *e = encoding_table;  int i = 0;  while(e->name){    BMessage *msg = new BMessage(MENU_ENCODING);    msg->AddInt32("op", (int32)e->op);    if (flag) {      eMenu->AddItem(new BMenuItem(e->name, msg, e->shortcut));    }    else {      eMenu->AddItem(new BMenuItem(e->name, msg));    }          if ( i == coding) {      (eMenu->ItemAt(i))->SetMarked(true);    }    e++;    i++;  }}