Compiler problem with Inserts (OpenInsight 32-bit Specific)
At 29 AUG 2002 12:55:33AM Peter Lynch wrote:
It appears that the compiler does not like a $INSERT to be on the first line -
If I compile this -
FUNCTION DEMOTE (FIELD, DUMMY)
_ $INSERT ARGNOSIS_INSERTS, ARRAY_PROMOTION
_ DEMOTED=FIELD
_ CONVERT PROMOTED_ARRAY@ TO DEMOTED_ARRAY@ IN DEMOTED
RETURN DEMOTED
I get this error message -
B102: Line 2. Illegal Statement: $INSERT ARGNOSIS_INSERTS,ARRAY_PROMOTION.
If I compile this -
FUNCTION DEMOTE (FIELD, DUMMY)
**
_ $INSERT ARGNOSIS_INSERTS, ARRAY_PROMOTION
_ DEMOTED=FIELD
_ CONVERT PROMOTED_ARRAY@ TO DEMOTED_ARRAY@ IN DEMOTED
RETURN DEMOTED
It compiles just fine.
P.S. Note the astute use of the DUMMY argument
At 29 AUG 2002 01:13AM Donald Bakke wrote:
P.S. Note the astute use of the DUMMY argument
Why was that necessary?
dbakke@srpcs.com
At 29 AUG 2002 01:56AM Peter Lynch wrote:
Off the top of my head, two reasons
1. I like DUMMY arguments so much that I can foresee Revtech enforcing
255 arguments per Subroutine (and 254 for Functions of course),
so I am including a DUMMY argument in ALL calls.
2. The dummy argument allows me to extend the language syntax.
E.g.
The DIRLIST function can now be both local and global -
_ DECLARE SUBROUTINE DIRLIST
_ FILES=DIRLIST()
_ ECHIDNAS=DIRLIST(DUMMY)
Wow!
At 29 AUG 2002 02:05AM Peter Lynch wrote:
That is
DECLARE FUNCTION DIRLIST, not SUBROUTINE - sorry about that
At 29 AUG 2002 03:31AM Oystein Reigem wrote:
Peter,
By Odin, you're right.
An empty line also does the trick. That's what's kept me from discovering it. I always have an empty line after the function or subroutine statement.
Btw - here's something else the compiler doesn't like: a comment line between begin case and the first case.
- Oystein -
At 29 AUG 2002 03:35AM Oystein Reigem wrote:
Peter,
That's a relief. I feared you'd taken my ramblings about dummy arguments a month ago seriously.
![]()
- Oystein -
At 29 AUG 2002 04:22AM Peter Lynch wrote:
—– DUMMY header ——–
I enjoy a productive argument.
I like the topic.
—– DUMMY trailer ——-