home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / obrn-a_1.5_src.lha / oberon-a / source3.lha / Source / OL / OLStrings.mod < prev   
Encoding:
Text File  |  1995-01-26  |  5.7 KB  |  152 lines

  1. <* STANDARD- *> <* MAIN- *> <* INITIALISE- *>
  2.  
  3. MODULE OLStrings;
  4. (****************************************************************
  5.    This file was created automatically by `FlexCat 1.5'
  6.    Do NOT edit by hand!
  7.    Oberon-A source description C 1994 by Albert Weinert
  8.    Using with Oberon-A Interfaces for AmigaOS Release 3.1
  9.    Modified for Oberon-A 1.5 by Frank Copeland
  10.  
  11.    Application: OLStrings
  12.    Language   : "english"
  13.    Version    : 1
  14.    Description: OLStrings.cd
  15.  
  16.     $RCSfile: OLStrings.mod $
  17.    $Revision: 1.3 $
  18.      $Author: fjc $
  19.        $Date: 1995/01/26 02:07:58 $
  20.  
  21. ****************************************************************)
  22.  
  23. IMPORT
  24.   lo := Locale, e := Exec, u := Utility, y := SYSTEM;
  25.  
  26. CONST
  27.   builtinlanguage = "english";
  28.   version = 1;
  29.  
  30. CONST
  31.   msg1* = 0;
  32.   msg2* = 1;
  33.   msg3* = 2;
  34.   msg4* = 3;
  35.   msg5* = 4;
  36.   msg6* = 5;
  37.   msg7* = 6;
  38.   msg8* = 7;
  39.   msg9* = 8;
  40.   msg10* = 9;
  41.   msg11* = 10;
  42.   msg12* = 11;
  43.   msg13* = 12;
  44.   msg14* = 13;
  45.   msg15* = 14;
  46.   msg16* = 15;
  47.   msg17* = 16;
  48.   msg18* = 17;
  49.   msg19* = 18;
  50.   msg20* = 19;
  51.   msg21* = 20;
  52.   msg22* = 21;
  53.   msg23* = 22;
  54.   msg24* = 23;
  55.   msg25* = 24;
  56.   msg26* = 25;
  57.   msg27* = 26;
  58.   msg28* = 27;
  59.   msg29* = 28;
  60.  
  61. TYPE
  62.   AppString = RECORD;
  63.      id  : LONGINT;
  64.      str : e.LSTRPTR;
  65.   END;
  66.   AppStringArray = ARRAY 29 OF AppString;
  67.  
  68. VAR
  69.   AppStrings : AppStringArray;
  70.   catalog : lo.CatalogPtr;
  71.  
  72.   PROCEDURE SetStrings;
  73.     BEGIN
  74.       AppStrings[0].id := msg1; AppStrings[0].str := y.ADR( " !! Could not open preferences file '%s'\n" );
  75.       AppStrings[1].id := msg2; AppStrings[1].str := y.ADR( " !! Too many search paths\n" );
  76.       AppStrings[2].id := msg3; AppStrings[2].str := y.ADR( " !! SYMSEARCH directory '%s' does not exist\n" );
  77.       AppStrings[3].id := msg4; AppStrings[3].str := y.ADR( " !! OBJSEARCH directory '%s' does not exist\n" );
  78.       AppStrings[4].id := msg5; AppStrings[4].str := y.ADR( " !! WITHPATH directory '%s' does not exist\n" );
  79.       AppStrings[5].id := msg6; AppStrings[5].str := y.ADR( " !! PROGPATH directory '%s' does not exist\n" );
  80.       AppStrings[6].id := msg7; AppStrings[6].str := y.ADR( " !! Too many extensions\n" );
  81.       AppStrings[7].id := msg8; AppStrings[7].str := y.ADR( "See OL.doc for conditions of use\n" );
  82.       AppStrings[8].id := msg9; AppStrings[8].str := y.ADR( " !! Could not create .with file name\n" );
  83.       AppStrings[9].id := msg10; AppStrings[9].str := y.ADR( "\x9B\x4B !! Name too long in '%s'\n" );
  84.       AppStrings[10].id := msg11; AppStrings[10].str := y.ADR( "\x9B\x4B !! Could not open '%s'\n" );
  85.       AppStrings[11].id := msg12; AppStrings[11].str := y.ADR( "\x9B\x4B !! Bad tag in symbol file '%s'\n" );
  86.       AppStrings[12].id := msg13; AppStrings[12].str := y.ADR( "\x9B\x4B !! Bad modAnchor in symbol file '%s'\n" );
  87.       AppStrings[13].id := msg14; AppStrings[13].str := y.ADR( "\x9B\x4B !! Bad name in symbol file '%s'\n" );
  88.       AppStrings[14].id := msg15; AppStrings[14].str := y.ADR( "\x9B\x4B !! Bad key in symbol file '%s'\n" );
  89.       AppStrings[15].id := msg16; AppStrings[15].str := y.ADR( "\x9B\x4B !! Could not find object file for module '%s'\n" );
  90.       AppStrings[16].id := msg17; AppStrings[16].str := y.ADR( "\x9B\x4B !! Could not find symbol file for module '%s'\n" );
  91.       AppStrings[17].id := msg18; AppStrings[17].str := y.ADR( "\x9B\x4B !! Bad key in module '%s'\n" );
  92.       AppStrings[18].id := msg19; AppStrings[18].str := y.ADR( "\x9B\x4B !! Could not create '%s'\n" );
  93.       AppStrings[19].id := msg20; AppStrings[19].str := y.ADR( " !! Error attempting to run '%s'\n" );
  94.       AppStrings[20].id := msg21; AppStrings[20].str := y.ADR( "\x9B\x4B !! Could not find object file '%s'\n" );
  95.       AppStrings[21].id := msg22; AppStrings[21].str := y.ADR( " !! Could not create program file name\n" );
  96.       AppStrings[22].id := msg23; AppStrings[22].str := y.ADR( " !! Too many arguments: select only one argument\n" );
  97.       AppStrings[23].id := msg24; AppStrings[23].str := y.ADR( " !! Arguments ALINK, BLINK and DLINK are mutually exclusive\n" );
  98.       AppStrings[24].id := msg25; AppStrings[24].str := y.ADR( " !! Arguments VERBOSE and QUIET are mutually exclusive\n" );
  99.       AppStrings[25].id := msg26; AppStrings[25].str := y.ADR( " !! Arguments MAKEICONS and NOICONS are mutually exclusive\n" );
  100.       AppStrings[26].id := msg27; AppStrings[26].str := y.ADR( " !! Could not create icon for '%s'\n" );
  101.       AppStrings[27].id := msg28; AppStrings[27].str := y.ADR( " !! Could not obtain icon\n" );
  102.       AppStrings[28].id := msg29; AppStrings[28].str := y.ADR( " !! Too few arguments: select exactly one argument\n" );
  103.     END SetStrings;
  104.  
  105.   PROCEDURE CloseCatalog*();
  106.     BEGIN
  107.       IF catalog # NIL THEN lo.CloseCatalog (catalog); catalog:=NIL END;
  108.    END CloseCatalog;
  109.  
  110.   PROCEDURE OpenCatalog*(loc:lo.LocalePtr; language:ARRAY OF CHAR);
  111.     VAR Tag : ARRAY 4 OF u.TagItem;
  112.     BEGIN
  113.       CloseCatalog();
  114.       IF (catalog = NIL) & (lo.base # NIL) THEN
  115.         Tag[0].tag := lo.builtInLanguage; Tag[0].data := y.ADR( builtinlanguage );
  116.         Tag[1].tag := u.skip;             Tag[1].data := y.ADR( language );
  117.         Tag[2].tag := lo.version;         Tag[2].data := version;
  118.         Tag[3].tag := u.done;
  119.  
  120.         IF language # "" THEN
  121.           Tag[1].tag:= lo.language;
  122.         END;
  123.         catalog := lo.OpenCatalogA (loc, "OLStrings.catalog", Tag);
  124.       END;
  125.     END OpenCatalog;
  126.  
  127.   PROCEDURE GetString* (num: LONGINT): e.LSTRPTR;
  128.     VAR
  129.       i: LONGINT;
  130.       default: e.LSTRPTR;
  131.     BEGIN
  132.       i := 0; WHILE (i < 29) & (AppStrings[i].id # num) DO INC (i) END;
  133.  
  134.       IF i # 29 THEN
  135.         default := AppStrings[i].str;
  136.       ELSE
  137.         default := NIL;
  138.       END;
  139.  
  140.       IF catalog # NIL THEN
  141.         RETURN lo.GetCatalogStr (catalog, num, default^);
  142.       ELSE
  143.         RETURN default;
  144.       END;
  145.     END GetString;
  146.  
  147. BEGIN
  148.   catalog := NIL;
  149.   SetStrings;
  150. END OLStrings.
  151.  
  152.