void *Getsortedbyselection(t_sorted *sd,int index);

Locates index-th item in the table of the sorted data sorted by the currently selected criterium. Parameter index is usually the 0-based index of the selected line (sd->selected), hence the name.


(in) Pointer to the structure of type t_sorted, descriptor of sorted data
(in) Index of the item in the sorted data sorted by sd->sort

Return values:

On success, returns pointer to the element of sorted data. On error, returns NULL.


Here is the slightly modified code of the function that executes command "Dump in CPU" in the Memory window. User selects line in the table, calls pop-up menu and clicks on "Dump in CPU". The function then opens pointed memory block in the CPU Dump pane.

static int Mdumpincpu(t_table *pt,wchar *name,ulong index,int mode) {
  t_memory *pmem;
  if (pt==NULL)
    return MENU_ABSENT;
  pmem=(t_memory *)Getsortedbyselection(&(pt->sorted),pt->sorted.selected);
  if (pmem==NULL)
    return MENU_ABSENT;
  if (mode==MENU_VERIFY)
    return MENU_NORMAL;
  else if (mode==MENU_EXECUTE) {
    return MENU_NOREDRAW; }
  else return MENU_ABSENT;

See also:
Sorted data, t_sorted, Createsorteddata(), Findsorteddata()Findsorteddatarange(), Findsortedindexrange(), Getsortedbyindex()Sortsorteddata()