A Simple Tip for Handling Clarion Errors

by Stu Andrews on April 25, 2007

in Blog

When manipulating data files in code, you can check after each operation for errors.

Here’s an example:


clear(peo:Record)

peo:EnteredDate = _:FirstDayOfYearset(peo:keyEntered,peo:keyEntered)

loop	

  next(People)	

  if ((errorcode() = 33) or (peo:EnteredDate > today())

    break

  elsif errorcode()

    _AddError(_:ProcedureName,'routinename',subject,body)

  end

end

So what’s going on?

When you’re running an error check, there are certain errors that should be handled with special care, contextually based on the preceeding command.

After a next() I know that (errorcode() = 33) means "forgeddabout it, this baby is all done".

The other errorcode()’s to watch out for are

  • = 35 .. You’ve done a get() on a File, and the record (from the primed values + key in the get()) doesn’t exist
  • = 30 .. You’ve done a get() on a Queue, and the record doesn’t exist

Those three are the most frequent errors I check for.

Let’s lay them out one more time.

30 .. get() on Queue, record doesn’t exist.

33 .. next() on File, record doesn’t exist.

35 .. get() on File, record doesn’t exist.

Another quick tip from the simple minds at PimpMyClarion. Simple.

Popularity: 4%

Related posts:

  1. Sibisy, The Simple Billing System
  2. The Story of a Homegrown Clarion Template
  3. I Like Walks On The Beach With Dolphins And Sharks
  4. Word Hard At Being Simple
  5. Clarion Templates :: File Manager 3

Leave a Comment

Previous post:

Next post: