delete object file before stow

Hi,

is it possible to delete the old object file, bevor I’m stowing the new source file?

The best way would be, that I only stow the new sourcen and the old object file will be deleted automaticly.

When I have a bug in the source file, there will be no object file.

Is this possible?

Best regards,

Markus Wessjohann

UNCAT

Is it possible todo it with every STOW/CAT?

Without UNCAT ; CAT ?

Hi Markus;

Sorry, I did not understand at first what you wanted. Hence, my one word response, UNCAT, was not what you were looking for. I have a solution for you; however before presenting it, let me tell you why I came up with the solution.

Years ago, I had an annoying problem. I teach Natural classes. I teach them “live”; that is I run code, not display powerpoints. Suppose I have a program, PROG1, in the editor. A student asks a question. To answer the question, I make a couple of changes to PROG1. Then I SAVE PROG2. Then I type R (I am a lazy typist). Perhaps another student suggests a change to the code. I make the change and type SA. WHOOPS. I have just overwritten PROG1, not PROG2. When you do SAVE PROG2, the name that appears at the top of the editing area is still PROG1.

I decided that what Natural needed was a SAVE AS editor command as well as SAVE. What to do? I created a simple program, called XX, shown below (it must be STOW’ed, not just SAVE’d):

DEFINE DATA LOCAL
1 #NAME (A8 )
END-DEFINE
*
INPUT #NAME
STACK TOP COMMAND ‘EDIT’ #NAME
STACK TOP COMMAND ‘SAVE’ #NAME
END

If I have PROG1 in the editor, and type the command XX PROG2, I am now working with PROG2 in the editor, not PROG1. This made life a lot simpler for me. I no longer destroyed programs in my teaching library.

What does this have to do with your problem? You can create a program like:

DEFINE DATA LOCAL
1 #NAME (A8 )
END-DEFINE
*
INPUT #NAME
STACK TOP COMMAND ‘STOW’
STACK TOP COMMAND ‘UNCAT’ #NAME
END

Call the program whatever you want (as a lazy typist I suggest a two character name like UN).

Now suppose you are working in the editor with PROG1. You type UN PROG1. The object code for PROG1 will disappear. The source code for PROG1 will be the “old” version of PROG1 (prior to any changes you made without saving). Of course, you can type SA to simply make the library source code the same as the program editor.

Natural can be a lot of fun to work with :smiley:

I thinks there’s no option to change the behaviour of STOW.

There’s just the simple formula:

STOW = CHECK + SAVE + CAT

If CHECK fails, no SAVE and no CAT is done.

@Steve: Thanks, I try to intregrate this in my developing process, but I’m not using the terminal :frowning:

@Matthias: That’s right, but not exactly what I wanted.

Situation:

  1. EDIT PROG1 with no error
  2. STOW PROG1
  3. EDIT PROG1 with error
  4. SAVE PROG1
  5. STOW PROG1 => no SAVE, no CAT

Now I have object files from Step 1. and the source from Step 4. To find this bugs are quite hard.

I thought there is a parameter, to do a UNCAT before very STOW/CAT.

Best regards,

Markus Wessjohann

The problem is your Step 4.

If you are trying to keep source and object in synch, you should not use SAVE (or just CAT for that matter). You should instead do 4. STOW PROG1. This results in no changes to either source or object.

You still have the results of step 2 in your library.

If it is time to go home for the day, you can do a SAVE PROG1H , where the H means HOLD. When you come back the next day, E PROG1H and work from there.

The best way to overcome this problem is using NaturalONE.
If you work on source code in NaturalONE and then deploy it to a server, there is a
parameter that can be set, that the source code is deleted after the stow on the server.
this does mean, that you have always one location where your source code is stored namely in
NaturalONE workspace and /or a repository like subversion.

Sorry, we are using a different IDE.