Custom Library Messages

version 28/100614 by David Fisher

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 3.6 - Table operations - unindexed

    [ get the "Word" entry from a grammatical table ]

    To find (c_ - letter case) & (p_ - grammatical person) & (n_ - grammatical number)
    in (t_ - table-name):
    let r_ be 1;
    let num_ be the number of rows in t_;
    while r_ <= num_ begin;
    choose row r_ in t_;
    if Case entry is c_ and
         Gramm Person entry is p_ and
         Gramm Number entry is n_
         begin;
         say Word entry;
         change r_ to num_ + 1; [ to force the loop to end ]
         otherwise;
         change r_ to r_ + 1;
    end if;
    end while.

    [ get the "Negative" entry from a grammatical table ]

    To find negative (c_ - letter case) & (p_ - grammatical person) & (n_ - grammatical number)
    in (t_ - table-name):
    let r_ be 1;
    let num_ be the number of rows in t_;
    while r_ <= num_ begin;
    choose row r_ in t_;
    if Case entry is c_ and
         Gramm Person entry is p_ and
         Gramm Number entry is n_
         begin;
         say Negative entry;
         change r_ to num_ + 1; [ to force the loop to end ]
         otherwise;
         change r_ to r_ + 1;
    end if;
    end while.

    [ for tables with gender instead of person, eg. 'he' ]

    To find (c_ - letter case) & (g_ - gender) & (n_ - grammatical number)
    in (t_ - table-name):
    let r_ be 1;
    let num_ be the number of rows in t_;
    while r_ <= num_ begin;
    choose row r_ in t_;
    if Case entry is c_ and
         Gender entry is g_ and
         Gramm Number entry is n_
         begin;
         say Word entry;
         change r_ to num_ + 1; [ to force the loop to end ]
         otherwise;
         change r_ to r_ + 1;
    end if;
    end while.

    [ for tables without "Case" columns ]

    To find (p_ - grammatical person) & (n_ - grammatical number)
    in (t_ - table-name):
    let r_ be 1;
    let num_ be the number of rows in t_;
    while r_ <= num_ begin;
    choose row r_ in t_;
    if Gramm Person entry is p_ and
         Gramm Number entry is n_
         begin;
         say Word entry;
         change r_ to num_ + 1; [ to force the loop to end ]
         otherwise;
         change r_ to r_ + 1;
    end if;
    end while.