Simple Practices to Enhance Your Daily Development

As time passes, our brains develop routines for what we do. Development is no exception. My brain has half a hundred (or maybe more) little routines that it’s been trained to enact when certain requirements are fulfilled.

There are generic practices that hold across most disciplines. These are especially easy to see when working with computers. How the keyboard and mouse interact. What tools are best to use for a particular job. Processes already in place in the system to allow greater efficiency.

In my (relatively short) time as a Clarion Dev, I’ve managed to accumulate a number of wonderful practices that without which, I would be a lot slower. Not that I’m quick, but I’m quicker with these in place.

My plan is for this post to grow via input from around the world, as well as my own as I come across them. Here be the (dragon) information.

Keep in mind too, that this post is tailored for folk who are new to the Clarion world.

 

[ctrl] Y    Remove Line

A very nifty trick (thanks Brett and Devan), this removes the line of code the cursor is situated on. Nice!

 

F10    Extended Text Dialog 

As of Clarion 6.1 (ish, ?) you can press F10 in an entry field within the templates to get an Extended Text Dialog window pop up, allowing you to "see" much more of what you are typing.

Great for Filters and other places where you sometimes type quite a long line of code!

 

[ctrl] R    Compile

Possibly the most used in my arsenal of speedy cyborg brain enhancements. Buttons are old-school, Twin keystrokes are the new web 2.0!

 

[ctrl] S    Save

This one I learned from MS Office. It’s been beaten into my subconscious routine. Always pressed, after most actions, unless I specifically don’t want to save.

 

[alt] M->E    Comment All

This one is great. Highlight 1 or more lines of code (SHIFT and arrow keys), then press this key sequence and it’s all Commented Out. OUT. Nice.

[alt] E -> M, ESC, [enter] on yes for the "are you sure", [ctrl] S (just for consistency, even though the compiler saves before .. compiling), [ctrl] R.

 

Embeds

– Embeds are a single-click away. Why go through multiple clicks/windows?

windowslivewritersimplewaystoenhanceyourdailydevelopment-14568embedtip26

A Simple Tip for Handling Clarion Errors

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.