home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / calculat / pibcal11.zip / ERRORS.PAS < prev    next >
Pascal/Delphi Source File  |  1985-03-08  |  5KB  |  108 lines

  1. (*--------------------------------------------------------------------------*)
  2. (*                      Error --- Report execution error                    *)
  3. (*--------------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Error( E_Mess: AnyStr );
  6.  
  7. (*--------------------------------------------------------------------------*)
  8. (*                                                                          *)
  9. (*     Procedure:  Error                                                    *)
  10. (*                                                                          *)
  11. (*     Purpose:    Reports execution error                                  *)
  12. (*                                                                          *)
  13. (*     Calling Sequence:                                                    *)
  14. (*                                                                          *)
  15. (*        Error( E_Mess : AnyStr );                                         *)
  16. (*                                                                          *)
  17. (*           E_Mess --- Text of error message to be printed                 *)
  18. (*                                                                          *)
  19. (*     Calls:   TextColor                                                   *)
  20. (*                                                                          *)
  21. (*--------------------------------------------------------------------------*)
  22.  
  23. VAR
  24.    i: INTEGER;
  25.  
  26. BEGIN (* Error *)
  27.  
  28.    TEXTCOLOR( Error_Message_Color );
  29.  
  30.    WRITELN;
  31.    WRITELN( E_Mess );
  32.  
  33.    ErrorFlag := TRUE;
  34.  
  35.    TEXTCOLOR( ForeGround_Color );
  36.  
  37. END   (* Error *);
  38.  
  39. (*--------------------------------------------------------------------------*)
  40. (*                      SynErr --- Report syntax error                      *)
  41. (*--------------------------------------------------------------------------*)
  42.  
  43. PROCEDURE SynErr;
  44.  
  45. (*--------------------------------------------------------------------------*)
  46. (*                                                                          *)
  47. (*     Procedure:  SynErr                                                   *)
  48. (*                                                                          *)
  49. (*     Purpose:    Reports syntax error                                     *)
  50. (*                                                                          *)
  51. (*     Calling Sequence:                                                    *)
  52. (*                                                                          *)
  53. (*        SynErr;                                                           *)
  54. (*                                                                          *)
  55. (*     Calls:   TextColor                                                   *)
  56. (*                                                                          *)
  57. (*--------------------------------------------------------------------------*)
  58.  
  59. BEGIN (* SynErr *)
  60.  
  61.    IF ( NOT ErrorFlag ) THEN
  62.       BEGIN
  63.  
  64.          TEXTCOLOR( Error_Message_Color );
  65.  
  66.          WRITELN;
  67.          WRITELN('Syntax Error');
  68.  
  69.          TEXTCOLOR( ForeGround_Color );
  70.  
  71.          ErrorFlag := TRUE;
  72.  
  73.       END;
  74.  
  75. END   (* SynErr *);
  76.  
  77. (*--------------------------------------------------------------------------*)
  78. (*                Undef --- Reports variable is undefined                   *)
  79. (*--------------------------------------------------------------------------*)
  80.  
  81. PROCEDURE Undef( v: Varnamty );
  82.  
  83. (*--------------------------------------------------------------------------*)
  84. (*                                                                          *)
  85. (*     Procedure:  Undef                                                    *)
  86. (*                                                                          *)
  87. (*     Purpose:    Reports variable is undefined                            *)
  88. (*                                                                          *)
  89. (*     Calling Sequence:                                                    *)
  90. (*                                                                          *)
  91. (*        Undef( v: Varnamty );                                             *)
  92. (*                                                                          *)
  93. (*     Calls:   TextColor                                                   *)
  94. (*                                                                          *)
  95. (*--------------------------------------------------------------------------*)
  96.  
  97. BEGIN  (* Undef *)
  98.  
  99.    TEXTCOLOR( Error_Message_Color );
  100.  
  101.    WRITELN(v,' is undefined');
  102.  
  103.    TEXTCOLOR( ForeGround_Color );
  104.  
  105.    ErrorFlag := TRUE;
  106.  
  107. END    (* Undef *);
  108.