Friday Fun

dbacdog

Member
Progress 11.4
I"m not a developer, however i was a long time ago, we were on version 6 of Progress when i was a developer. So i feel like i still use the version 6 statements and command.

Which statements should i use for the current version of Progress we are on
Code:
  def var v-create as int no-undo.
def var v-copy as int no-undo.
def var v-copy2 as int no-undo.
def var v-create2 as int no-undo.

DISABLE TRIGGERS FOR LOAD OF carolina.oeel allow-replication.
/*DISABLE TRIGGERS FOR LOAD OF daily.oeel allow-replication.
  */

for each daily.oeel table-scan where daily.oeel.cono = 1
                           no-lock:
   pause 0.
   find carolina.oeel where daily.oeel.cono = carolina.oeel.cono and
                   daily.oeel.orderno = carolina.oeel.orderno and
                   daily.oeel.ordersuf = carolina.oeel.ordersuf and
                   daily.oeel.lineno = carolina.oeel.lineno
                   exclusive-lock no-error.
   if not available carolina.oeel then do:
      create carolina.oeel.
      buffer-copy daily.oeel to carolina.oeel.
      v-copy = v-copy + 1.
   end.

   status default string(v-copy) + " " + string(v-create) +
        " " + string(v-copy2) + " " + string(v-create2).

end.
Thanks in advance!
 
Last edited by a moderator:

TomBascom

Curmudgeon
You should start by using code formatting for code samples. You should also tell us something about what it is that you would like to improve. There is nothing necessarily _wrong_ with v6 statements per se.

FWIW I strongly suggest that you drop the habit of prefixing identifiers with useless gobbledygook like “v-“. That sort of “Hungarian Notation” adds no value and reduces code readability. Even Microsoft has admitted it was a dumb idea.
 

Stefan

Well-Known Member
FWIW I strongly suggest that you drop the habit of prefixing identifiers with useless gobbledygook like “v-“. That sort of “Hungarian Notation” adds no value and reduces code readability. Even Microsoft has admitted it was a dumb idea.

While I dislike v- gobbledygook, I do like the rest of my goulash, since there are just too many keywords in the language to use what you would normally use as a name, as a name.

Code:
def var create as int no-undo.

Code:
** The keyword create may not be used as a name. (329)
**  Could not understand line 1. (196)

Although in this case, the name 'created' makes much more sense than 'create' since these variables are indicating work that was done in the past.
 
Last edited:

TomBascom

Curmudgeon
One improvement that I can suggest - I would replace this:
Code:
status default string(v-copy) + " " + string(v-create) +
" " + string(v-copy2) + " " + string(v-create2).

with something like this:
Code:
status default substitute( "&1 &2 &3 &4", copied, created, copied2, created2 ).

I would also suggest that you take a look at your monitor and realize that 24x80 died 30 years ago. My current default window size is 72x160 and I format my code for at least that width.
 

TomBascom

Curmudgeon
I often use the SSH / HTERM extension with Chrome. It is a very nice terminal that works like a charm. And it is available everywhere. I also use the "term" built-in to MacOS. And I use PuTTY quite a lot as well. A PROENV Window on DOS even looks reasonable so long as you change the default font as well as the window size. "Lucida" and "Consola" are good options.

You could also probably benefit from a better protermcap. (The default protermcap does really stupid things like reset the window width on startup.) Oddly enough there is just such an improved protermcap provided with ProTop ;).
 
Top