/*******************************************************/
/*                                                     */
/*             Dansk - version 29.12.88                */
/*                                                     */
/*******************************************************/

#include "comal/comal.h"

#define AND &&
#define OR ||
#define begin {
#define end }

STRPTR ErrTxtTab[] =
  begin
    "001: Ulovligt tegn",
    "002: Ulovligt linjenummer",
    "003: Tekstkonstant for lang",
    "004: Variabel forventet",
    "005: Konstant forventet",
    "006: Taludtryk forventet",
    "007: Tekstudtryk forventet",
    "008: \'(\' forventet",
    "009: \')\' forventet"
  end;

#define maxerr 9

int strlen(s)
STRPTR s;
begin
  int i;

  for (i=0; *s != '\0'; s++) i++ ;
  return i;
end

void ErrTxt(wrkspc,wrktop)
int *wrkspc,*wrktop;
begin
  int err;
  struct valparam ErrorText;

  err = *(--wrkspc);
  if ( err<=maxerr )
    begin
      ErrorText.d2 = (long)ErrTxtTab[err-1];
      ErrorText.d3 = strlen(ErrTxtTab[err-1]);
    end
  else
    ErrorText.d3 = 0;
  RetValue(ErrorText);    
end

void init(pck)
struct package *pck;
begin
  pck->var = NULL;
  pck->ErrTxt = &ErrTxt;
  pck->Flags  |= ErrTxtFlag;
  pck->Priority = -20;
end
