=== modified file 'src/com/goldencode/p2j/persist/AbstractTempTable.java'
--- src/com/goldencode/p2j/persist/AbstractTempTable.java	2022-10-06 08:18:44 +0000
+++ src/com/goldencode/p2j/persist/AbstractTempTable.java	2022-11-21 22:51:00 +0000
@@ -108,6 +108,8 @@
 import com.goldencode.p2j.util.*;
 import java.util.*;
 
+import static com.goldencode.p2j.util.ErrorManager.*;
+
 /**
  * Abstract base class for static and dynamic temp-table 4GL objects.
  */
@@ -563,12 +565,13 @@
    {
       if (!prepared().getValue())
       {
-         ErrorManager.displayError(12346,
-               "ERROR-STRING can only be used with a PREPARED temp-table that is not a BEFORE-TABLE",
-               false);
-         ErrorManager.recordOrThrowError(3131,
-               "Unable to set attribute ERROR-STRING in widget of type TEMP-TABLE",
-               false);
+         recordOrShowError(12346,
+                           "ERROR-STRING can only be used with a PREPARED temp-table that is not a BEFORE-TABLE",
+                           true,
+                           false);
+         recordOrThrowError(3131,
+                            "Unable to set attribute ERROR-STRING in widget of type TEMP-TABLE",
+                            false);
          return;
       }
 
@@ -2479,10 +2482,10 @@
     */
    protected void displayCreateLikeNotFirst()
    {
-      ErrorManager.displayError(9041,
-            "CREATE-LIKE must be the first method on a newly CREATEd TEMP-TABLE, " +
-            "or a newly CLEARed one",
-            false);
+      recordOrShowError(9041,
+                        "CREATE-LIKE must be the first method on a newly CREATEd TEMP-TABLE, or a newly CLEARed one",
+                        true,
+                        false);
    }
 
    /**
@@ -2492,11 +2495,12 @@
     */
    protected void displayPrepared()
    {
-      ErrorManager.displayError(9042,
-            "Definitional TEMP-TABLE methods (ADD-NEW/LIKE) may not be called after " +
-            "TEMP-TABLE-PREPARE has been called unless a CLEAR is done first, and may never " +
-            "be called on a DEFINED static table",
-            false);
+      recordOrShowError(9042,
+                        "Definitional TEMP-TABLE methods (ADD-NEW/LIKE) may not be called after " +
+                        "TEMP-TABLE-PREPARE has been called unless a CLEAR is done first, and may never " +
+                        "be called on a DEFINED static table",
+                        true,
+                        false);
    }
 
    /**
@@ -2504,7 +2508,7 @@
     */
    protected void displayPreparedIgnoring()
    {
-      ErrorManager.displayError(9043, "TEMP-TABLE is already prepared--ignoring", false);
+      recordOrShowError(9043, "TEMP-TABLE is already prepared--ignoring", true, false);
    }
 
    /**
@@ -2513,9 +2517,10 @@
     */
    protected void displayUnableAssignUnknownUndo()
    {
-      ErrorManager.displayError(4083,
-            "**Unable to assign UNKNOWN value to attribute UNDO on TEMP-TABLE widget",
-            false);
+      recordOrShowError(4083,
+                        "Unable to assign UNKNOWN value to attribute UNDO on TEMP-TABLE widget",
+                        true,
+                        true);
    }
 
    /**
@@ -2524,10 +2529,11 @@
     */
    protected void displayCannotClear()
    {
-      ErrorManager.displayError(9085,
-            "CLEAR method may not be called on a static temp-table object, nor on a dynamic " +
-                  "one with records; use buffer:EMPTY-TEMP-TABLE",
-            false);
+      recordOrShowError(9085,
+                        "CLEAR method may not be called on a static temp-table object, nor on a dynamic " +
+                              "one with records; use buffer:EMPTY-TEMP-TABLE",
+                        true,
+                        false);
    }
 
    /**
@@ -2536,9 +2542,10 @@
     */
    protected void displayNotPrepared()
    {
-      ErrorManager.displayError(9040,
-            "TEMP-TABLE must be PREPARED before referencing NAME/DEFAULT-BUFFER-HANDLE etc",
-            false);
+      recordOrShowError(9040,
+                        "TEMP-TABLE must be PREPARED before referencing NAME/DEFAULT-BUFFER-HANDLE etc",
+                        true,
+                        false);
 
    }
 
@@ -2547,9 +2554,10 @@
     */
    protected void displayUninitialized()
    {
-      ErrorManager.displayError(12378,
-            "Attempt to reference uninitialized temp-table",
-            false);
+      recordOrShowError(12378,
+                        "Attempt to reference uninitialized temp-table",
+                        true,
+                        false);
    }
    
    /**
@@ -2558,9 +2566,10 @@
     */
    protected void displayUnableCreateLike()
    {
-      ErrorManager.displayError(9047,
-            "Unable to CREATE-LIKE for TEMP-TABLE--try using a smaller source table",
-            false);
+      recordOrShowError(9047,
+                        "Unable to CREATE-LIKE for TEMP-TABLE--try using a smaller source table",
+                        true,
+                        false);
    }
 
    /**
@@ -2568,7 +2577,7 @@
     */
    protected void displayUnableAddFieldsFrom()
    {
-      ErrorManager.displayError(9049, "Unable to ADD-FIELDS-FROM for TEMP-TABLE", false);
+      recordOrShowError(9049, "Unable to ADD-FIELDS-FROM for TEMP-TABLE", true, false);
    }
 
    /**
@@ -2576,9 +2585,10 @@
     */
    protected void displayCouldNotFindLikeTableFromHandle()
    {
-      ErrorManager.displayError(9058,
-            "TEMP-TABLE method could not find LIKE table from BUFFER handle",
-            false);
+      recordOrShowError(9058,
+                        "TEMP-TABLE method could not find LIKE table from BUFFER handle",
+                        true,
+                        false);
    }
 
    /**
@@ -2587,9 +2597,10 @@
     */
    protected void displayCopyTempTableInvalidFirstArg()
    {
-      ErrorManager.displayError(12339,
-            "COPY-TEMP-TABLE must have valid buffer/temp-table handle as first argument",
-            false);
+      recordOrShowError(12339,
+                        "COPY-TEMP-TABLE must have valid buffer/temp-table handle as first argument",
+                        true,
+                        false);
    }
 
    /**
@@ -2598,9 +2609,10 @@
     */
    protected void displayCopyTempTableHalfDefined()
    {
-      ErrorManager.displayError(12341,
-       "COPY-TEMP-TABLE target temp-table must be either PREPARED or CLEAR, but not half-defined",
-       false);
+      recordOrShowError(12341,
+                        "COPY-TEMP-TABLE target temp-table must be either PREPARED or CLEAR, but not half-defined",
+                        true,
+                        false);
    }
 
    /**

=== modified file 'src/com/goldencode/p2j/persist/TempTableBuilder.java'
--- src/com/goldencode/p2j/persist/TempTableBuilder.java	2022-11-11 00:58:32 +0000
+++ src/com/goldencode/p2j/persist/TempTableBuilder.java	2022-11-21 22:43:33 +0000
@@ -181,6 +181,7 @@
 import java.util.function.*;
 
 import static com.goldencode.p2j.persist.DynamicTablesHelper.*;
+import static com.goldencode.p2j.util.ErrorManager.*;
 
 /**
  * Implementation of buffer of a dynamic TEMP-TABLE and the associated
@@ -1311,9 +1312,10 @@
       ParmType parmType = validateDatatype(typeName);
       if (parmType == null)
       {
-         ErrorManager.displayError(9051,
-               String.format("Illegal datatype given in ADD-NEW-FIELD %s", typeName),
-               false);
+         recordOrShowError(9051,
+                           String.format("Illegal datatype given in ADD-NEW-FIELD %s", typeName),
+                           true,
+                           false);
 
          return new logical(false);
       }
@@ -1333,8 +1335,10 @@
          formatStr = format.getValue();
          if (!validateFormat(parmType, formatStr))
          {
-            String spec = "Illegal format given in ADD-NEW-FIELD %s";
-            ErrorManager.recordOrShowError(9052, String.format(spec, formatStr), false);
+            recordOrShowError(9052,
+                              String.format("Illegal format given in ADD-NEW-FIELD %s", formatStr),
+                              true,
+                              false);
             return new logical(false);
          }
       }
@@ -1513,9 +1517,10 @@
       int pos = fullSource.lastIndexOf('.');
       if (pos < 0)
       {
-         ErrorManager.displayError(9053,
-                                   "Field-name in ADD-LIKE-FIELD must have a table qualifier",
-                                   false);
+         recordOrShowError(9053,
+                           "Field-name in ADD-LIKE-FIELD must have a table qualifier",
+                           true,
+                           false);
          return new logical(false);
       }
       
@@ -1612,9 +1617,10 @@
       }
       else
       {
-         ErrorManager.displayError(9056,
-                                   "ADD-LIKE-FIELD requires valid BUFFER-FIELD object",
-                                   false);
+         recordOrShowError(9056,
+                           "ADD-LIKE-FIELD requires valid BUFFER-FIELD object",
+                           true,
+                           false);
          return new logical(false);
       }
       
@@ -1805,9 +1811,10 @@
          {
             if (!ascVal.startsWith("desc"))
             {
-               ErrorManager.displayError(9062,
-                             "Third argument to ADD-INDEX-FIELD must be DESC or ASC, in quotes",
-                             false);
+               recordOrShowError(9062,
+                                 "Third argument to ADD-INDEX-FIELD must be DESC or ASC, in quotes",
+                                 true,
+                                 false);
                return new logical(false);
             }
          }
@@ -1850,7 +1857,7 @@
       
       if (!index.isWord() && p2jField.getExtent() > 0)
       {
-         ErrorManager.displayError(370, "Array fields cannot be Index-Fields");
+         recordOrShowError(370, "Array fields cannot be Index-Fields", true, true);
          return new logical(false);
       }
       
@@ -2163,17 +2170,17 @@
       
       if (tableName == null)
       {
-         ErrorManager.displayError(9046, "Unable to PREPARE TEMP-TABLE buffer object", false);
+         recordOrShowError(9046, "Unable to PREPARE TEMP-TABLE buffer object", true, false);
          forceClear();
          return new logical(false);
       }
       
       if (fields.size() == 0)
       {
-         ErrorManager.displayError(9033,
-                                   "TEMP-TABLE object must have at least one field before " +
-                                   "TEMP-TABLE-PREPARE can be called",
-                                   false);
+         recordOrShowError(9033,
+                           "TEMP-TABLE object must have at least one field before TEMP-TABLE-PREPARE can be called",
+                           true,
+                           false);
          displayUnableToPrepareTableFields();
          forceClear();
          return new logical(false);
@@ -2183,9 +2190,10 @@
       int nameLength = tableName.length();
       if (nameLength == 0 || nameLength > 32)
       {
-         ErrorManager.displayError(1700,
-                                   "Identifier was left blank or is more than 32 characters",
-                                   false);
+         recordOrShowError(1700,
+                           "Identifier was left blank or is more than 32 characters",
+                           true,
+                           false);
          displayUnableToPrepareTableFields();
          forceClear();
          return new logical(false);
@@ -2194,7 +2202,10 @@
       char fistChar = tableName.charAt(0);
       if (fistChar != '_' && !Character.isLetter(fistChar))
       {
-         ErrorManager.displayError(257, "The first character of " + tableName + " must be alphabetic");
+         recordOrShowError(257,
+                           "The first character of " + tableName + " must be alphabetic",
+                           true,
+                           true);
          displayUnableToPrepareTableFields();
          forceClear();
          return new logical(false);
@@ -2205,8 +2216,10 @@
          char c = tableName.charAt(i);
          if (!Character.isLetter(c) && !Character.isDigit(c) && !allowedSpecialChars.contains(c))
          {
-            ErrorManager.displayError(274,
-                     String.format("The character %s is not permitted in name %s", c, tableName));
+            recordOrShowError(274,
+                              String.format("The character %s is not permitted in name %s", c, tableName),
+                              true,
+                              true);
             displayUnableToPrepareTableFields();
             forceClear();
             return new logical(false);
@@ -2222,7 +2235,7 @@
             ParmType type = entry.getValue().getType();
             if (type == ParmType.CLOB || type == ParmType.BLOB)
             {
-               ErrorManager.recordOrShowError(14435);
+               recordOrShowError(14435);
                // Large object fields can only be defined in NO-UNDO Temp-Tables
                
                displayUnableToPrepareTableFields();
@@ -2241,9 +2254,10 @@
             if (foundPrimary)
             {
                // there are multiple primary indexes
-               ErrorManager.displayError(3389,
-                                         "TEMP-TABLE  must have only one primary key",
-                                         false);
+               recordOrShowError(3389,
+                                 "TEMP-TABLE  must have only one primary key",
+                                 true,
+                                 false);
                displayUnableToPrepareTableIndices();
                forceClear();
                return new logical(false);
@@ -2256,10 +2270,10 @@
          
          if (index.size() == 0)
          {
-            ErrorManager.displayError(
-                 9029,
-                 String.format("TEMP-TABLE index %s needs at least 1 component", index.getName()),
-                 false);
+            recordOrShowError(9029,
+                              String.format("TEMP-TABLE index %s needs at least 1 component", index.getName()),
+                              true,
+                              false);
             displayUnableToPrepareTableIndices();
             forceClear();
             return new logical(false);
@@ -2674,9 +2688,10 @@
    {
       if (name.isUnknown())
       {
-         ErrorManager.displayError(4083,
-               "**Unable to assign UNKNOWN value to attribute NAME on TEMP-TABLE widget",
-               false);
+         recordOrShowError(4083,
+                           "Unable to assign UNKNOWN value to attribute NAME on TEMP-TABLE widget",
+                           true,
+                           true);
          return;
       }
       
@@ -3225,7 +3240,7 @@
     */
    private void displayUnableToPrepareTableFields()
    {
-      ErrorManager.displayError(9044, "Unable to prepare TEMP-TABLE fields", false);
+      recordOrShowError(9044, "Unable to prepare TEMP-TABLE fields", true, false);
    }
    
    /**
@@ -3233,7 +3248,7 @@
     */
    private void displayUnableToPrepareTableIndices()
    {
-      ErrorManager.displayError(9045, "Unable to prepare TEMP-TABLE indices", false);
+      recordOrShowError(9045, "Unable to prepare TEMP-TABLE indices", true, false);
    }
    
    /**
@@ -3241,9 +3256,10 @@
     */
    private void displayUnableToEvaluate()
    {
-      ErrorManager.displayError(9050,
-                                "Unable to evaluate arguments for TEMP-TABLE method",
-                                false);
+      recordOrShowError(9050,
+                        "Unable to evaluate arguments for TEMP-TABLE method",
+                        true,
+                        false);
    }
    
    /**
@@ -3255,10 +3271,10 @@
     */
    private void displayCouldNotFindLikeTable(String tableName)
    {
-      ErrorManager.displayError(9054,
-                                String.format("Could not find table %s during ADD-LIKE-FIELD." +
-                                              "  Table names must not be abbreviated", tableName),
-                                false);
+      recordOrShowError(9054,
+                        String.format("Could not find table %s during ADD-LIKE-FIELD. Table names must not be abbreviated", tableName),
+                        true,
+                        false);
    }
    
    /**
@@ -3269,9 +3285,10 @@
     */
    private void displayCouldNotFindLikeTableName(String tableName)
    {
-      ErrorManager.displayError(9057,
-                 String.format("TEMP-TABLE method could not find LIKE table name %s", tableName),
-                 false);
+      recordOrShowError(9057,
+                        String.format("TEMP-TABLE method could not find LIKE table name %s", tableName),
+                        true,
+                        false);
    }
    
    /**
@@ -3282,9 +3299,10 @@
     */
    private void displayDuplicateIndex(String indexName)
    {
-      ErrorManager.displayError(3390,
-                             String.format("Duplicate index name %s for temp-table ", indexName),
-                             false);
+      recordOrShowError(3390,
+                        String.format("Duplicate index name %s for temp-table ", indexName),
+                        true,
+                        false);
    }
    
    /**
@@ -3295,9 +3313,10 @@
     */
    private void displayCouldNotFindLikeField(String fieldName)
    {
-      ErrorManager.displayError(9055,
-               String.format("Could not find source field %s during ADD-LIKE-FIELD", fieldName),
-               false);
+      recordOrShowError(9055,
+                        String.format("Could not find source field %s during ADD-LIKE-FIELD", fieldName),
+                        true,
+                        false);
    }
    
    /**
@@ -3311,11 +3330,10 @@
     */
    private void displayCouldNotFindLikeIndex(String tableName, String indexName)
    {
-      ErrorManager.displayError(9059,
-                              String.format("ADD-LIKE-INDEX could not find index %s in table %s",
-                                            indexName,
-                                            tableName),
-                              false);
+      recordOrShowError(9059,
+                        String.format("ADD-LIKE-INDEX could not find index %s in table %s", indexName, tableName),
+                        true,
+                        false);
    }
    
    /**
@@ -3326,10 +3344,10 @@
     */
    private void displayCouldNotFindAddIndex(String indexName)
    {
-      ErrorManager.displayError(9061,
-            String.format("Could not find index %s during ADD-INDEX-FIELD",
-                          indexName),
-            false);
+      recordOrShowError(9061,
+                        String.format("Could not find index %s during ADD-INDEX-FIELD", indexName),
+                        true,
+                        false);
    }
    
    /**
@@ -3337,9 +3355,10 @@
     */
    private void displayUnableToCreateLikeIndex()
    {
-      ErrorManager.displayError(9060,
-                                "Unable to create index for TEMP-TABLE in ADD-LIKE-INDEX",
-                                false);
+      recordOrShowError(9060,
+                        "Unable to create index for TEMP-TABLE in ADD-LIKE-INDEX",
+                        true,
+                        false);
    }
    
    /**
@@ -3353,11 +3372,10 @@
     */
    private void displayDuplicateOrInvalidIndexField(String indexName, String fieldName)
    {
-      ErrorManager.displayError(9063,
-       String.format("Attempt to add duplicate or inappropriate word index field %s to index %s",
-                     fieldName,
-                     indexName),
-                     false);
+      recordOrShowError(9063,
+                        String.format("Attempt to add duplicate or inappropriate word index field %s to index %s", fieldName, indexName),
+                        true,
+                        false);
    }
    
    /**
@@ -3370,9 +3388,10 @@
     */
    private void displayUnableToFindIndex(String tableName, String indexName)
    {
-      ErrorManager.displayError(9048,
-                  String.format("Unable to find index %s in table %s", indexName, tableName),
-                  false);
+      recordOrShowError(9048,
+                        String.format("Unable to find index %s in table %s", indexName, tableName),
+                        true,
+                        false);
    }
    
    /**

