Craziest Progressism?

GregTomkins

Active Member
Incented by the 'for each with rowid' post, our group spent all day looking for weird Progress behaviours. It's a long list, but here's my favorite!

Code:
def var h_char as char init today.
message h_char.

Of course, this doesn't actually matter at all. It does make you wonder what lurks in the depths, though?
 

davidvilla

Member
Incented by the 'for each with rowid' post, our group spent all day looking for weird Progress behaviours. It's a long list, but here's my favorite!

Code:
def var h_char as char init today.
message h_char.

Of course, this doesn't actually matter at all. It does make you wonder what lurks in the depths, though?


I think you can set anything to a CHAR variable without quotes and it stores it.

define variable mychar as char init 12445.
disp mychar

result: 12445

define variable mychar as char init 11/5/15.
disp mychar

result: 11/5/15
 

kolonuk

Member
...and technically
Code:
DEF VAR v_Logi AS LOGI.
v_Logi = ?.
is a Progressism - what other languages have a three-state boolean?
 

RealHeavyDude

Well-Known Member
IMHO - that is not quite right. The third state theoretically means that it is undefined. Compared with the primitive boolean in Java one might argue that his could be right. Compared with a Boolean object one might argue that it is the same as the object reference being null.

Code:
private Boolean myBoolean = null;

But yes, practically you can work with the "3rd state" being null.

Heavy Regards, RealHeavyDude.
 

GregTomkins

Active Member
Code:
RUN program.p(INPUT v_Var1,OUTPUT v_Var2)(v_RandomVariable).

IIRC, 'v_RandomVariable' (and any number of similar tokens following it) will get passed to program.p as a run-time argument, which the called program may choose to ignore. So I think this is a case of 'unusual, but as documented'.

This is a variation of include files, and harks back to a bygone era of compile-on-the-fly unholiness (who else remembers when functions and internal procedures were the hot new feature? v7 maybe? I hear that even DEF PARAM was a cool new thing at one point, but I'm not quite old enough to remember THAT).
 

jongpau

Member
Ok. I'm showing my age but:

User defined functions were version 8

Internal procedures were v7

DEFINE PARAMETER was v5
Not so much language related so a somewhat off-topic but I certainly remember the struggle with the r-code size limitations (what was it, 32kb max for a .r?). And then of course there was of the "fantastic" code editor prior to v6 where one wrong keystroke could overwrite your hard work with an empty file. Oh yes, we are getting old
 

GregTomkins

Active Member
Oh man, this must be a sign of serious mental health issues on my part, that totally made my day !!! In a similar vein:

Code:
buffer some-table:handle:FIND-FIRST("",6207).
 

Stefan

Well-Known Member
We had lots of fun with the 64k e-code limits in 9.1 and defined variables to use for often used constants.

Code:
define variable ltrue as logical no-undo initial true.
define variable lfalse as logical no-undo.
define variable i0 as integer no-undo.
 

GregTomkins

Active Member
My documentation-inhaling coworker points out that it is, at least, documented (in the CHR function):

The CHR function returns a null string if the expression yields a value outside of the range 1 to 65534 or the expression yields a value in the range 256 to 65534 and the value does not correspond to a valid lead‑byte.

Kind of reminds me of those ISO-9000 "lifejackets made out of concrete" stories, though.
 

andre42

Member
Code:
RUN program.p(INPUT v_Var1,OUTPUT v_Var2)(v_RandomVariable).

IIRC, 'v_RandomVariable' (and any number of similar tokens following it) will get passed to program.p as a run-time argument, which the called program may choose to ignore. So I think this is a case of 'unusual, but as documented'.

This is a variation of include files, and harks back to a bygone era of compile-on-the-fly unholiness (who else remembers when functions and internal procedures were the hot new feature? v7 maybe? I hear that even DEF PARAM was a cool new thing at one point, but I'm not quite old enough to remember THAT).

Indeed. If you run this in a production environment without source code you will get a runtime error (STOP error, probably) because program.p can't be compiled. One time such an error slipped by our QA. Apparently they also had source code in addition to .r-Code.

My documentation-inhaling coworker points out that it is, at least, documented (in the CHR function):

The CHR function returns a null string if the expression yields a value outside of the range 1 to 65534 or the expression yields a value in the range 256 to 65534 and the value does not correspond to a valid lead‑byte.

And of course you have to keep in mind that string that only differ by trailing spaces are considered equal.
 
Top