[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]] ==== Compiler problem with Inserts (OpenInsight 32-bit Specific) ==== === At 29 AUG 2002 12:55:33AM Peter Lynch wrote: === {{tag>"OpenInsight 32-bit Specific"}} 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: === [i]P.S. Note the astute use of the DUMMY argument[/i] Why was that necessary? dbakke@srpcs.com [url=http://www.srpcs.com]SRP Computer Solutions, Inc.[/url] [img]http://www.srpcs.com/srpicon1.gif[/img] ---- === 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. :-D - Oystein - ---- === At 29 AUG 2002 04:22AM Peter Lynch wrote: === ----- DUMMY header -------- I enjoy a productive argument. I like the topic. ----- DUMMY trailer ------- [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=39FF94DA1E5871DA85256C24001B0F57|View this thread on the forum...]]