Browse Source

FoStrings

Arthur Yefimov 3 years ago
parent
commit
cdc599fe04
4 changed files with 21 additions and 5 deletions
  1. 14 0
      src/FoStrings.Mod
  2. 3 3
      src/FreeOberon.Mod
  3. 1 1
      src/OV.Mod
  4. 3 1
      src/make.sh

+ 14 - 0
src/FoStrings.Mod

@@ -0,0 +1,14 @@
+MODULE FoStrings;
+IMPORT Strings, Int;
+
+PROCEDURE GetErrorStr*(err: INTEGER; VAR s: ARRAY OF CHAR);
+BEGIN
+  IF err = 41 THEN s := 'Ожидается точка с запятой'
+  ELSE
+    s := 'Ошибка ';
+    Int.Append(err, s);
+    Strings.Append('.', s)
+  END
+END GetErrorStr;
+
+END FoStrings.

+ 3 - 3
src/FreeOberon.Mod

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
 along with Free Oberon.  If not, see <http://www.gnu.org/licenses/>.
 *)
 IMPORT T := TermBox, Files, Args, Utf8,
-       OV, Editor, Term, Config, Strings, Int, Out, Kernel;
+       OV, Editor, Term, FoStrings, Config, Strings, Int, Out, Kernel;
 CONST
   version* = '1.1.0 alpha';
 
@@ -312,7 +312,7 @@ BEGIN fname[0] := 0X; line := 1; col := 1;
         INC(i, 4); ReadInt(s, i, error)
       ELSE error := 0
       END;
-      (*s := 'Пропущена точка с запятой';;;;;;;*)
+      FoStrings.GetErrorStr(error, s);
       ;;;;;Out.String('error = ');Out.Int(error, 0);Out.Ln;;;;;;
     END
   END
@@ -1176,7 +1176,7 @@ VAR success, fs, sw: BOOLEAN;
 BEGIN
   success := FALSE;
   ParseArgs(fs, sw, w, h, fnames);
-  T.Settings(106, 25, {T.resizable, T.window});
+  T.Settings(106, 25, {T.resizable(*, T.window*)});
   (*T.Settings(240, 61, {T.resizable, T.window});*)
   T.SetTitle('Free Oberon');
   T.Init;

+ 1 - 1
src/OV.Mod

@@ -2340,7 +2340,7 @@ BEGIN SetApp(m, app); Add(app.menu, m); RefreshAppMenu(app.menu)
 END AddMenu;
 
 PROCEDURE SetStatusText*(app: App; text: ARRAY OF CHAR);
-BEGIN app.statusText := text
+BEGIN Strings.Extract(text, 0, LEN(app.statusText), app.statusText)
 END SetStatusText;
 
 PROCEDURE CheckMenuOpenKey(app: App; VAR E: T.Event): BOOLEAN;

+ 3 - 1
src/make.sh

@@ -46,6 +46,8 @@ $OFR -Cw Term.Mod
 
 $OFR -7w OV.Mod
 
+$OFR -7w FoStrings.Mod
+
 $OFR -Cw EditorText.Mod
 
 $OFR -Cw Editor.Mod
@@ -75,7 +77,7 @@ $AR -crs ../Data/bin/libFreeOberon.a \
 $CCFULL -o ../$PROG \
   Graph2.c TermBox.c \
   Config.c term/term_linux.c \
-  Term.c OV.c EditorText.c Editor.c \
+  Term.c OV.c FoStrings.c EditorText.c Editor.c \
   $PROG.c \
   ../Data/bin/libFreeOberon.a \
   $OFRDIR/Lib/libOfront.a \