Module FMACDD

     1#REM  DataFlex standard MACROs
     2#REM  Copyright 1987-1997 Data Access Corporation, Miami FL, USA
     3#REM  All Rights reserved.
     4#REM  THIS IS THE FILE THAT DEFINES THE COMMANDS IN DATAFLEX VERSION 3.1
     5#REM  IT MUST BE PACKed INTO FLEX.CFL WITH THE COMMAND "DFPACK FMAC"
     6#REM  THIS SUPPORTS FMACS FOR BOTH 3.1 AND 4.0 (WINDOWS). THE COMPILER
     7#REM  VARIABLE IS$WINDOWS DETERMINES IF THIS IS CHARACTER MODE OR GUI.
     8
     9#REM Changes 5/20/98 -JJT
    10#REM    Changes in many commands to make this friendlier for VDF5.1
    11#REM       Changed syntax/Better error checking. Most commands are
    12#REM       added to the end. Note we now use !Zk, !Zl, !Zm, !Zn, !Zo
    13#REM       1. All changes marked JJT-5.1
    14
    15#REM  GENERAL FORMAT OF AN ICODE LINE:
    16
    17#REM  !A [] $000 ARG1 ARG2
    18#REM  !A Generates the next line number
    19#REM  [] is a place holder for the indicators
    20#REM  $000 is a hex number that calls the appropriate 'C' routine
    21#REM  arg1, arg2 - two arguments of any type/class
    22#REM           can be passed to the routine.
    23
    24#REM  THE FOLLOWING ARE THE COMPILE-TIME VARIABLES USED
    25#REM  UPPERCASE WILL AUTO-INCREMENT (FIRST);
    26#REM  LOWER CASE WILL NOT.  THEN SUBSTITUTE TO AN INTEGER VALUE.
    27
    28#REM  !A - Next line number
    29#REM  !B - Reserved
    30#REM  !C - Next indicator number
    31#REM  !D - Next integer number
    32#REM  !E - Autopage, window #
    33#REM  !F - Autopage, page #
    34#REM  G,H,I,J,K,L,M - You may use these
    35#REM  !N - Static nesting level
    36#REM  !O - Used by ?ET*ATTRIBUTE
    37#REM  !P - Used by report
    38#REM  !Q - Low level temporary
    39#REM  !R - Static structure number (Begin/End)
    40#REM  !S - Temporary used by end/loop/until
    41#REM  !T,!U - Reserved
    42#REM  !V - Next variable number.
    43#REM  !W - Reserved
    44#REM  !X - Temporary for enter & report - file numbers.
    45#REM  !Y - Temporary for keyproc
    46#REM  !Z - Reserved
    47
    48#REM Type checking in command args use negative logic and
    49#REM conform to the following:
    50
    51#REM C - Constant          V - Memory variable
    52#REM F - File element      G - Group
    53#REM W - Window
    54#REM S - String            E - Expression
    55#REM N - Number            L - Label
    56#REM D - Date              O - Group options
    57#REM I - Integer           B - Group indicators
    58#REM # - Indicator         . - No more arguments
    59#REM X - Not an indicator  R - Argument required
    60#REM T - Error if typed    $ - Changes window to string
    61#REM U - Error if untyped  "constant" - Must be constant
    62
    63#REM Example: #COMMAND EXAMPLE SND means arg1 cannot be string,number,or date
    64
    65#COMMAND ABORT &.
    66  !A [] $040
    67#ENDCOMMAND
    68
    69#COMMAND ACCEPT #L #L #LUC #LUWFC .
    70  #SET Q$ !0
    71  #IF !q=0
    72    AUTO2$ ACCEPT PAGE!f
    73  #ELSE
    74    #IF !q=1
    75      #IFCLASS !1 "G"
    76        AUTO2$ ACCEPT PAGE!f !1
    77      #ELSE
    78        #CHECK !1 _CVFG#L
    79        !A [] $1C1 !1 |CI0
    80      #ENDIF
    81    #ELSE
    82      #IF !q=2
    83        #IFCLASS !2 "G"
    84          #FORMAT !1 !2
    85          #CHECK !1 _CVFG#L
    86          !A [] $1C1 !1 |CI0
    87        #ELSE
    88          AUTO2$ ACCEPT PAGE!f TO !2
    89        #ENDIF
    90      #ELSE
    91        #IF !q>2
    92          #IFCLASS !3 "G"
    93            #CHECK !1 "TO"
    94            AUTO2$ ACCEPT PAGE!f TO !2 !3
    95          #ELSE
    96            #IFCLASS !4 "G"
    97              #FORMAT !1 !4
    98            #ENDIF
    99            #CHECK !1 _CVFG#L
   100            #CHECK !2 "TO"
   101            #CHECK !3 _CG#LE
   102            !A [] $1C1 !1 !3
   103          #ENDIF
   104        #ENDIF
   105      #ENDIF
   106    #ENDIF
   107  #ENDIF
   108#ENDCOMMAND
   109
   110#COMMAND APPEND #LGULCE$ #LGULR$
   111  !A [] $243 !1 !2
   112  #IF !0>2
   113    APPEND !1 !3 !4 !5 !6 !7 !8 !9
   114  #ENDIF
   115#ENDCOMMAND
   116
   117#COMMAND ASCII &#GRLU "TO" #UGRLCE .
   118  !A [] $247 !1 !3
   119#ENDCOMMAND
   120
   121#REM  The AUTO commands are used internally to generate the
   122#REM  next AUTOPAGE window number at compile time.
   123
   124#COMMAND AUTO2$
   125  !1 !2.!E !3 !4 !5
   126  #CHECK !2.!e _RUCVF#L
   127#ENDCOMMAND
   128
   129#COMMAND AUTO3$
   130  !1 !2 !3.!E !4 !5
   131  #CHECK !3.!e _RUCVF#L
   132#ENDCOMMAND
   133
   134#COMMAND AUTO4$
   135  !1 !2 !3 !4.!E !5
   136  #CHECK !4.!e _RUCVF#L
   137#ENDCOMMAND
   138
   139#COMMAND AUTOPAGE &T %USNVLE# .
   140  #CHECK !1.N _WFVSG#LU
   141  #SET F$ !1.N
   142  #SET E$ !2
   143  #IF !e>0
   144    #SET E$ !e-1
   145  #ENDIF
   146#ENDCOMMAND
   147
   148#REM BACKFIELD can only be used in a KEY PROCedure. It returns to the
   149#REM window (COMMAND) PRIOR to the one that called it.
   150
   151#COMMAND BACKFIELD &.
   152  !A [] $288
   153#ENDCOMMAND
   154
   155#COMMAND BEGIN &.
   156  #SET N$ !N
   157  #PUSH !R
   158  #XPUSH !n $INIT  // Init IF/ELSE stack at this nesting level.
   159  #IFIND //INCLUDE JUMPS IF INDICATORS ON LINE.
   160    // GOTO BEGIN$!r
   161    !A [] $041 |CI0
   162    #FREF BEGIN$!r !a
   163    #$ !A 0 0 0 $041 |CL0
   164    #FREF END$!r !a
   165  #ENDIF
   166  #$ BEGIN$!r:
   167#ENDCOMMAND
   168
   169#COMMAND BLANKFORM &%CVFG#EL  "THRU""THROUGH""" %CVFG#LUE .
   170  #IF !0>0
   171    #IFDEF !1
   172      !A [] $1C4 !1 !3
   173    #ELSE
   174      #CHECK !1.N _#RLGVU
   175      !A [] $1C4 !1.N
   176    #ENDIF
   177  #ELSE
   178    !A [] $1C4 |CI0
   179  #ENDIF
   180#ENDCOMMAND
   181
   182#COMMAND BREAK$             // does breakpoint for all
   183  #IF (!0>0)
   184    #IFCLASS !1 _F
   185      BREAKPOINT |CI!P !1
   186    #ELSE
   187      #CHECK !1 _LGBCVWIEOU#
   188    #ENDIF
   189  #ENDIF
   190  #IF (!0>1)
   191    BREAK$ !2 !3 !4 !5 !6 !7 !8 !9
   192  #ENDIF
   193#ENDCOMMAND
   194
   195#COMMAND BREAK$DOWN R           // does gosub to break
   196  #IF !x>0                // sections from N to 0
   197    #IF !0>1
   198      // GOSUB !1!x
   199      !A [] $42 |CL0
   200      #FREF !1!x !a
   201    #ELSE
   202      //[!x] GOSUB !1!x
   203      !A [!x] $42 |CL0
   204      #FREF !1!x !a
   205    #ENDIF
   206  #ENDIF
   207  #SET X$ !x-1
   208  #IF !x>0
   209    BREAK$DOWN !1 !2
   210  #ENDIF
   211#ENDCOMMAND
   212
   213#COMMAND BREAK$PRT          // prints all SUBHEADERs
   214  #IF !x<!p               // for page
   215    #IFDEF !1!X.N
   216      !A [~ !x] $202 !1!x.N  // OUTPUT
   217    #ENDIF
   218    BREAK$PRT !1 !2
   219  #ENDIF
   220#ENDCOMMAND
   221
   222#COMMAND BREAK$T3
   223  #IF !x<!p               // makes unused sections defined
   224    MAKEDEF$ RPT.SUBHEADER!X RPT.SUBTOTAL!x
   225    BREAK$T3
   226  #ENDIF
   227#ENDCOMMAND
   228
   229#COMMAND BREAK$UP           // does GOSUB to break
   230  #IF !x<!p               // sections from 0 to N
   231    #IF !0=1
   232      //[!X] GOSUB !1!x
   233      !A [!X] $42 |CL0
   234      #FREF !1!x !a
   235    #ELSE
   236      // GOSUB !1!X
   237      !A [] $42 |CL0
   238      #FREF !1!X !a
   239    #ENDIF
   240    BREAK$UP !1 !2
   241  #ENDIF
   242#ENDCOMMAND
   243
   244#COMMAND BREAKINIT  &.  // set up breakpoints for REPORT
   245  !A [] $207
   246#ENDCOMMAND
   247
   248#COMMAND BREAKPOINT &UVFW UCI   // test breakpoint and set indicators
   249  !A [] $204 !1 !2
   250#ENDCOMMAND
   251
   252#COMMAND CALCULATE &#ULG "TO" #UCLGER .
   253  #IFTYPE !3 "R"
   254    !A [] $085 !1 !3 //MOVE REAL
   255  #ELSE
   256    !A [] $081 !1 !3 //MOVE NUM
   257  #ENDIF
   258#ENDCOMMAND
   259
   260#COMMAND CHAIN RNDIG#L  NDG#L
   261  #SET Q$ 0
   262  #IFSAME !1 WAIT
   263    CHAIN$HELP !3 !4 !5 !6 !7 !8 !9
   264    !A [] $049 !2 |CI!q
   265  #ELSE
   266    #CHECK !1 _U
   267    CHAIN$HELP !2 !3 !4 !5 !6 !7 !8 !9
   268    !A [] $045 !1 |CI!q
   269  #ENDIF
   270#ENDCOMMAND
   271
   272#COMMAND CHAIN$HELP UVNDEG#L
   273  #IF (!0>0)
   274    #SET Q$ (!q+!1)
   275    CHAIN$HELP !2 !3 !4 !5 !6 !7 !8 !9
   276  #ENDIF
   277#ENDCOMMAND
   278
   279#COMMAND CHARACTER &#%GULD "TO" #GRULCE .
   280  !A [] $248 !1 !3
   281#ENDCOMMAND
   282
   283#COMMAND CLEAR_OPTION #LGRE . // Clears window options which
   284  #IFCLASS !1 _C           // have been set ON by set option
   285    #SET Q$ !1           // or by dfsetup.
   286    !A [] $04B |CI!q |CI0       // CLEAR_OPTION AUTORETURN
   287  #ELSE
   288    !A [] $04B !1 |CI0      // THIS COMMAND IS FOR INTERNAL USE.
   289  #ENDIF
   290#ENDCOMMAND
   291
   292#COMMAND CLEARFORM &%CVFG#LE  "THRU""THROUGH""" %CVFG#LUE .
   293  #IF !0>0
   294    #IFDEF !1
   295      !A [] $1C3 !1 !3 |CI0
   296    #ELSE
   297      #CHECK !1.N _R#LGVU
   298      !A [] $1C3 !1.N |CI0
   299    #ENDIF
   300  #ELSE
   301    !A [] $1C3 |CI0
   302  #ENDIF
   303#ENDCOMMAND
   304
   305#COMMAND CLEARSCREEN & .
   306  !A [] $144 !1
   307#ENDCOMMAND
   308
   309#COMMAND CLEARWARNING &.
   310  !A [] $048
   311#ENDCOMMAND
   312
   313#COMMAND CLEARXY &%#USGL %#USGLR .
   314  !A [] $146 !1 !2
   315#ENDCOMMAND
   316
   317#COMMAND CLOSE_INPUT
   318  #IFSAME !1 CHANNEL
   319    !A [] $10A |CI0 !2
   320  #ENDIF
   321  !A [] $100 |CS'CON:'
   322#ENDCOMMAND
   323
   324#COMMAND CLOSE_OUTPUT
   325  #IFSAME !1 CHANNEL
   326    !A [] $10A |CI1 !2
   327  #ENDIF
   328  !A [] $101 |CS'LST:'
   329#ENDCOMMAND
   330
   331#COMMAND CMDLINE &#RLUGE .
   332  !A [] $24A !1 |CS''
   333#ENDCOMMAND
   334
   335#COMMAND COPYFILE &#LGU "TO" R#LGU .
   336  !A [] $2C5 !1 !3
   337#ENDCOMMAND
   338
   339#COMMAND CONSTRAINT_SAVE_INIT .
   340  !A [] $0DE
   341#ENDCOMMAND
   342
   343#COMMAND CONSTRAINT_SET R#LG """DELETE""CLEAR"
   344  #IFSAME !2 DELETE
   345    !A [] $0DA !1    // DELETE
   346  #ELSE
   347    #IFSAME !2 CLEAR
   348      !A [] $0DA !1    // DELETE FIRST
   349    #ENDIF
   350    !A [] $0D0 !1   // QUERY ID
   351  #ENDIF
   352#ENDCOMMAND
   353
   354#COMMAND CONSTRAINT_VALIDATE .
   355  !A [] $0DF
   356#ENDCOMMAND
   357
   358#COMMAND CONSTRAINT_INIT r r "BY" r // mode file by index
   359  #IFSAME !1 $0 $1 $2 $3 $4 $5
   360    #SET Q$ !1
   361    MOVE |CI!q TO INDEX_NUMBER
   362  #ELSE
   363    MOVE !1 TO INDEX_NUMBER
   364  #ENDIF
   365  #IFDEF !2
   366    !A [] $0D6 !2 !4    // VARIABLE FILE NUMBER
   367  #ELSE
   368    #SET Q$ !2.RECNUM   // FILE NAME ONLY
   369    !A [] $0D6 |CI!q !4
   370  #ENDIF
   371#ENDCOMMAND
   372
   373#COMMAND CONSTRAINED_CLEAR
   374  #IF !0>0
   375    CONSTRAINT_INIT !1 !2 !3 !4
   376  #ENDIF
   377  !A [] $DC   // Find clear
   378#ENDCOMMAND
   379
   380#COMMAND CONSTRAINED_FIND // MODE FILE by INDEX
   381  #IFSAME !1 NEXT
   382    #IF !0>1
   383      !A [] $0D0 !2   // QUERY ID
   384    #ENDIF
   385    !A [] $D8       // find NEXT
   386  #ELSE
   387    #IFSAME !1 FIRST
   388      CONSTRAINED_CLEAR GE !2 !3 !4
   389    #ELSE
   390      #IFSAME !1 LAST
   391        CONSTRAINED_CLEAR LE !2 !3 !4
   392      #ELSE
   393        #IF !0>0
   394          CONSTRAINT_INIT !1 !2 !3 !4
   395        #ENDIF
   396        // THIS USES RB DATA ,IT DOES NOT CLEAR THE rb.
   397      #ENDIF
   398    #ENDIF
   399    !A [] $D7  |CI0 // find init, sets found on status of constrained relates.
   400    !A [FOUND] $D8  // find NEXT (first)
   401  #ENDIF
   402#ENDCOMMAND
   403
   404// JJT-5.1
   405//#COMMAND DATE TR
   406//  #NUM V$
   407//  #REPLACE !1 |VD!v
   408//  #IF (!0>1)
   409//    DATE !2 !3 !4 !5 !6 !7 !8 !9
   410//  #ENDIF
   411//#ENDCOMMAND
   412
   413#COMMAND DEBUG &.
   414  !A [] $044
   415#ENDCOMMAND
   416
   417#COMMAND DECREMENT #ELCRUG .
   418  #IFTYPE !1 "IV"
   419     !A [] $087 !1 |CI0
   420  #ELSE
   421     Move (!1 - 1) to !1
   422   #ENDIF
   423#ENDCOMMAND
   424
   425#COMMAND DESPOOL &.  // O/S dependent function
   426  !A [] $2C6
   427#ENDCOMMAND
   428
   429#COMMAND DIRECTORY &R#LGU .
   430  !A [] $2C4 !1
   431#ENDCOMMAND
   432
   433#COMMAND DIRECT_INPUT
   434  #IFSAME !1 CHANNEL
   435    !A [] $10A |CI0 !2
   436    #IF !0>2
   437      DIRECT_INPUT !3 !4
   438    #ENDIF
   439  #ELSE
   440    #IFSAME !1 RESOURCE
   441      #IFDEF !2 // allow variable string for resource name/id
   442        DIRECT_INPUT ('!1:' + string(!2)) !3 !4 !5 !6 !7 !8 !9
   443      #ELSE
   444        #SET Q$ !2.RSC
   445        !A [] $100 |CS"!1:!q"
   446      #ENDIF
   447    #ELSE
   448      #IFSAME !1 DBMS IMAGE
   449        #IFSAME !1 IMAGE
   450          #IFDEF !2 // allow variable for image number
   451            DIRECT_INPUT ('!1:' + string(!2)) !3 !4 !5 !6 !7 !8 !9
   452          #ELSE
   453            #SET Q$ !2.N
   454            !A [] $100 |CS"!1:!q"
   455          #ENDIF
   456        #ELSE
   457          #IFCLASS !2 "F" // if field ref, use as is
   458            !A [] $100 |CS"!1:!2"
   459          #ELSE
   460            #IFDEF !2 // for all classes/types, assume variable string for field ref
   461              DIRECT_INPUT ('!1:' + string(!2)) !3 !4 !5 !6 !7 !8 !9
   462            #ELSE
   463              #CHECK !2 _U // force cannot be untyped error.
   464            #ENDIF
   465          #ENDIF
   466        #ENDIF
   467      #ELSE
   468        #CHECK !2 .
   469        !A [] $100 !1
   470      #ENDIF
   471    #ENDIF
   472  #ENDIF
   473#ENDCOMMAND
   474
   475#COMMAND DIRECT_OUTPUT
   476  #IFSAME !1 CHANNEL
   477    !A [] $10A |CI1 !2
   478    #IF !0>2
   479      DIRECT_OUTPUT !3 !4
   480    #ENDIF
   481  #ELSE
   482    #IFSAME !1 DBMS IMAGE
   483      #IFSAME !1 IMAGE
   484        #IFDEF !2 // allow variable for image number
   485          DIRECT_OUTPUT ('!1:' + string(!2)) !3 !4 !5 !6 !7 !8 !9
   486        #ELSE
   487          #SET Q$ !2.N
   488          !A [] $101 |CS"!1:!q"
   489        #ENDIF
   490      #ELSE
   491        #IFCLASS !2 "F" // if field ref, use as is
   492          !A [] $101 |CS"!1:!2"
   493        #ELSE
   494          #IFDEF !2 // for all classes/types, assume variable string for field ref
   495            DIRECT_OUTPUT ('!1:' + string(!2)) !3 !4 !5 !6 !7 !8 !9
   496          #ELSE
   497            #CHECK !2 _U // force cannot be untyped error.
   498          #ENDIF
   499        #ENDIF
   500      #ENDIF
   501    #ELSE
   502      #CHECK !2 .
   503      !A [] $101 !1
   504    #ENDIF
   505  #ENDIF
   506#ENDCOMMAND
   507
   508#COMMAND APPEND_OUTPUT
   509  #IFSAME !1 CHANNEL
   510    !A [] $10A |CI1 !2
   511    #IF !0>2
   512      APPEND_OUTPUT !3 !4
   513    #ENDIF
   514  #ELSE
   515    #IFSAME !1 DBMS IMAGE
   516      #IFSAME !1 IMAGE
   517        #IFDEF !2 // allow variable for image number
   518          APPEND_OUTPUT ('!1:' + string(!2)) !3 !4 !5 !6 !7 !8 !9
   519        #ELSE
   520          #SET Q$ !2.N
   521          !A [] $101 |CS"!1:!q" |CI2
   522        #ENDIF
   523      #ELSE
   524        #IFCLASS !2 "F" // if field ref, use as is
   525          !A [] $101 |CS"!1:!2" |CI2
   526        #ELSE
   527          #IFDEF !2 // for all classes/types, assume variable string for field ref
   528            APPEND_OUTPUT ('!1:' + string(!2)) !3 !4 !5 !6 !7 !8 !9
   529          #ELSE
   530            #CHECK !2 _U // force cannot be untyped error.
   531          #ENDIF
   532        #ENDIF
   533      #ENDIF
   534    #ELSE
   535      #CHECK !2 .
   536      !A [] $101 !1 |CI2
   537    #ENDIF
   538  #ENDIF
   539#ENDCOMMAND
   540
   541#COMMAND DISKFREE #LIDNRUG "TO" #LDRCUGE .
   542  !A [] $2d5 !3 !1
   543#ENDCOMMAND
   544
   545#COMMAND DISPLAY RUG#L
   546  #IF !0>2
   547    #CHECK !2 "TO"
   548    #CHECK !3 _RGC#LE
   549    !A [] $1C2 !1 !3
   550    #IF !0>3
   551      #CHECK !4 _#LWFCV
   552      #FORMAT !3 !4
   553    #ENDIF
   554  #ELSE
   555    AUTO4$ DISPLAY !1 TO PAGE!f !2
   556  #ENDIF
   557#ENDCOMMAND
   558
   559#COMMAND ELSE
   560  #$ !A [] $41 |CI0 //jump over else code.
   561  #XPOP !n S$ // GET GOTO LINE NUMBER FROM LAST IF.
   562  #XPUSH 1 !a // Save line number of ELSE jump.
   563  #XPUSH 0 !n // Save static nest level.
   564  #FREF (!a+1) !s // Modify goto line number with ELSE command 
   565  !1 !2 !3 !4 !5 !6 !7 !8 !9
   566  #XPOP 0 Q$  // Restore static nest level to Q.
   567  #XPOP 1 S$  // Restore line number of else jump.
   568  #IF (!n>!q)
   569    #FREF END$!r !s // Modify ELSE jump to after BEGIN block.
   570  #ELSE
   571    #FREF (!a+1) !s // Modify ELSE jump to after the ELSE command.
   572  #ENDIF
   573#ENDCOMMAND
   574
   575#COMMAND END &.
   576  #POP S$
   577  #IFDEF WHILE$!s
   578    !A [] $041 WHILE$!s
   579  #ENDIF
   580  END$!s:
   581  #SET N$ !n-1
   582#ENDCOMMAND
   583
   584#COMMAND ENDGROUP &.
   585  //ENTUPDATE         // update record buffer
   586  !A [] $280 |CI0
   587  //GOTO ENT$END!x
   588  !A [] $41 |CL0
   589  #FREF ENT$END!x !a
   590  //RETURN            // RETURN stops entry command list
   591  !A [] $43 |CI0
   592  ENT$END!x:
   593#ENDCOMMAND
   594
   595#COMMAND ENT$KEY
   596  ENT$DISP:
   597  IF ENTER$DISPLAY NE 0 BEGIN
   598    !A [FOUND] $042 ENTER$DISPLAY
   599  END
   600  ELSE BEGIN
   601    [FOUND] ENTDISPLAY // JUST DO AN ENTDISPLAY
   602  END
   603  //              ENTAGAIN
   604  !A [] $287
   605  //              RETURN
   606  !A [] $43 |CL0
   607
   608  //<<<<<<< STANDARD KEY PROCEDURES FOR ENTER GROUP >>>>>>>>>>
   609  //KEYPROC KEY.FIND
   610  ENTER$.FIND:
   611  //              ENTFIND GE          // no, FIND
   612  !A [] $281 |CI3
   613  #KEYPROC 7 !a
   614  //              GOTO ENT$DISP
   615  !A [] $41 ENT$DISP
   616
   617  //KEYPROC KEY.NEXT                  // FIND next record
   618  ENTER$.NEXT:
   619  //              ENTFIND GT
   620  !A [] $281 |CI4
   621  #KEYPROC 15 !a
   622  //              GOTO ENT$DISP
   623  !A [] $41 ENT$DISP
   624
   625  //KEYPROC KEY.PREVIOUS              // FIND prv record
   626  ENTER$.PREVIOUS:
   627  //              ENTFIND LT
   628  !A [] $281 |CI0
   629  #KEYPROC 14 !a
   630  //              GOTO ENT$DISP
   631  !A [] $41 ENT$DISP
   632  //KEYPROC KEY.UP
   633  //KEYPROC KEY.FIELD                 // BACK FIELD
   634  ENTER$.FIELD:
   635  //              BACKFIELD
   636  !A [] $288
   637  #KEYPROC 16 !a
   638  #KEYPROC 6 !a
   639  //              RETURN
   640  !A [] $43 |CI0
   641  //KEYPROC KEY.CLEAR                 // CLEAR SCREEN
   642  ENTER$.CLEAR:
   643  //              INDICATE ERR FALSE
   644  !A [] $4028 |CI0 |CI0 |127
   645  #KEYPROC 13 !a
   646  !A []           $284 // ENTCLEAR
   647  //              RETURN
   648  !A [] $43 |CI0
   649  //KEYPROC KEY.SAVE
   650  ENTER$.SAVE:
   651  !A []           $285 // ENTSKIP
   652  #KEYPROC 9 !a
   653  //              RETURN
   654  !A [] $43 |CI0
   655  //KEYPROC KEY.HELP
   656  ENTER$.HELP:
   657  //HELP
   658  !A [] $1C5 |CI0
   659  #KEYPROC 18 !a
   660  //ENTAGAIN
   661  !A [] $287
   662  //RETURN
   663  !A [] $43 |CI0
   664
   665  // KEYPROC KEY.PRINT
   666  ENTER$.PRINT:
   667  // output current page
   668  !A [] $202 |VI9
   669  #KEYPROC 2 !a
   670  //ENTAGAIN and RETURN
   671  !A [] $287
   672  !A [] $43 |CI0
   673#ENDCOMMAND
   674
   675#REM ENTAGAIN can only be used in a KEY PROCedure. It returns to the
   676#REM same window (COMMAND) that called the KEY PROCedure.
   677
   678#COMMAND ENTAGAIN &.
   679  !A [] $287
   680#ENDCOMMAND
   681
   682#COMMAND ENTDISPLAY &TCVWG#LE .  // Display all entries for a file
   683  #IF (!0>0)
   684    //RELATE !1
   685    !A [] $C4 !1.RECNUM
   686  #ENDIF
   687  //display from entry section
   688  !A [] $283
   689#ENDCOMMAND
   690
   691#COMMAND ENTER CVWSRL#E
   692  //              INDICATE CONTINUE TRUE
   693  #REPLACE CONTINUE |!C
   694  !A [] $4028 |CI0 |CI0 CONTINUE~
   695  //              INDICATE ENT$QUERY FALSE
   696  #REPLACE ENT$QUERY |9
   697  !A [] $4028 |CI0 |CI0 |9
   698  #IF !0>0            // ENT$QUERY tells us if
   699    #SET X$ !1.RECNUM           // we are in QUERY(SUPERFIND) mode
   700  #ELSE
   701    #SET X$ 0
   702  #ENDIF
   703  //MOVEINT |CI!x TO |VI8     // set ENTMFILE (ENTER's main file variable)
   704  !A [] $82 |CI!x |VI8        // to main file for ENTSFIND
   705  ENT$LP:             // start of enter loop
   706  //              GOSUB ENTRYSEC      // do ENTRY section
   707  !A [] $042 |CL0
   708  #FREF ENTRYSEC !a
   709  //[KEY.ESCAPE]      GOTO END_ENTER      // dropped thru
   710  !A [|103] $041 |CL0
   711  #FREF END_ENTER !a
   712  //              INDICATE ERR FALSE      // set error false
   713  !A [] $4028 |CI0 |CI0 |127
   714  // temp disable ON ERROR
   715  !A [] $82 |VI31 |VI32
   716  !A [] $82 |CI0 |VI31
   717  // REREAD command
   718  !A [] $0C9
   719  //[ENT$QUERY]       GOSUB ENTER.EDIT    // user procedure
   720  !A [|9] $042 |CL0
   721  #FREF ENTER.EDIT !a
   722  //[NOT ERR]         ENTUPDATE       // update files from ENTRY
   723  !A [~|127] $280 |CI0
   724  //[NOT ERR]         GOSUB ENTER.SAVE    // user procedure
   725  !A [~|127] $042 |CL0
   726  #FREF ENTER.SAVE !a
   727  [NOT ERR]       MULTIBACK$ SAVE !1 !2 !3 !4 !5 !6 !7 !8 !9  // save
   728  // UNLOCK command
   729  !A [] $0C8
   730  //[NOT ERR]         GOSUB ENT$CLEAR     // clear screen
   731  !A [~ |127] $042 |CL0
   732  #FREF ENT$CLEAR !a
   733  // RE ENABLE ON ERROR
   734  !A [] $82 |VI32 |VI31
   735  //[CONTINUE]        GOTO ENT$LP         // loop
   736  !A [CONTINUE] $041 ENT$LP
   737  //              GOTO END_ENTER      // end if NOT CONTINUE
   738  !A [] $041 |CL0
   739  #FREF END_ENTER !a
   740  // this clears the screen and all data files
   741  ENT$CLEAR:          MULTIBACK$ CLEAR !1 !2 !3 !4 !5 !6 !7 !8 !9
   742  //              INDICATE ENT$QUERY FALSE
   743  !A [] $4028 |CI0 |CI0 |9
   744  //              ENTCLEAR - clear ENTRY section
   745  !A [] $284
   746  //              RETURN
   747  !A [] $043 |CI0
   748  //<<<<<<< STANDARD KEY PROCEDURES FOR ENTER >>>>>>>>>>
   749  //KEYPROC KEY.SAVE
   750  ENTER$.SAVE:
   751  !A []           $285 //ENTSKIP (skip rest of entries)
   752  #KEYPROC 9 !a
   753  //              RETURN
   754  !A [] $043 |CI0
   755  //KEYPROC KEY.DELETE
   756  //              INDICATE ERR FALSE      //default
   757  ENTER$.DELETE:
   758  !A [] $4028 |CI0 |CI0 |127
   759  #KEYPROC 10 !a
   760  // DISABLE ON ERROR
   761  !A [] $82 |VI31 |VI32
   762  !A [] $82 |CI0 |VI31
   763  //              REREAD
   764  !A [] $C9
   765  //[NOT ENT$QUERY]   ERROR 71    // check for active record
   766  !A [~|9] $47 |CI71
   767  //[NOT ERR]         GOSUB ENTER.DELETE      // user procedure
   768  !A [~|127] $042 |CL0
   769  #FREF ENTER.DELETE !a
   770  //[NOT ERR]         GOSUB ENTER.EDIT    // user procedure
   771  !A [~|127] $042 |CL0
   772  #FREF ENTER.EDIT !a
   773  //[NOT ERR]         DELETE !1       // delete records
   774  !A [~|127] $C3 !1.RECNUM
   775  [NOT ERR]       MULTIBACK$ SAVE !2 !3 !4 !5 !6 !7 !8 !9 // related
   776  //              UNLOCK
   777  !A [] $C8
   778  //[NOT ERR]         GOSUB ENT$CLEAR       // clear systems
   779  !A [~|127] $042 ENT$CLEAR
   780  // enable ON ERROR
   781  !A [] $82 |VI32 |VI31
   782  //              RETURN ENTRYSEC
   783  !A [] $43
   784  #FREF ENTRYSEC !a
   785  // will GOSUB here for all find keys //
   786  //              INDICATE WAS$QUERY GROUP ANY [ENT$QUERY]
   787  ENTER$.FIND:
   788  #REPLACE WAS$QUERY |!C
   789  !A [] $4020 |GB[|9] |GB[0] WAS$QUERY IN$GLANY |3
   790  #KEYPROC 8 !a // SUPERFIND
   791  #KEYPROC 7 !a // FIND
   792  #KEYPROC 15 !a // NEXT
   793  #KEYPROC 14 !a // PREVIOUS
   794  //[KEY.SFIND]       INDICATE ENT$QUERY TRUE
   795  !A [|108] $4028 |CI0 |CI0 |9~
   796  //[NOT ENT$QUERY]   INDICATE ENT$QUERY AS |CI!x EQ |VI15    // query mode?
   797  !A [~ |9] $4008 |CI!x |VI15 |9 |2
   798  //[KEY.SFIND]         ENTSFIND GE
   799  !A [|108] $282 |CI3
   800  //[KEY.FIND][ENT$QUERY][ENT$PERMISSIVE] ENTFIND GE
   801  !A [|107 |9 |10] $281 |CI3
   802  //[KEY.FIND][ENT$QUERY][NOT ENT$PERMISSIVE] ENTSFIND GE   // yes, SUPERFIND
   803  !A [|107 |9 ~ |10] $282 |CI3
   804  //[KEY.FIND][NOT ENT$QUERY]     ENTFIND GE        // no, FIND
   805  !A [|107 ~ |9] $281 |CI3
   806  //[KEY.NEXT][ENT$QUERY]   ENTSFIND GT     // yes, SUPERFIND
   807  !A [|115 |9] $282 |CI4
   808  //[KEY.NEXT][NOT ENT$QUERY]     ENTFIND GT        // no, FIND
   809  !A [|115 ~ |9] $281 |CI4
   810  //[KEY.PREVIOUS][ENT$QUERY]     ENTSFIND LT       // yes, SUPERFIND
   811  !A [|114 |9] $282 |CI0
   812  //[KEY.PREVIOUS][NOT ENT$QUERY] ENTFIND LT        // no, FIND
   813  !A [|114 ~ |9] $281 |CI0
   814  [FINDERR]       INDCT$GROUP ENT$QUERY GROUP ANY [WAS$QUERY]
   815  //!A [FOUND]        $283            // display records
   816  !A [FOUND] $042 ENTER$DISPLAY
   817  //              ENTAGAIN        // same window
   818  !A [] $287
   819  //              RETURN
   820  !A [] $43 |CI0
   821  ////// define ENTER's KEY PROCedures ////////////
   822  // KEYPROC BACKFIELD
   823  //              BACKFIELD
   824  ENTER$.FIELD:
   825  !A [] $288
   826  #KEYPROC 16 !a
   827  #KEYPROC 6 !a
   828  ENTXRET://          RETURN
   829  !A [] $43 |CL0
   830  // KEYPROC CLEARSCREEN
   831  ENTER$.CLEAR:
   832  //              INDICATE ERR FALSE
   833  !A [] $4028 |CI0 |CI0 |127
   834  #KEYPROC 13 !a
   835  //              GOSUB ENTER.CLEAR
   836  !A [] $042 |CL0
   837  #FREF ENTER.CLEAR !a
   838  //[NOT ERR]         GOSUB ENT$CLEAR
   839  !A [~ |127] $042 ENT$CLEAR
   840  //              RETURN ENTRYSEC
   841  !A [] $043
   842  #FREF ENTRYSEC !a
   843  // KEYPROC ESCAPE key
   844  ENTER$.ESCAPE:
   845  //              INDICATE ERR FALSE
   846  !A [] $4028 |CI0 |CI0 |127
   847  #KEYPROC 3 !a
   848  //              GOSUB ENTER.EXIT
   849  !A [] $42 |CL0
   850  #FREF ENTER.EXIT !a
   851  //[NOT ERR]         RETURN ENTXRET
   852  !A [~ |127] $43 ENTXRET
   853  //              RETURN
   854  !A [] $43 |CI0
   855  //KEYPROC KEY.HELP
   856  //HELP
   857  ENTER$.HELP:
   858  !A [] $1C5 |CI0
   859  #KEYPROC 18 !a
   860  //ENTAGAIN
   861  !A [] $287
   862  //RETURN
   863  !A [] $43 |CI0
   864  //KEYPROC KEY.PRINT
   865  //output current page
   866  ENTER$.PRINT:
   867  !A [] $202 |VI9
   868  #KEYPROC 2 !a
   869  //ENTAGAIN and RETURN
   870  !A [] $287
   871  !A [] $43 |CI0
   872
   873  ENTRYSEC://         ENTERMODE       // start entry section
   874  !A [] $82 |CI!a |VI14
   875  !A [] $286
   876#ENDCOMMAND
   877
   878#COMMAND ENTEREND               // end of ENTER
   879  MAKEDEF$ ENTER.SAVE ENTER.EDIT ENTER.DELETE ENTER.CLEAR ENTER.EXIT
   880  //RETURN
   881  !A [] $43 |CI0
   882  #IFDEF ENTER.DISPLAY
   883  #ELSE
   884    ENTER.DISPLAY:
   885    ENTDISPLAY
   886    !A [] $43 |CI0
   887  #ENDIF
   888  END_ENTER:
   889  // CLEARSCREEN
   890  !A [] $144
   891#ENDCOMMAND
   892
   893#COMMAND ENTERGROUP .   // independent entry section
   894  #IFDEF ENT$DISP
   895  #ELSE
   896    //INTEGER ENT$START
   897    INTEGER ENT$END
   898    //#$ GOTO ENTK$END
   899    #$ !A [] $41 |CL0
   900    #FREF ENTK$END !a
   901    #$ ENT$KEY
   902    #SET X$ 0
   903    ENTK$END:
   904  #ENDIF
   905
   906  ENTRYSEC!X://       ENTERMODE       // start entry section
   907  !A [] $82 |CI!a |VI14
   908  !A [] $286
   909  //              INDICATE ENT$QUERY FALSE
   910  !A [] $4028 |CI0 |CI0 |9
   911#ENDCOMMAND
   912
   913#REM ENTERMODE defines the top of the ENTRY section.
   914
   915#COMMAND ENTERMODE &.
   916  //set start of ENTRY section
   917  !A [] $082 |CI!a  |VI14
   918  //clear SAVE key
   919  !A [] $286
   920#ENDCOMMAND
   921
   922#REM ENTFIND FINDs a record based on the file/field of the last executed
   923#REM ENTRY command, and displays the results on a FIND. THE FIND mode
   924#REM is the only argument.
   925#REM ENTFIND also maintains the ENT$QUERY indicator.
   926
   927#COMMAND ENTFIND &"$0""$1""$2""$3""$4""$5"
   928  !A [] $281 |CI!1
   929#ENDCOMMAND
   930
   931#COMMAND ENTRY RWV#LUG UVC#LF UFVW#BC
   932  #IF !0=1
   933    AUTO3$ ENTRY !1 PAGE!f
   934  #ELSE
   935    #IFTYPE !2 "O"
   936      AUTO3$ ENTRY !1 PAGE!f !2
   937    #ELSE
   938      #CHECK !2 _RVCLE
   939      #IFCLASS !1 "E"
   940        !A [] $8000 !1 !2 {$C002,$C003 !3
   941      #ELSE
   942        !A [] $8000 !1 !2 !3
   943      #ENDIF
   944    #ENDIF
   945  #ENDIF
   946#ENDCOMMAND
   947
   948#REM ENTSFIND (SUPERFIND) FINDs a record in the main file, based on the
   949#REM file/field of the last ENTRY command, and displays the results.
   950#REM This depends on the main file number being in SYSINT 8 (|VI8).
   951
   952#COMMAND ENTSFIND &"$0""$1""$2""$3""$4""$5" .
   953  !A [] $282 |CI!1
   954#ENDCOMMAND
   955
   956#REM ENTUPDATE moves all changed windows from the
   957#REM window buffer to the record buffer
   958
   959#COMMAND ENTUPDATE &T .
   960  #IF !0>0
   961    !A [] $280 !1.RECNUM
   962  #ELSE
   963    !A [] $280 |CI0
   964  #ENDIF
   965#ENDCOMMAND
   966
   967#COMMAND ERASEFILE &R#LGU .
   968  !A [] $2C1 !1
   969#ENDCOMMAND
   970
   971// Only available in console mode
   972#COMMAND ERASEFILEWIN &R#LGU .
   973  !A [] $2E5 !1
   974#ENDCOMMAND
   975
   976
   977#COMMAND ERROR &#L%RGU #LUG .
   978  !A [] $047 !1 !2
   979#ENDCOMMAND
   980
   981#COMMAND ERROR_REPORT SU#LGO .
   982  #IF !0>0
   983    !A [] $04C !1
   984  #ELSE
   985    !A [] $04C |CI0
   986  #ENDIF
   987#ENDCOMMAND
   988
   989#COMMAND FIELD_DEF _E U#LG "TO" #LGUCE #LGRUEC .
   990  #IFDEF !1
   991    !A [] $82 !1 FILENUMBER
   992  #ELSE
   993    #CHECK !1.RECNUM _U
   994    #SET Q$ !1.RECNUM
   995    !A [] $82 |CI!q FILENUMBER
   996  #ENDIF
   997  !A [] $82 !2 FIELDNUMBER
   998  !A [] $345 !4 !5
   999#ENDCOMMAND
  1000
  1001#COMMAND FILELIST &R#%LG "TO""" #LUGCE #LUCGE .
  1002  #IFSAME !1 NEXT
  1003    !A [] $301 !3 !4
  1004  #ELSE
  1005    #IFSAME !1 PATHNAME
  1006      !A [] $302 !3 !4
  1007    #ELSE
  1008      #CHECK !1 _U
  1009      !A [] $82 !1 FILENUMBER
  1010      !A [] $300 !3 !4
  1011    #ENDIF
  1012  #ENDIF
  1013#ENDCOMMAND
  1014
  1015#REM Put back into FILELIST.  The file number must be in "FILENUMBER"
  1016#REM Three values are: ROOT NAME, DISPLAY NAME, LOGICAL NAME.
  1017
  1018#COMMAND FILELIST$PUT &#LRU #LRU #LU
  1019  #IF !0>2
  1020    !A [] $309 !3
  1021  #ENDIF
  1022  !A [] $30A !1 !2
  1023#ENDCOMMAND
  1024
  1025#COMMAND FILE$MODE$HELP R "READ_ONLY""SINGLE_USER""ALIAS""MASTER_ALIAS""DEFAULT" .
  1026//  #CHECK !1.RECNUM _CVWLR#GU
  1027  #IFSAME !2 READ_ONLY
  1028        SET_ATTRIBUTE DF_FILE_ALIAS OF FILENUMBER TO DF_FILE_ALIAS_DEFAULT
  1029        !A [] $0CB INDIRECT_FILE.RECNUM |CI91
  1030  #ELSE
  1031    #IFSAME !2 SINGLE_USER
  1032      SET_ATTRIBUTE DF_FILE_ALIAS OF FILENUMBER TO DF_FILE_ALIAS_DEFAULT
  1033      !A [] $0CB INDIRECT_FILE.RECNUM |CI7
  1034  #ELSE
  1035      #IFSAME !2 DEFAULT
  1036        !A [] $0CB INDIRECT_FILE.RECNUM |CI0
  1037        SET_ATTRIBUTE DF_FILE_ALIAS OF FILENUMBER TO DF_FILE_ALIAS_DEFAULT
  1038      #ELSE
  1039        #IFSAME !2 ALIAS
  1040          !A [] $0CB INDIRECT_FILE.RECNUM |CI130
  1041          SET_ATTRIBUTE DF_FILE_ALIAS OF FILENUMBER TO DF_FILE_IS_ALIAS
  1042        #ELSE
  1043          #IFSAME !2 MASTER_ALIAS
  1044            !A [] $0CB INDIRECT_FILE.RECNUM |CI128
  1045            SET_ATTRIBUTE DF_FILE_ALIAS OF FILENUMBER TO DF_FILE_IS_MASTER
  1046          #ENDIF
  1047        #ENDIF
  1048      #ENDIF
  1049    #ENDIF
  1050  #ENDIF
  1051#ENDCOMMAND
  1052
  1053#COMMAND FILE_MODE
  1054  //#IFSAME !1 |FS0,0& |FN0,0& |FD0,0&
  1055  // This supports both Indirect_file and Indirect_file.Recnum (JJT)
  1056  #IFSAME !1.RECNUM |FS0,0& |FN0,0& |FD0,0& |FS0,0&.RECNUM
  1057  #ELSE
  1058    #SET Q$ !1.RECNUM
  1059    !A [] $82 |CI!q FILENUMBER
  1060  #ENDIF
  1061  FILE$MODE$HELP !1 !2 !3 !4 !5 !6 !7 !8 !9
  1062#ENDCOMMAND
  1063
  1064#REM FILE$MODE <FILE> <MODE NUMBER>
  1065#REM    MODE VALUES (VALUES ARE ADDITIVE)
  1066#REM    1   NO AUTOMATIC REREAD OF RECORD BUFFERS.
  1067#REM    2   NO LOCKS (LOCK OR REREAD)
  1068#REM    4   NO RE-READ OF BLOCK ZERO OF DATA FILE OR INDEXES
  1069#REM    8   NO EDITS OF ACTIVE RECORDS (ERROR 66)
  1070#REM    16  NO DELETES OF RECORDS (ERROR 63)
  1071#REM    32  NO FINDS (ERROR 64)
  1072#REM    64  NO CREATES OF NEW RECORDS. (ERROR 65)
  1073#REM    128 ALWAYS RE_READ BLOCK 0
  1074#REM Warning; Improper combinations of the above could disable
  1075#REM multiuser checking and destroy the data base.
  1076#REM 8 Thru 64 are non destructive and can be used in applications.
  1077#REM FOR EXPERTS ONLY!
  1078
  1079#COMMAND FILE$MODE RT #LGSU .
  1080  #CHECK !1.RECNUM _RULG
  1081  !A [] $0CB !1.RECNUM !2
  1082#ENDCOMMAND
  1083
  1084#COMMAND FILE_SIZE R#LGSD "TO" R#LGE #LUGE #LGUE .
  1085  #IFDEF !1 // SET FILE SIZE
  1086    #CHECK !3.RECNUM _RU
  1087    #SET Q$ !3.RECNUM
  1088    !A [] $343 |CI!q !1
  1089  #ELSE
  1090    #CHECK !1.RECNUM _U
  1091    #SET Q$ !1.RECNUM
  1092    !A [] $82 |CI!q FILENUMBER
  1093    !A [] $341 !3 !4
  1094    !A [] $82 STRMARK !5
  1095  #ENDIF
  1096#ENDCOMMAND
  1097
  1098#COMMAND FIND &"$0""$1""$2""$3""$4""$5" R "BY""" % .
  1099  #IFCLASS !2 "F"
  1100    #CHECK !2 _U#LGWV
  1101    #CHECK !3 .
  1102    !A [] $0C0 !2 |CI!1
  1103  #ELSE
  1104    #CHECK !2.RECNUM _U#LGWV
  1105    #CHECK !4 _RUL#GVFW
  1106    #SET Q$ !2.RECNUM
  1107    #SET Y$ !4
  1108    !A [] $0C6 |FS!q.!y |CI!1
  1109  #ENDIF
  1110#ENDCOMMAND
  1111
  1112#COMMAND FIND$PAGE "AT""COLORS""" #LUG U#LG .
  1113  #IF !0>0
  1114    #IFSAME !1 AT
  1115      !A [] $1C8 !2 !3
  1116    #ELSE
  1117      #IFSAME !1 COLORS
  1118        !A [] $1C9 !2 !3
  1119      #ENDIF
  1120    #ENDIF
  1121  #ENDIF
  1122#ENDCOMMAND
  1123
  1124#REM  FLEX$INIT - STANDARD REPLACES
  1125#REM  These are the standard symbols that are required for the compiler
  1126#REM  This procedure will be automatically executed
  1127#REM  when the compiler starts
  1128
  1129#COMMAND FLEX$INIT &.
  1130  #REPLACE CALC CALCULATE
  1131  #REPLACE LT $0  // internal value for the find/indicate modes.
  1132  #REPLACE LE $1
  1133  #REPLACE EQ $2
  1134  #REPLACE GE $3
  1135  #REPLACE GT $4
  1136  #REPLACE NE $5
  1137  #REPLACE TRUE $1
  1138  #REPLACE FALSE $0
  1139  #REPLACE NOT ~
  1140  #SET C$ 11
  1141  #REPLACE LASTIF |!C
  1142  #REPLACE ENT$PERMISSIVE |10
  1143  #REPLACE IN$0 $4000
  1144  #REPLACE IN$1 $4004
  1145  #REPLACE IN$2 $4008
  1146  #REPLACE IN$3 $400C
  1147  #REPLACE IN$4 $4010
  1148  #REPLACE IN$5 $4014
  1149  #REPLACE IN$GLANY |0
  1150  #REPLACE IN$GLALL |4
  1151  #REPLACE IN$GRANY |0
  1152  #REPLACE IN$GRALL |2
  1153  #REPLACE IN$GMOR  |0
  1154  #REPLACE IN$GMAND |1
  1155  #REPLACE ERR |127
  1156  #REPLACE ERRLINE |VI6
  1157  #REPLACE LAST_CRIT_ERR |VI102
  1158  #REPLACE EXT_CRIT_ERR |VI103
  1159  #REPLACE CONSTRAIN_TESTS_COUNT |VI106
  1160  #REPLACE CONSTRAIN_FOUND_COUNT |VI107
  1161  #REPLACE FINDERR |126
  1162  #REPLACE SEQEOF |125
  1163  #REPLACE SEQEOL |121
  1164  #REPLACE MULTIUSER |120
  1165  #REPLACE FIELDINDEX |VI1
  1166  #REPLACE WINDOWINDEX |VI2
  1167  #REPLACE LASTERR |VI5
  1168  #REPLACE KEYPRESS |123
  1169  #REPLACE TERMCHAR |VI3
  1170  #REPLACE FLEXKEY |VI4
  1171  #REPLACE SCREENEND |VI17
  1172  #REPLACE MEMAVAIL |VI18
  1173  #REPLACE LASTENTRY |VI19
  1174  #REPLACE FLX_REVISION |VI36
  1175  #REPLACE ENTER$DISPLAY |VI38
  1176  #REPLACE NOKEYCHECK |VI80
  1177  #REPLACE CHAIN_DEPTH |VI81
  1178  #REPLACE CURSOR_SET |VI82 // THESE ARE USED BY AUTOBACK
  1179  #REPLACE CURSOR_RETURN |VI83
  1180  #REPLACE MINIMUM_MEMORY |VI86
  1181  #REPLACE INDEX_NUMBER |VI90
  1182  #REPLACE SCREEN_WIDTH |VI91
  1183  #REPLACE KEY.ANY  |100
  1184  #REPLACE KEY.RETURN   |101
  1185  #REPLACE KEY.PRINT    |102
  1186  #REPLACE KEY.ESCAPE   |103
  1187  #REPLACE KEY.LEFT |104
  1188  #REPLACE KEY.RIGHT    |105
  1189  #REPLACE KEY.FIELD    |106
  1190  #REPLACE KEY.FIND |107
  1191  #REPLACE KEY.SFIND    |108
  1192  #REPLACE KEY.SAVE |109
  1193  #REPLACE KEY.DELETE   |110
  1194  #REPLACE KEY.CALCULATE |111
  1195  #REPLACE KEY.USER |112
  1196  #REPLACE KEY.CLEAR    |113
  1197  #REPLACE KEY.NEXT |115
  1198  #REPLACE KEY.PREVIOUS |114
  1199  #REPLACE KEY.UP   |116
  1200  #REPLACE KEY.DOWN |117
  1201  #REPLACE KEY.HELP |118
  1202  #REPLACE KEY.USER2    |119
  1203  #REPLACE NUMPAGE  |VI28
  1204  #REPLACE NUMWINDOW    |VI29
  1205  #REPLACE #$
  1206  #SET F$ 1
  1207  #REPLACE NEXT_MENU |VI127
  1208  #REPLACE CURRENT_IMAGE |VI9
  1209  #REPLACE CURRENT_WINDOW |VI7
  1210  #REPLACE LAST_GOSUB |VI0
  1211  #REPLACE FOUND |254
  1212  #REPLACE STRMARK |VI12
  1213  #REPLACE STRLEN |VI13
  1214  //   ENTER & REPORT DEF'S
  1215  #REPLACE LINECOUNT |VI10
  1216  #REPLACE PAGECOUNT |VI11
  1217  #REPLACE PAGEEND |VI25
  1218  #REPLACE PAGEFEED |VI26
  1219  #SET D$ 128   // INTEGERS NOW START HERE.
  1220  #SET P$ 0
  1221  #REPLACE AUTOFIND $C000
  1222  #REPLACE AUTOFIND_GE $C000,$C008
  1223  #REPLACE FINDREQ  $C001
  1224  #REPLACE NOPUT    $C002
  1225  #REPLACE NOENTER  $C003
  1226  #REPLACE SKIPFOUND $C004
  1227  #REPLACE RETAINALL $C005
  1228  #REPLACE RETAIN    $C006
  1229  #REPLACE FORCEPUT $C007
  1230  #REPLACE DISPLAYONLY $C002,$C003
  1231  #REPLACE CAPSLOCK $C023
  1232  #REPLACE ZERO_SUPPRESS $C024
  1233  #REPLACE THOUSANDS $C025
  1234  #REPLACE SUPPRESS $C040=''
  1235  #REPLACE FLOAT$ $C026
  1236  #REPLACE UPPER $C023
  1237  #REPLACE SIGNRT $C027
  1238  #REPLACE CHECK $C012
  1239  #REPLACE RANGE $C013
  1240  #REPLACE REQUIRED $C022
  1241  #REPLACE AUTORETURN $C028
  1242  #REPLACE AUTOBACK   $C029
  1243  #REPLACE NO_CALC    $C02B   // Disable Calculate (internal)
  1244  #REPLACE MODAL_INSERT $C02A // Change insert style (internal)
  1245  #REPLACE AUTOCLEAR $C02D
  1246  #REPLACE WP_BACKSP $C02E
  1247  #REPLACE PAGEBREAK |124
  1248  #REPLACE FILL $C040
  1249  #REPLACE POINTS $C080
  1250  #REPLACE FILENUMBER |VI15
  1251  #REPLACE FIELDNUMBER |VI16
  1252  #REPLACE INDEX.1 |CI1   // the indexes are just integers.
  1253  #REPLACE INDEX.2 |CI2
  1254  #REPLACE INDEX.3 |CI3
  1255  #REPLACE INDEX.4 |CI4
  1256  #REPLACE INDEX.5 |CI5
  1257  #REPLACE INDEX.6 |CI6
  1258  #REPLACE INDEX.7 |CI7
  1259  #REPLACE INDEX.8 |CI8
  1260  #REPLACE INDEX.9 |CI9
  1261  #REPLACE INDEX.10 |CI10
  1262  #REPLACE INDEX.11 |CI11
  1263  #REPLACE INDEX.12 |CI12
  1264  #REPLACE INDEX.13 |CI13
  1265  #REPLACE INDEX.14 |CI14
  1266  #REPLACE INDEX.15 |CI15
  1267  #REPLACE INDEX.BATCH |CI10
  1268  #REPLACE RECNUM |CI0
  1269  #REPLACE EXPORT_FILES 1
  1270  #REPLACE EXPORT_ONLY 2
  1271  #REPLACE SEQ_EXPORT 4
  1272  #REPLACE INDIRECT_FILE.RECNUM |FS0,0&
  1273  #REPLACE DESKTOP |CI2
  1274  #REPLACE END_FUNCTION END_PROCEDURE
  1275  #REPLACE PROCEDURE_RETURN FUNCTION_RETURN
  1276
  1277  #REPLACE TOTAL_RESOURCES |VI104
  1278
  1279    // video related replaces
  1280  #REPLACE BW40 0
  1281  #REPLACE C40  1
  1282  #REPLACE BW80 2
  1283  #REPLACE C80  3
  1284  #REPLACE MONO 7
  1285  #REPLACE EXTENDED_EGAVGA 64
  1286  #REPLACE EXTENDED_VGA    128
  1287
  1288  // API Constants
  1289  #REPLACE DFERR_ERROR   |CI-1
  1290  #REPLACE DF_SUCCESS    |CI0
  1291  #REPLACE DFFALSE       |CI0
  1292  #REPLACE DFTRUE        |CI1
  1293
  1294  // DataFlex driver specific constants
  1295  #REPLACE FLEX_SET_MAX_SORT_BUFFER             |CI1
  1296  #REPLACE FLEX_GET_MAX_SORT_BUFFER             |CI2
  1297  #REPLACE FLEX_REPAIR_FILE                     |CI3
  1298  #REPLACE FLEX_GET_REPAIRS_NEEDED              |CI4
  1299  #REPLACE FLEX_SET_INDEX_OPT                   |CI5
  1300  #REPLACE FLEX_GET_INDEX_OPT                   |CI6
  1301  #REPLACE FLEX_GET_STRICT_TRANSACTIONS         |CI7
  1302  #REPLACE FLEX_SET_STRICT_TRANSACTIONS         |CI8
  1303
  1304    // DataFlex specific file damage types
  1305  #REPLACE FLEX_HEADER_OK             |CI0
  1306  #REPLACE FLEX_BLOCK0_BAD            |CI1
  1307  #REPLACE FLEX_HEADER_BAD            |CI2
  1308  #REPLACE FLEX_HEADER_INTEGRITY_OFF  |CI4
  1309  #REPLACE FLEX_HEADER_UNREADABLE     |CI8
  1310
  1311  // Index optimization modes
  1312  #REPLACE FLEX_INDEX_OPT_ON          |CI1
  1313  #REPLACE FLEX_INDEX_OPT_PERMISSIVE  |CI2
  1314  #REPLACE FLEX_INDEX_OPT_OFF         |CI3
  1315
  1316  // Flex revision codes (for use with DF_FILE_REVISION)
  1317  #REPLACE FLEX_REVISION_23   |CS"2.3B"
  1318  #REPLACE FLEX_REVISION_30   |CS"3.2"
  1319
  1320
  1321  // Attributes: Runtime
  1322  #REPLACE DF_RUNTIME_PROGRESS_FREQUENCY |CI4097
  1323
  1324  // Attributes: Global
  1325  #REPLACE DF_LOCK_DELAY                        |CI1
  1326  #REPLACE DF_LOCK_TIMEOUT                      |CI2
  1327  #REPLACE DF_OPEN_PATH                         |CI3
  1328  #REPLACE DF_DATE_FORMAT                       |CI4
  1329  #REPLACE DF_DATE_SEPARATOR                    |CI5
  1330  #REPLACE DF_DECIMAL_SEPARATOR                 |CI6
  1331  #REPLACE DF_THOUSANDS_SEPARATOR               |CI7
  1332  #REPLACE DF_ALL_FILES_TOUCHED                 |CI8
  1333  #REPLACE DF_HIGH_DATA_INTEGRITY               |CI9
  1334  #REPLACE DF_TRAN_COUNT                        |CI10
  1335  #REPLACE DF_TRANSACTION_ABORT                 |CI11
  1336  #REPLACE DF_REREAD_REQUIRED                   |CI12
  1337  #REPLACE DF_FILELIST_NAME                     |CI13
  1338  #REPLACE DF_REPORT_UNSUPPORTED_ATTRIBUTES     |CI14
  1339  #REPLACE DF_STRICT_ATTRIBUTES                 |CI15
  1340  #REPLACE DF_NUMBER_DRIVERS                    |CI16
  1341  #REPLACE DF_DRIVER_NAME                       |CI17
  1342  #REPLACE DF_DRIVER_NUMBER_SERVERS             |CI18
  1343  #REPLACE DF_DRIVER_SERVER_NAME                |CI19
  1344  #REPLACE DF_API_DISABLED                      |CI20
  1345  #REPLACE DF_API_DISABLED_ERROR                |CI21
  1346
  1347//*** BW, Begin
  1348//*** Add the new attribute
  1349  #REPLACE DF_TRANABORT_ONERROR                 |CI22
  1350//*** BW, End
  1351
  1352  #REPLACE DF_OPEN_FILE_COUNT                   |CI23
  1353  #REPLACE DF_DATE_4_STATE                      |CI24
  1354  #REPLACE DF_EPOCH_VALUE                       |CI25
  1355  #REPLACE DF_SYSDATE_4_STATE                   |CI26
  1356  #REPLACE DF_NUMBER_FILES_SUPPORTED            |CI27
  1357
  1358
  1359
  1360  // Attributes: File
  1361  #REPLACE DF_FILE_STATUS	      |CI101
  1362  #REPLACE DF_FILE_MODE               |CI102
  1363  #REPLACE DF_FILE_MAX_RECORDS	      |CI103
  1364  #REPLACE DF_FILE_RECORDS_USED	      |CI104
  1365  #REPLACE DF_FILE_TYPE               |CI105
  1366  #REPLACE DF_FILE_MULTIUSER	      |CI106
  1367  #REPLACE DF_FILE_REUSE_DELETED      |CI107
  1368  #REPLACE DF_FILE_NUMBER             |CI108
  1369  #REPLACE DF_FILE_COMPRESSION	      |CI109
  1370  #REPLACE DF_FILE_LAST_INDEX_NUMBER  |CI110
  1371  #REPLACE DF_FILE_NUMBER_FIELDS      |CI111
  1372  #REPLACE DF_FILE_LOGICAL_NAME	      |CI112
  1373  #REPLACE DF_FILE_ROOT_NAME	      |CI113
  1374  #REPLACE DF_FILE_CHANGED            |CI114
  1375  #REPLACE DF_FILE_ALIAS              |CI115
  1376  #REPLACE DF_FILE_TOUCHED            |CI116
  1377  #REPLACE DF_FILE_TRANSACTION	      |CI117
  1378  #REPLACE DF_FILE_OPENED             |CI118
  1379  #REPLACE DF_FILE_DISPLAY_NAME       |CI119
  1380  #REPLACE DF_FILE_PHYSICAL_NAME      |CI120
  1381  #REPLACE DF_FILE_NEXT_OPENED	      |CI121
  1382  #REPLACE DF_FILE_NEXT_USED	      |CI122
  1383  #REPLACE DF_FILE_NEXT_EMPTY	      |CI123
  1384  #REPLACE DF_FILE_RECORD_LENGTH      |CI124
  1385  #REPLACE DF_FILE_RESTRUCTURE	      |CI125
  1386  #REPLACE DF_FILE_OPEN_MODE	      |CI126
  1387  #REPLACE DF_FILE_INTEGRITY_CHECK    |CI127
  1388  #REPLACE DF_FILE_OWNER              |CI128
  1389  #REPLACE DF_FILE_IS_SYSTEM_FILE     |CI129
  1390  #REPLACE DF_FILE_LOCK_TYPE          |CI130
  1391  #REPLACE DF_FILE_COMMITTED          |CI131
  1392  #REPLACE DF_FILE_DRIVER             |CI132
  1393  #REPLACE DF_FILE_RECORD_LENGTH_USED |CI133
  1394  #REPLACE DF_FILE_HANDLE_TYPE        |CI134
  1395  #REPLACE DF_FILE_RECORD_IDENTITY    |CI135
  1396  #REPLACE DF_FILE_LOGIN              |CI136
  1397  #REPLACE DF_FILE_RECORD_PRIVILEGE   |CI137 // PRIVATE, DO NOT USE
  1398  #REPLACE DF_FILE_PRIVILEGE          |CI138 // PRIVATE, DO NOT USE
  1399  #REPLACE DF_FILE_CREATION_SERIAL    |CI139 // PRIVATE, DO NOT USE
  1400  #REPLACE DF_FILE_REVISION           |CI140
  1401  #REPLACE DF_FILE_RELATED_COUNT      |CI141 // PRIVATE, DO NOT USE
  1402  #REPLACE DF_FILE_RELATED_FIELDS     |CI142 // PRIVATE, DO NOT USE
  1403  #REPLACE DF_FILE_SYSTEM_FILE        |CI143
  1404  #REPLACE DF_FILE_SYSTEM_FIELD       |CI144
  1405  #REPLACE DF_FILE_RECORD_REREAD      |CI145
  1406
  1407  #REPLACE DF_FIELD_NUMBER	      |CI201
  1408  #REPLACE DF_FIELD_TYPE	      |CI202
  1409  #REPLACE DF_FIELD_LENGTH	      |CI203
  1410  #REPLACE DF_FIELD_PRECISION	      |CI204
  1411  #REPLACE DF_FIELD_RELATED_FILE      |CI205
  1412  #REPLACE DF_FIELD_RELATED_FIELD     |CI206
  1413  #REPLACE DF_FIELD_NAME	      |CI207
  1414  #REPLACE DF_FIELD_INDEX	      |CI208
  1415  #REPLACE DF_FIELD_OFFSET	      |CI209
  1416  #REPLACE DF_FIELD_OLD_NUMBER	      |CI210
  1417  #REPLACE DF_FIELD_OVERLAP           |CI211
  1418  #REPLACE DF_FIELD_NATIVE_LENGTH     |CI212
  1419
  1420  // Attributes: Index
  1421  #REPLACE DF_INDEX_NUMBER_SEGMENTS     |CI301
  1422  #REPLACE DF_INDEX_NUMBER_BUFFERS      |CI302
  1423  #REPLACE DF_INDEX_TYPE                |CI303
  1424  #REPLACE DF_INDEX_LEVELS              |CI304
  1425  #REPLACE DF_INDEX_KEY_LENGTH          |CI305
  1426
  1427  // Attributes: Index Segments
  1428  #REPLACE DF_INDEX_SEGMENT_DIRECTION   |CI401
  1429  #REPLACE DF_INDEX_SEGMENT_CASE        |CI402
  1430  #REPLACE DF_INDEX_SEGMENT_FIELD       |CI403
  1431
  1432  // Date types
  1433  #REPLACE DF_DATE_USA           |CI0
  1434  #REPLACE DF_DATE_EUROPEAN      |CI1
  1435  #REPLACE DF_DATE_MILITARY      |CI2
  1436
  1437  // Callback Types
  1438  #REPLACE DF_MESSAGE_TEXT            |CI0
  1439  #REPLACE DF_MESSAGE_HEADING_1       |CI1
  1440  #REPLACE DF_MESSAGE_HEADING_2       |CI2
  1441  #REPLACE DF_MESSAGE_HEADING_3       |CI3
  1442  #REPLACE DF_MESSAGE_HEADING_4       |CI4
  1443  #REPLACE DF_MESSAGE_HEADING_5       |CI5
  1444  #REPLACE DF_MESSAGE_WARNING         |CI6
  1445  #REPLACE DF_MESSAGE_PROGRESS_TITLE  |CI7
  1446  #REPLACE DF_MESSAGE_PROGRESS_VALUE  |CI8
  1447
  1448  // Aux file types
  1449  #REPLACE DF_AUX_FILE_FD      |CI0
  1450  #REPLACE DF_AUX_FILE_DEF     |CI1
  1451
  1452  // File status values
  1453  #REPLACE DF_FILE_INACTIVE       |CI0
  1454  #REPLACE DF_FILE_ACTIVE         |CI1
  1455  #REPLACE DF_FILE_ACTIVE_CHANGED |CI2
  1456
  1457  // File user values
  1458  #REPLACE DF_FILE_USER_SINGLE  |CI0
  1459  #REPLACE DF_FILE_USER_MULTI   |CI1
  1460
  1461  // File deleted values
  1462  #REPLACE DF_FILE_DELETED_NOREUSE  |CI0
  1463  #REPLACE DF_FILE_DELETED_REUSE    |CI1
  1464
  1465  // Compressions types
  1466  #REPLACE DF_FILE_COMPRESS_NONE        |CI0
  1467  #REPLACE DF_FILE_COMPRESS_FAST        |CI1
  1468  #REPLACE DF_FILE_COMPRESS_STANDARD    |CI2
  1469  #REPLACE DF_FILE_COMPRESS_CUSTOM      |CI3
  1470
  1471  // File alias
  1472  #REPLACE DF_FILE_ALIAS_DEFAULT        |CI0
  1473  #REPLACE DF_FILE_IS_MASTER            |CI1
  1474  #REPLACE DF_FILE_IS_ALIAS             |CI2
  1475
  1476  // File handle types
  1477  #REPLACE DF_FILE_HANDLE_BAD                   |CI0
  1478  #REPLACE DF_FILE_HANDLE_CLOSED                |CI1
  1479  #REPLACE DF_FILE_HANDLE_OPENED                |CI2
  1480  #REPLACE DF_FILE_HANDLE_EXISTING_RESTRUCTURE  |CI3
  1481  #REPLACE DF_FILE_HANDLE_NEW_RESTRUCTURE       |CI4
  1482
  1483  // File transaction types
  1484  #REPLACE DF_FILE_TRANSACTION_NONE             |CI0
  1485  #REPLACE DF_FILE_TRANSACTION_CLIENT_ATOMIC    |CI1
  1486  #REPLACE DF_FILE_TRANSACTION_SERVER_ATOMIC    |CI2
  1487  #REPLACE DF_FILE_TRANSACTION_SERVER_LOGGED    |CI3
  1488
  1489  // Types of restructure required
  1490  #REPLACE DF_NO_RESTRUCTURE            |CI0
  1491  #REPLACE DF_RESTRUCTURE_FILE          |CI1
  1492  #REPLACE DF_RESTRUCTURE_INDEX         |CI2
  1493  #REPLACE DF_RESTRUCTURE_BOTH          |CI3
  1494
  1495  // File touched attribute
  1496  #REPLACE DF_FILE_NOT_TOUCHED         |CI48
  1497  #REPLACE DF_FILE_TOUCHED_INACTIVE    |CI49
  1498  #REPLACE DF_FILE_TOUCHED_ACTIVE      |CI50
  1499
  1500  #REPLACE DF_FILEMODE_ORIGINAL    -1 // only valid for smart_filemode in data sets
  1501  #REPLACE DF_FILEMODE_DEFAULT     0
  1502  #REPLACE DF_FILEMODE_NO_REREAD   1
  1503  #REPLACE DF_FILEMODE_NO_LOCKS    2
  1504  #REPLACE DF_FILEMODE_NO_EDITS    8
  1505  #REPLACE DF_FILEMODE_NO_DELETES  16
  1506  #REPLACE DF_FILEMODE_NO_FINDS    32
  1507  #REPLACE DF_FILEMODE_NO_CREATES  64
  1508  #REPLACE DF_FILEMODE_READONLY    91
  1509  #REPLACE DF_FILEMODE_SINGLE_USER 3
  1510
  1511  // File closing type
  1512  #REPLACE DF_PERMANENT 0
  1513  #REPLACE DF_TEMPORARY 1
  1514
  1515  // File locking types
  1516  #REPLACE DF_LOCK_TYPE_NONE     |CI0
  1517  #REPLACE DF_LOCK_TYPE_FILE     |CI1
  1518  #REPLACE DF_LOCK_TYPE_RECORD   |CI2
  1519
  1520  // Modes for openning a file.
  1521  #REPLACE DF_SHARE               |CI0
  1522  #REPLACE DF_EXCLUSIVE           |CI1
  1523
  1524  // Index types
  1525  #REPLACE DF_INDEX_TYPE_ONLINE   |CI0
  1526  #REPLACE DF_INDEX_TYPE_BATCH    |CI1
  1527
  1528  // Segment case used?
  1529  #REPLACE DF_CASE_USED     |CI0
  1530  #REPLACE DF_CASE_IGNORED  |CI1
  1531
  1532  // Segment direction
  1533  #REPLACE DF_ASCENDING     |CI0
  1534  #REPLACE DF_DESCENDING    |CI1
  1535
  1536  // Field Types
  1537  #REPLACE DF_ASCII      |CI0
  1538  #REPLACE DF_BCD        |CI1
  1539  #REPLACE DF_DATE       |CI2
  1540  #REPLACE DF_OVERLAP    |CI3
  1541  #REPLACE DF_TEXT       |CI5
  1542  #REPLACE DF_BINARY     |CI6
  1543
  1544  // dfStructureEnd Option bits
  1545  #REPLACE DF_STRUCTEND_OPT_NONE       |CI0
  1546  #REPLACE DF_STRUCTEND_OPT_FORCE      |CI1
  1547  #REPLACE DF_STRUCTEND_OPT_RECOMPRESS |CI2
  1548  #REPLACE DF_STRUCTEND_OPT_IN_PLACE   |CI4
  1549  #REPLACE DF_STRUCTEND_OPT_NO_SORT    |CI8
  1550
  1551  #REPLACE DF_SORT_OPTION_NONE             |CI0
  1552  #REPLACE DF_SORT_OPTION_NO_DATA_CHECK    |CI8
  1553  #REPLACE DF_SORT_OPTION_BAD_DATA_FIXUP   |CI16
  1554  #REPLACE DF_SORT_OPTION_BAD_DATA_FILE    |CI32
  1555  #REPLACE DF_SORT_OPTION_BAD_DATA_ABORT   |CI64
  1556  #REPLACE DF_SORT_OPTION_DUP_DATA_FILE    |CI128
  1557  #REPLACE DF_SORT_OPTION_DUP_DATA_ABORT   |CI256
  1558
  1559  // Field fill types
  1560  #REPLACE DF_HIGH     |CI0
  1561  #REPLACE DF_LOW      |CI1
  1562
  1563  // Resource Types
  1564  // DAC reservers the negative values, you may use the positive values,
  1565  // 0 means uninitialized or error.
  1566  #REPLACE DF_RESOURCE_TYPE_ERROR     |CI0  // if resource is invalid
  1567                                            // or uninitialized.
  1568  #REPLACE DF_RESOURCE_TYPE_BINARY    |CI-1 // use this with include_resource for
  1569                                            // bitmaps and other binary files.
  1570  #REPLACE DF_RESOURCE_TYPE_LINE      |CI-2 // default type for resources.
  1571
  1572  // These symbols are passed to the SYSCONF function to determine
  1573  // which OS specific item is returned.
  1574  #REPLACE SYSCONF_TIMER_RESOLUTION     |CI0
  1575  #REPLACE SYSCONF_DIR_SEPARATOR        |CI1
  1576  #REPLACE SYSCONF_OS_SHORT_NAME        |CI2
  1577  #REPLACE SYSCONF_OS_MAJOR_REV         |CI3
  1578  #REPLACE SYSCONF_OS_MINOR_REV         |CI4
  1579  #REPLACE SYSCONF_OS_NAME              |CI5
  1580  #REPLACE SYSCONF_MACHINE_NAME         |CI6
  1581  #REPLACE SYSCONF_FILE_MASK            |CI7
  1582  #REPLACE SYSCONF_DATAFLEX_REV         |CI8
  1583  #REPLACE SYSCONF_SYSTEM_NAME          |CI9
  1584  #REPLACE SYSCONF_PATH_SEPARATOR       |CI10
  1585  #REPLACE SYSCONF_RUNTIME_NAME         |CI11
  1586  #REPLACE SYSCONF_UTC_TIME_OFFSET      |CI12
  1587
  1588
  1589  // Subsystem numbers
  1590  #REPLACE DF_CMD_SUBSYSTEM_REV    |CI3
  1591  #REPLACE DF_UI_SUBSYSTEM_REV     |CI1
  1592  #REPLACE DF_DS_SUBSYSTEM_REV     |CI1
  1593
  1594  #REPLACE DF_CMD_SUBSYSTEM    |CI0
  1595  #REPLACE DF_UI_SUBSYSTEM     |CI1
  1596  #REPLACE DF_DS_SUBSYSTEM     |CI2
  1597
  1598  #REPLACE DF_NUMBER_SUBSYSTEMS |CI3
  1599
  1600  #REPLACE ENUM_LIST ENUMERATION_LIST
  1601  #REPLACE END_ENUM_LIST END_ENUMERATION_LIST
  1602
  1603  //
  1604  // Date Constants
  1605  //
  1606  #REPLACE DATE4_STATE    |CI0
  1607  #REPLACE EPOCH_VALUE    |CI1
  1608  #REPLACE SYSDATE4_STATE |CI2
  1609
  1610  // These are values to be used by the raw file commands
  1611  // representing different file permission bits
  1612  #REPLACE DF_FLEX_UID_EXECUTE   |CI1024  //04000
  1613  #REPLACE DF_FLEX_GID_EXECUTE   |CI512   //02000
  1614  #REPLACE DF_FLEX_OWNER_READ    |CI256   //00400
  1615  #REPLACE DF_FLEX_OWNER_WRITE   |CI128   //00200
  1616  #REPLACE DF_FLEX_OWNER_EXECUTE |CI64    //00100
  1617  #REPLACE DF_FLEX_GROUP_READ    |CI32    //00040
  1618  #REPLACE DF_FLEX_GROUP_WRITE   |CI16    //00020
  1619  #REPLACE DF_FLEX_GROUP_EXECUTE |CI8     //00010
  1620  #REPLACE DF_FLEX_WORLD_READ    |CI4     //00004
  1621  #REPLACE DF_FLEX_WORLD_WRITE   |CI2     //00002
  1622  #REPLACE DF_FLEX_WORLD_EXECUTE |CI1     //00001
  1623  #REPLACE DF_FLEX_ALL_RIGHTS    |CI20471
  1624
  1625  #SET  N$ 2 // save 0,1 stacks for IF/ELSE
  1626  #SET ZR$ 0 // for compile-time-assigned resource_ids
  1627  #SET ZS$ 0 // for enumerated lists
  1628  #SET ZT$ 0 //  "       "       "
  1629  #XPUSH !n $INIT
  1630  #CHKSUB 0 4  // Verify the General Flex subsystem.
  1631#ENDCOMMAND
  1632
  1633#COMMAND FOR &ECFWGSNR#LU "FROM" %UGLR# "TO""" %UGL#
  1634  #SET N$ !N
  1635  #PUSH !R
  1636  #XPUSH !n $INIT
  1637  //MOVEINT !3 TO !1
  1638  !A [] $082 !3 !1
  1639  #IF (!0>3)
  1640    // IF !1 LE !5 GOTO FOR$!r
  1641    !A [] $4004 !1 !5 |11 |2
  1642    !A [|11] $041 |CL0
  1643    #FREF FOR$!r !a
  1644  #ENDIF
  1645  #$ !A 0 0 0 $041 |CL0
  1646  #FREF END$!r !a
  1647  #$ BEGIN$!r:
  1648  #$ WHILE$!r:
  1649  #IF !0=3
  1650    #$ !A [] $083 !1
  1651  #ELSE
  1652    #$ !A [] $083 !1 !5
  1653    #$ !A [|122] $041 |CL0
  1654    #FREF END$!r !a
  1655  #ENDIF
  1656  FOR$!r:
  1657#ENDCOMMAND
  1658
  1659// FORMAT window {}
  1660// FORMAT window THRU window {}
  1661
  1662#COMMAND FORMAT RUVCFL#G
  1663  #IF !0>2
  1664    FORMAT$RANGE !1 !2 !3 !4 !5
  1665  #ELSE
  1666    #CHECK !2 _RVCFWL#BE
  1667    #CHECK !3 .
  1668    #FORMAT !1 !2
  1669  #ENDIF
  1670#ENDCOMMAND
  1671
  1672#COMMAND FORMAT$RANGE ERUVCFL#G "THRU""THROUGH" ERUVCFL#G RVCFWL#B .
  1673  #FORMAT !1 !4
  1674  #IF (!1<!3)
  1675    #SET Q$ !1
  1676    FORMAT$RANGE |WS!Q THRU !3 !4
  1677  #ENDIF
  1678#ENDCOMMAND
  1679
  1680#COMMAND FORMFEED &.    // just like PAGECHECK 500
  1681  !A [] $203 |CI500 |CI0
  1682#ENDCOMMAND
  1683
  1684#COMMAND GET_ARGUMENT_SIZE "TO" _RUDCE#LGB .
  1685  !A [] $24F !2
  1686#ENDCOMMAND
  1687
  1688//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1689//
  1690//  Command:
  1691//      GET_CHANNEL_SIZE channelNumber TO integerVariable
  1692//
  1693//   Descrtiption:
  1694//      A command to retrieve the "size" of a sequential device (opened with
  1695//      direct_input). Warning, devices that do not support the concept of
  1696//      "size" (such as LST:) report an error.
  1697//
  1698//   Parmeters:
  1699//       channelNumber
  1700//            Number of a valid (open) channel.
  1701//       integerVariable
  1702//            Variable to return the channel size to. If the channel is not
  1703//            open, 0 is returned.
  1704//
  1705//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1706
  1707#COMMAND GET_CHANNEL_SIZE #LRUG$ "TO" #LRUG$EC .
  1708  !A [] $111 !1 !3
  1709#ENDCOMMAND
  1710
  1711//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1712//
  1713//  Command:
  1714//      GET_RESOURCE_TYPE resourceName|resourceId TO integerVariable
  1715//
  1716//   Descrtiption:
  1717//      A command to retrieve the type of a resource at runtime. (Note: the
  1718//      resource type is set a compile-time.) For the first parameter, you may
  1719//      pass either the resource name (not in quotes) or the integer value of
  1720//      the resource id.
  1721//
  1722//   Parmeters:
  1723//       resourceName
  1724//            Name of a resource.
  1725//       resourceId
  1726//            Integer value of a resource id. (The resource name is just a
  1727//            symbolic replacement (with a .RSC suffix) of a constant integer
  1728//            equal to the resource id.)
  1729//       integerVariable
  1730//            Variable to return the resource type to.
  1731//
  1732//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1733
  1734#COMMAND GET_RESOURCE_TYPE _R TO %#USGLR
  1735  #IFDEF !1
  1736    !A [] $112 !1 !3
  1737  #ELSE
  1738    !A [] $112 !1.RSC !3
  1739  #ENDIF
  1740#ENDCOMMAND
  1741
  1742#COMMAND GET_CURRENT_COLORS "TO" _RUDCE#LGB _RUDCE#LGB .
  1743  !A [] $14E !2 !3
  1744#ENDCOMMAND
  1745
  1746#COMMAND GET_CURRENT_DIRECTORY "TO" _RUDCE#LGB .
  1747  !A [] $2D1 !2
  1748#ENDCOMMAND
  1749
  1750#COMMAND GET_CURRENT_INPUT_CHANNEL "TO" _RUDCE#LGB .
  1751  !A [] $10D !2
  1752#ENDCOMMAND
  1753
  1754#COMMAND GET_CURRENT_LOCKCOUNT "TO" _RUDCE#LGB .
  1755  !A [] $0E6 !2
  1756#ENDCOMMAND
  1757
  1758#COMMAND GET_CURRENT_OUTPUT_CHANNEL "TO" _RUDCE#LGB .
  1759  !A [] $10E !2
  1760#ENDCOMMAND
  1761
  1762#COMMAND GET_CURRENT_USER_COUNT "TO" _RUDCE#LGB .
  1763  !A [] $2DB !2
  1764#ENDCOMMAND
  1765
  1766#COMMAND GET_DATE_FORMAT "TO" _RUDCE#LGB .
  1767  !A [] $2D8 !2
  1768#ENDCOMMAND
  1769
  1770#COMMAND GET_ENVIRONMENT &RD#GOBLU "TO" _RCEUGOB# .
  1771  !A [] $2CF !1 !3
  1772#ENDCOMMAND
  1773
  1774#COMMAND GET_LICENSED_MAX_USERS "TO" _RUDCE#LGB .
  1775  !A [] $2DA !2
  1776#ENDCOMMAND
  1777
  1778#COMMAND GET_NUMBER_FORMAT "TO" _RUDCE#LGB .
  1779  !A [] $2D9 !2
  1780#ENDCOMMAND
  1781
  1782#COMMAND GETXY #USGLR #USGLR .
  1783  !A [] $14D !1 !2
  1784#ENDCOMMAND
  1785
  1786#COMMAND GOSUB &RVFWSNDE#G .
  1787  #IFDEF !1
  1788    !A [] $042 !1
  1789  #ELSE
  1790    !A [] $042 |CL0
  1791    #FREF !1 !a
  1792  #ENDIF
  1793#ENDCOMMAND
  1794
  1795#COMMAND GOTO &RVFWSNDE#G .
  1796  #IFDEF !1
  1797    !A [] $041 !1
  1798  #ELSE
  1799    !A [] $041 |CL0
  1800    #FREF !1 !a
  1801  #ENDIF
  1802#ENDCOMMAND
  1803
  1804#COMMAND GOTOXY &%#USGL %#USGLR .
  1805  !A [] $145 !1 !2
  1806#ENDCOMMAND
  1807
  1808#COMMAND HELP &T .
  1809  #IF !0>0
  1810    #CHECK !1.N _U
  1811    !A [] $1C5 !1.N
  1812  #ELSE
  1813    !A [] $1C5 |CI0
  1814  #ENDIF
  1815#ENDCOMMAND
  1816
  1817#COMMAND IF LR
  1818  #IFSAME !1 ~
  1819    IFNOT !2 !3 !4 !5 !6 !7 !8 !9
  1820  #ELSE
  1821    #IFSAME !1 STATUS
  1822      INDCT$STATUS LASTIF STATUS !2
  1823      IF$HELP !3 !4 !5 !6 !7 !8 !9
  1824    #ELSE
  1825      #IFSAME !2 $0 $1 $2 $3 $4 $5 MATCH IN
  1826        INDCT$AS LASTIF AS !1 !2 !3
  1827        IF$HELP  !4 !5 !6 !7 !8 !9
  1828      #ELSE
  1829        #IFCLASS !1 "G"
  1830          INDCT$GROUP LASTIF GROUP ALL !1
  1831        #ELSE
  1832          INDCT$AS LASTIF AS !1
  1833        #ENDIF
  1834        IF$HELP !2 !3 !4 !5 !6 !7 !8 !9
  1835      #ENDIF
  1836    #ENDIF
  1837  #ENDIF
  1838#ENDCOMMAND
  1839
  1840#COMMAND IFNOT LR
  1841  #IFSAME !1 ~
  1842    IF !2 !3 !4 !5 !6 !7 !8 !9
  1843  #ELSE
  1844    #IFSAME !1 STATUS
  1845      INDCT$STATUS LASTIF~ STATUS !2
  1846      IF$HELP !3 !4 !5 !6 !7 !8 !9
  1847    #ELSE
  1848      #IFSAME !2 $0 $1 $2 $3 $4 $5 MATCH IN
  1849        INDCT$AS LASTIF~ AS !1 !2 !3
  1850        IF$HELP  !4 !5 !6 !7 !8 !9
  1851      #ELSE
  1852        #IFCLASS !1 "G"
  1853          INDCT$GROUP LASTIF~ GROUP ALL !1
  1854        #ELSE
  1855          INDCT$AS LASTIF~ AS !1
  1856        #ENDIF
  1857        IF$HELP !2 !3 !4 !5 !6 !7 !8    !9
  1858      #ENDIF
  1859    #ENDIF
  1860  #ENDIF
  1861#ENDCOMMAND
  1862
  1863#COMMAND IF_ LR // THIS IF_ WILL NOT WORK WITH ELSE!
  1864  #IFSAME !1 ~
  1865    IFNOT_ !2 !3 !4 !5 !6 !7 !8 !9
  1866  #ELSE
  1867    #IFSAME !1 STATUS
  1868      INDCT$STATUS LASTIF STATUS !2
  1869      [LASTIF] !3 !4 !5 !6 !7 !8 !9
  1870    #ELSE
  1871      #IFSAME !2 $0 $1 $2 $3 $4 $5 MATCH IN
  1872        INDCT$AS LASTIF AS !1 !2 !3
  1873        [LASTIF] !4 !5 !6 !7 !8 !9
  1874      #ELSE
  1875        #IFCLASS !1 "G"
  1876          INDCT$GROUP LASTIF GROUP ALL !1
  1877        #ELSE
  1878          INDCT$AS LASTIF AS !1
  1879        #ENDIF
  1880        [LASTIF] !2 !3 !4 !5 !6 !7 !8 !9
  1881      #ENDIF
  1882    #ENDIF
  1883  #ENDIF
  1884#ENDCOMMAND
  1885
  1886#COMMAND IFNOT_ LR // THIS IFNOT_ WILL NOT WORK WITH ELSE!
  1887  #IFSAME !1 ~
  1888    IF_ !2 !3 !4 !5 !6 !7 !8 !9
  1889  #ELSE
  1890    #IFSAME !1 STATUS
  1891      INDCT$STATUS LASTIF~ STATUS !2
  1892      [LASTIF] !3 !4 !5 !6 !7 !8 !9
  1893    #ELSE
  1894      #IFSAME !2 $0 $1 $2 $3 $4 $5 MATCH IN
  1895        INDCT$AS LASTIF~ AS !1 !2 !3
  1896        [LASTIF] !4 !5 !6 !7 !8 !9
  1897      #ELSE
  1898        #IFCLASS !1 "G"
  1899          INDCT$GROUP LASTIF~ GROUP ALL !1
  1900        #ELSE
  1901          INDCT$AS LASTIF~ AS !1
  1902        #ENDIF
  1903        [LASTIF] !2 !3 !4 !5 !6 !7 !8 !9
  1904      #ENDIF
  1905    #ENDIF
  1906  #ENDIF
  1907#ENDCOMMAND
  1908
  1909#COMMAND IF$HELP
  1910  !A [~LASTIF] $41 |CI0   // If LASTIF is false jump to end of IF command.
  1911  #XPUSH 1 !a     // Save line number of jump at static nesting level.
  1912  #XPUSH 0 !n     // Save nesting level in stack 0.
  1913  !1 !2 !3 !4 !5 !6 !7 !8 !9
  1914  #XPOP 0 Q$      // Restore nesting level into Q.
  1915  #XPOP  1 S$     // Restore IF JUMP line number
  1916  #XPUSH !q !s        // Push it back for the ELSE.
  1917  #IF (!n>!q)     // after a begin
  1918    #FREF END$!r !s    // Make IF JUMP goto end of begin block.
  1919  #ELSE       // same or lower nesting level
  1920    #FREF (!a+1) !s    // Make IF JUMP goto end of the IF.
  1921  #ENDIF
  1922#ENDCOMMAND
  1923
  1924#COMMAND IFCHANGE R R
  1925  #IFDEF !1
  1926    #CHECK !1 _RFCVGE
  1927    !A [] $1C6 !1
  1928  #ELSE
  1929    #CHECK !1.RECNUM _RWCVG
  1930    !A [] $303 !1.RECNUM
  1931  #ENDIF
  1932  [|122] !2 !3 !4 !5 !6 !7 !8 !9
  1933#ENDCOMMAND
  1934
  1935//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1936//
  1937//  Command:
  1938//      INCLUDE_RESOURCE fileName AS resourceName {TYPE resourceType}
  1939//
  1940//   Descrtiption:
  1941//      A command to include (embed) a file as a resource.
  1942//
  1943//   Parmeters:
  1944//       fileName
  1945//            Name of a file (NOT in quotes) to include. May include a path.
  1946//       resourceName
  1947//            Name of the resource (NOT in quotes).
  1948//       resourceType
  1949//            A constant integer (or a symbolic replacement for a constant
  1950//            integer) that is recorded in the .flx to indicate the type of
  1951//            resource. If omitted, DF_RESOURCE_TYPE_LINE is assumed. You
  1952//            uase any positive value for user-defined types. Do NOT use
  1953//            0. 0 means the resource is uninitialized (registered, but not
  1954//            included.) DAC reserves the negative values.
  1955//
  1956//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1957
  1958#COMMAND INCLUDE_RESOURCE _TR "AS" _R """TYPE" _%USNVLE#
  1959  #IF (!0>3)
  1960    #SET Q$ !5 // specified type.
  1961  #ELSE
  1962    #SET Q$ DF_RESOURCE_TYPE_LINE // default to line.
  1963  #ENDIF
  1964  #IFDEF !3.RSC
  1965    #RESOURCE !1 !3.RSC !q $0  // re-register resource; $0 = already named (just
  1966  #ELSE                    // setting resource filename and type).
  1967    #REPLACE !3.RSC |CI!ZR // create unique resource id.
  1968    #RESOURCE !1 !Zr !q !3 // register new resource.
  1969  #ENDIF
  1970#ENDCOMMAND
  1971
  1972#COMMAND INCREMENT #ELCRUG .
  1973  #IFTYPE !1 "IV"
  1974     !A [] $083 !1 |CI0
  1975  #ELSE
  1976     Move (!1 + 1) to !1
  1977   #ENDIF
  1978#ENDCOMMAND
  1979
  1980#COMMAND INDCT$$0 &
  1981  !A [] $4028 |CI0 |CI0 !1 !3
  1982#ENDCOMMAND
  1983
  1984#COMMAND INDCT$$1 &RX R .
  1985  !A [] $4028 |CI0 |CI0 !1~ !3
  1986#ENDCOMMAND
  1987
  1988#COMMAND INDCT$AS &RX "AS" LU "$0""$1""$2""$3""$4""$5""MATCH""IN""" #LUG .
  1989  #IF (!0<4)
  1990    #IFCLASS !3 "G"
  1991      #CHECK !4 ""     // INDICATE IND1 AS IND2
  1992      #CHECK !3 _SNDI#LO
  1993      !A [] $4020 !3 |GB[0] !1 |3
  1994    #ELSE
  1995      // INDICATE IND AS X
  1996      #CHECK !3 _U
  1997      #IFTYPE  !3 "R"
  1998        !A [] IN$5 !3 |CR0 !1 |3
  1999      #ELSE
  2000        #IFTYPE  !3 "ND"
  2001          !A [] IN$5 !3 |CN0 !1 |1
  2002        #ELSE
  2003          #IFTYPE !3 "IL"
  2004            !A [] IN$5 !3 |CI0 !1 |2
  2005          #ELSE
  2006            #IFTYPE !3 "S"
  2007              !A [] IN$5 !3 |CS"" !1 |0
  2008            #ELSE
  2009              #CHECK !3 _O
  2010              !A [] $4020 !3 |GB[0] !1 IN$GLALL |3
  2011            #ENDIF
  2012          #ENDIF
  2013        #ENDIF
  2014      #ENDIF
  2015    #ENDIF
  2016  #ELSE
  2017    #CHECK !5 _R
  2018    #IFSAME !4 MATCH
  2019      !A [] $4031 !3 !5 !1 !6
  2020    #ELSE
  2021      #IFSAME !4 IN
  2022        !A [] $4030 !3 !5 !1 !6
  2023      #ELSE
  2024        #CHECK !3 _U
  2025        #IF2TYPE  !3 !5 "R"
  2026          !A [] IN!4 !3 !5 !1 !6 |3
  2027        #ELSE
  2028          #IF2TYPE  !3 !5 "ND"
  2029            !A [] IN!4 !3 !5 !1 !6 |1
  2030          #ELSE
  2031            #IF2TYPE !3 !5 "IL"
  2032              !A [] IN!4 !3 !5 !1 !6 |2
  2033            #ELSE
  2034              !A [] IN!4 !3 !5 !1 !6 |0
  2035            #ENDIF
  2036          #ENDIF
  2037        #ENDIF
  2038      #ENDIF
  2039    #ENDIF
  2040  #ENDIF
  2041#ENDCOMMAND
  2042
  2043#COMMAND INDCT$GROUP &XR "GROUP" R"ALL""ANY" CVFWSN#LRU "AND""OR""" "ANY""ALL""" CVFWSN#LU .
  2044  #IF !0>4
  2045    #CHECK !7 _R
  2046    !A [] $4020 !4 !7 !1 IN$GL!3 IN$GR!6 IN$GM!5
  2047  #ELSE
  2048    !A [] $4020 !4 |GB[0] !1 IN$GL!3 |3
  2049  #ENDIF
  2050#ENDCOMMAND
  2051
  2052#COMMAND INDCT$STATUS &R R #LWCV
  2053  #IFDEF !3
  2054    !A [] $4029 !3 |CI0 !1 !4
  2055  #ELSE
  2056    #CHECK !3.RECNUM U#LWCV
  2057    !A [] $4029 !3.RECNUM |CI0 !1 !4
  2058  #ENDIF
  2059#ENDCOMMAND
  2060
  2061#COMMAND INDEX_DEF R R#LGU "TO" #LGRNDCE #LGNDCE #LGNDCE
  2062  #IFDEF !1
  2063    !A [] $82 !1 FILENUMBER
  2064  #ELSE
  2065    #CHECK !1.RECNUM _UE
  2066    #SET Q$ !1.RECNUM
  2067    !A [] $82 |CI!q FILENUMBER
  2068  #ENDIF
  2069  !A [] $344 !2 !4 // index fields
  2070  #IF !0>4
  2071    !A [] $82 STRLEN !5 // number of fields
  2072    #IF !0>5
  2073      !A [] $349 !2 !6 // index attributes
  2074    #ENDIF
  2075  #ENDIF
  2076#ENDCOMMAND
  2077
  2078#COMMAND INDICATE R
  2079  #IFSAME !1 ~
  2080    #IFDEF !2
  2081    #ELSE
  2082      #REPLACE !2 |!C
  2083    #ENDIF
  2084    INDICATE !2~ !3 !4 !5 !6 !7 !8 !9
  2085  #ELSE
  2086    // #CHECK !2 "AS""STATUS""$0""$1""GROUP"
  2087    #IFDEF !1
  2088      #CHECK !1 _X
  2089    #ELSE
  2090      #REPLACE !1 |!C
  2091    #ENDIF
  2092    INDCT$!2 !1 !2 !3 !4 !5 !6 !7 !8 !9
  2093  #ENDIF
  2094#ENDCOMMAND
  2095
  2096#COMMAND INDICATOR RT
  2097  #REPLACE !1 |!C
  2098  #IF (!0>1)
  2099    INDICATOR !2 !3 !4 !5 !6 !7 !8 !9
  2100  #ENDIF
  2101#ENDCOMMAND
  2102
  2103#COMMAND INHERIT_SCREEN &.
  2104  !A [] $14B
  2105#ENDCOMMAND
  2106
  2107#COMMAND INKEY #LUCRE &.
  2108  !A [] $147 !1
  2109#ENDCOMMAND
  2110
  2111#COMMAND INKEY$ #LUCRE &.
  2112  !A [] $149 !1
  2113#ENDCOMMAND
  2114
  2115#COMMAND INPUT &#ULGR #LUG #ULG .
  2116  #IFCLASS !1 "C"
  2117    #CHECK !2 _RCLUEG _RCLUG
  2118    //move 0 to strmark
  2119    !A  [] $086 |CI0 |VI12
  2120    !A [] $142 !1
  2121    // INPUT !2 !3
  2122    !A [] $140 !2 !3 |CI79
  2123  #ELSE
  2124    #CHECK !1 _RCLUEG
  2125    !A [] $140 !1 !2 |CI79
  2126  #ENDIF
  2127#ENDCOMMAND
  2128
  2129#COMMAND INSERT #LGR "IN" #LGRCE "AT"""
  2130  #IF (!0>3)
  2131    #CHECK !5 #LGR%
  2132    //MOVEINT !5 TO STRMARK
  2133    !A [] $82 !5 STRMARK
  2134  #ENDIF
  2135  !A [] $24C !3 !1
  2136#ENDCOMMAND
  2137
  2138//JJT-5.1
  2139//#COMMAND INTEGER TR
  2140//  // ALLOW FOR MORE INTS
  2141//  #REPLACE !1 |VI!D
  2142//  #IF (!0>1)
  2143//    INTEGER !2 !3 !4 !5 !6 !7 !8 !9
  2144//  #ENDIF
  2145//#ENDCOMMAND
  2146
  2147#COMMAND IS_FILE_INCLUDED R R "TO"""
  2148  !A [] $E0 !1 !2
  2149  #IF !0>2
  2150    #CHECK !4 _CUEGRL
  2151    MOVE (FOUND) TO !4
  2152  #ENDIF
  2153#ENDCOMMAND
  2154
  2155#COMMAND KEYCHECK
  2156  !A [] $046
  2157  #IF !0>0
  2158    [KEYPRESS] !1 !2 !3 !4 !5 !6 !7 !8
  2159  #ENDIF
  2160#ENDCOMMAND
  2161
  2162#COMMAND KEYPROC &R%WVF """GOSUB" WFVNSD# .
  2163  #IFSAME !1 ON
  2164    !A [] $82 |CI0 |VI33
  2165  #ELSE
  2166    #IFSAME !1 OFF
  2167      !A [] $82 |CI9999 |VI33
  2168    #ELSE
  2169      #SET Y$ !a
  2170      #IF (!0>1)
  2171        // MOVEINT ADR(3) TO KEY LOC
  2172        #SET Q$ (!1-100+40) // address in SYSINT
  2173        #IFDEF !3
  2174          !A [] $082 !3 |VI!q
  2175        #ELSE
  2176          !A [] $082 |CI0 |VI!q
  2177          #FREF !3 !a
  2178        #ENDIF
  2179      #ELSE
  2180        #SET Q$ (!1-100)
  2181        #KEYPROC !q !Y
  2182      #ENDIF
  2183    #ENDIF
  2184  #ENDIF
  2185#ENDCOMMAND
  2186
  2187#COMMAND LEFT &#UGL$ "TO" #UEGRLC L#% .
  2188  #IF !0>3
  2189    !A [] $082 !4 STRMARK
  2190  #ENDIF
  2191  !A [] $241 !1 !3
  2192#ENDCOMMAND
  2193
  2194#COMMAND LENGTH &#LUG$ "TO" C#LREUG .
  2195  !A [] $246 !1 !3
  2196#ENDCOMMAND
  2197
  2198#COMMAND LOCK &.
  2199  !A [] $0C7
  2200#ENDCOMMAND
  2201
  2202#COMMAND LOOP &.
  2203  #POP S$
  2204  #CHECK BEGIN$!s _RVFWSNDEU
  2205  !A [] $041 BEGIN$!s
  2206  END$!s:
  2207  #SET N$ !n-1
  2208#ENDCOMMAND
  2209
  2210#COMMAND MAKEDEF$   // make a list of symbols defined
  2211  #IF !0>0
  2212    #IFDEF !1
  2213    #ELSE
  2214      !1:
  2215    #ENDIF
  2216    #IF !0>1
  2217      MAKEDEF$ !2 !3 !4 !5 !6 !7 !8 !9
  2218    #ENDIF
  2219  #ENDIF
  2220#ENDCOMMAND
  2221
  2222#COMMAND MAKE_FILE RU#LG U#LG U#LG U#LG .
  2223  !A [] $34A !4
  2224  #IF !0>2
  2225    !A [] $82 !3 FILENUMBER
  2226  #ELSE
  2227    !A [] $82 |CI0 FILENUMBER
  2228  #ENDIF
  2229  #IF !0>1
  2230    !A [] $346 !1 !2
  2231  #ELSE
  2232    !A [] $346 !1 |CS''
  2233  #ENDIF
  2234#ENDCOMMAND
  2235
  2236#COMMAND MEMORY #LRCUGE &.
  2237  !A [] $2CA !1
  2238#ENDCOMMAND
  2239
  2240#COMMAND MID &#UGL$ "TO" #UGRLEC #L%U #L% .
  2241  #IF !0>4
  2242    !A [] $082 !5 STRMARK
  2243  #ENDIF
  2244  !A [] $082 !4 STRLEN
  2245  !A [] $245 !1 !3
  2246#ENDCOMMAND
  2247
  2248#REM  The type of a move is determined at compile time, based on the
  2249#REM  type of the destination.  The move type refers to the intermediate
  2250#REM  value to which the source will be converted.
  2251
  2252//JJT-5.1
  2253//#COMMAND MOVE #LU "TO" #GLEURC .
  2254//  #IFCLASS !1 "G"  // MOVE INDICATOR
  2255//    #CHECK !1 _VWFC
  2256//    !A [] $4020 !1 |GB[0] !3 IN$GLALL |3
  2257//  #ELSE
  2258//// Type independent move as of 2.3
  2259//    !A  [] $086 !1 !3
  2260//  #ENDIF
  2261//#ENDCOMMAND
  2262
  2263#COMMAND MOVEDATE &%#GULI "TO" #UCIGERL .
  2264  !A [] $084 !1 !3
  2265#ENDCOMMAND
  2266
  2267#COMMAND MOVEINT &%#GULD "TO" #UCSDEGRL .
  2268  !A [] $082 !1 !3
  2269#ENDCOMMAND
  2270
  2271#COMMAND MOVENUM &#ULG "TO" #UCLGREL .
  2272  !A [] $081 !1 !3
  2273#ENDCOMMAND
  2274
  2275#COMMAND MOVEREAL &#ULG "TO" #UCLGER .
  2276  !A [] $085 !1 !3
  2277#ENDCOMMAND
  2278
  2279#COMMAND MOVESTR &#ULG$ "TO" #UCLGR$E .
  2280  !A [] $080 !1 !3
  2281#ENDCOMMAND
  2282
  2283#COMMAND MULTI$     // repeat a command for each argument (internal)
  2284  #IF !0>1
  2285    !1 !2
  2286  #ENDIF
  2287  #IF !0>2
  2288    MULTI$ !1 !3 !4 !5 !6 !7 !8 !9
  2289  #ENDIF
  2290#ENDCOMMAND
  2291
  2292#COMMAND MULTIBACK$ // same as above, except that arguments
  2293  #IF !0>2        // are output in reverse order
  2294    MULTIBACK$ !1 !3 !4 !5 !6 !7 !8 !9
  2295  #ENDIF
  2296  #IF !0>1
  2297    !1 !2
  2298  #ENDIF
  2299#ENDCOMMAND
  2300
  2301#COMMAND NAME R#L T
  2302  #IFDEF !1
  2303    #REPLACE !2 !1
  2304    #CHECK !3 .
  2305  #ELSE
  2306    #IFCLASS !1.1 "W"
  2307      AUTOPAGE !1
  2308    #ELSE
  2309      AUTO3$ #REPLACE !1 PAGE!f
  2310    #ENDIF
  2311    #IF !0>1
  2312      NAME !2 !3 !4 !5 !6 !7 !8 !9
  2313    #ENDIF
  2314  #ENDIF
  2315#ENDCOMMAND
  2316
  2317// JJT-5.1
  2318//#COMMAND NUMBER TR
  2319//  #NUM V$
  2320//  #REPLACE !1 |VN!v
  2321//  #IF (!0>1)
  2322//    NUMBER !2 !3 !4 !5 !6 !7 !8 !9
  2323//  #ENDIF
  2324//#ENDCOMMAND
  2325
  2326#COMMAND ON R "GOTO""GOSUB""OFF" SNOBIODE
  2327  #IFSAME !1 ERROR
  2328    // MOVEINT ADDR to ONERROR (|VI31)
  2329    #IFDEF !3
  2330      !A [] $082 !3 |VI31
  2331      #CHECK !2 "GOSUB"
  2332    #ELSE
  2333      !A [] $082 |CI0 |VI31
  2334      #IFSAME !2 GOSUB
  2335        #FREF !3 !a
  2336      #ELSE
  2337        #CHECK !2 "OFF"
  2338      #ENDIF
  2339    #ENDIF
  2340  #ELSE
  2341    #SET Q$ (!0-1)
  2342    // INDICATE OK$1 AS !1 GT 0
  2343    #IFDEF OK$1
  2344    #ELSE
  2345    #REPLACE OK$1 |!C
  2346    #REPLACE OK$2 |!C
  2347    #ENDIF
  2348    #CHECK !1 _#ULGRS
  2349    !A [] $4010 !1 |CI0 OK$1 |2
  2350    // INDICATE OK$2 AS !1 LT !q
  2351    !A [] $4000 !1 |CI!q OK$2 |2
  2352    #SET Q$ (!a+2)
  2353    #IFSAME !2 GOTO
  2354    !A [OK$1 OK$2] $041 |CE(!q+!1 )
  2355    #ELSE
  2356    !A [OK$1 OK$2] $042 |CE(!q+!1 )
  2357    #ENDIF
  2358    #SET Q$ (!a+!0)
  2359    !A [] $041 |CL!q  //ERROR jump around GOTOs
  2360    MULTI$ GOTO !3 !4 !5 !6 !7 !8 !9
  2361  #ENDIF
  2362#ENDCOMMAND
  2363
  2364
  2365#REM OS$CALL makes a system BDOS call.  Only calls that can be passed
  2366#REM integer (not pointer) values can be used.  Use at your own risk!
  2367#REM Format of command:
  2368#REM OS$CALL <FUNCTION> <ARGUMENT> {TO <RESULT>}
  2369#REM <FUNCTION>    - BDOS function code - See O/S documentation.
  2370#REM <ARGUMENT>    - Integer value to pass with function (optional)
  2371#REM <RESULT>      - Result code returned by function
  2372
  2373#REM Example to set CP/M I/O byto to "NEW_IO_BYTE (integer):
  2374#REM OS$CALL 8 NEW_IO_BYTE
  2375
  2376#REM Example to get console status:
  2377#REM OS$CALL 12 0 TO CONSTAT //integer
  2378
  2379#COMMAND OS$CALL &#LRU%DG #L%UG "TO""" #LCGUE .
  2380  !A [] $2C8 !1 !2
  2381  #IF !0>3
  2382    //MOVEINT STRMARK TO !4
  2383    !A [] $82 STRMARK !4
  2384  #ENDIF
  2385#ENDCOMMAND
  2386
  2387#COMMAND OUTCLOSE &.
  2388  // OUTFILE 'CON:'
  2389  !A [] $200 |CS'CON:'
  2390#ENDCOMMAND
  2391
  2392#COMMAND OUTFILE &NDILU#G .
  2393  !A [] $200 !1
  2394#ENDCOMMAND
  2395
  2396#COMMAND OUTPUT
  2397  #IFSAME !1 CHANNEL
  2398    !A [] $10A |CI1 !2
  2399    OUTPUT !3
  2400  #ELSE
  2401    #CHECK !2 .
  2402    #IF !0>0
  2403      #CHECK !1.N _#LUGFV
  2404      !A [] $202 !1.N
  2405    #ELSE
  2406      !A [] $202 |VI9
  2407    #ENDIF
  2408  #ENDIF
  2409#ENDCOMMAND
  2410
  2411#COMMAND OUTPUT_WRAP R
  2412  #IFSAME !1 CHANNEL
  2413    !A [] $10A |CI1 !2
  2414    OUTPUT_WRAP !3
  2415  #ELSE
  2416    #CHECK !2 .
  2417    #CHECK !1.N _#LUGFV
  2418    !A [] $20A !1.N // Fill wrap fields and set |122 if empty
  2419    OUTPUT !1
  2420    [NOT |122] BLANKFORM !1
  2421    !A [NOT |122] $20A !1.N
  2422    [NOT |122] REPEAT
  2423    #IFDEF NEWPAGE
  2424      PAGECHECK !1.LINES
  2425      [PAGEBREAK] GOSUB NEWPAGE
  2426    #ENDIF
  2427    OUTPUT !1
  2428    !A [] $20A !1.N // get more from wrap fields
  2429    [NOT |122] LOOP
  2430  #ENDIF
  2431#ENDCOMMAND
  2432
  2433#COMMAND PAD &#ULG$ "TO" #ULGRCE L%# .
  2434  #IF !0>3
  2435    !A [] $082 !4 STRMARK
  2436  #ENDIF
  2437  !A [] $240 !1 !3
  2438#ENDCOMMAND
  2439
  2440#COMMAND PAGE R%
  2441  #IFSAME !1 SET
  2442    #IF !0>1
  2443      //  Set attributes for future use
  2444      #CHECK !2.N _RU#LG
  2445      MOVE !2.N TO STRMARK
  2446      FIND$PAGE !3 !4 !5
  2447      FIND$PAGE !6 !7 !8
  2448    #ELSE
  2449      //  Page an image named SET immediately
  2450      !A [] $1C0 !1.N
  2451    #ENDIF
  2452  #ELSE
  2453    #IF !0>1
  2454      //  Set attributes for use now
  2455      #CHECK !1.N _RU#LG
  2456      MOVE !1.N TO STRMARK
  2457      FIND$PAGE !2 !3 !4
  2458      FIND$PAGE !5 !6 !7
  2459    #ENDIF
  2460    //  Put image with new attributes on screen now
  2461    //  OR, put regular image on screen now.
  2462    !A [] $1C0 !1.N
  2463  #ENDIF
  2464#ENDCOMMAND
  2465
  2466#COMMAND PAGECHECK &#LG% .
  2467  #IFDEF !1  |CI0
  2468    !A [] $203 !1 |CI0
  2469  #ELSE
  2470    #CHECK !1.LINES _VFWU#LG
  2471    !A [] $203 !1.LINES |CI0
  2472  #ENDIF
  2473#ENDCOMMAND
  2474
  2475#COMMAND POS &#UGRL$ "IN" #UGRL$ #L% #L% .
  2476  !A [] $244 !1 !3
  2477  #IF !0>3
  2478    #CHECK !4 "TO"
  2479    #CHECK !5 _RCEUL
  2480    !A [] $082 STRMARK !5
  2481  #ENDIF
  2482#ENDCOMMAND
  2483
  2484#COMMAND PRINT #L
  2485  #IF !0>2
  2486    #IF !0>3
  2487      #FORMAT !3 !4
  2488      #CHECK !4 _CVFW#L
  2489    #ENDIF
  2490    #CHECK !2 "TO"
  2491    #CHECK !3 _CVF#L
  2492    #IFTYPE !3 "IND"
  2493      !A [] $206 !1 !3
  2494    #ELSE
  2495      #IFTYPE !3 "R"
  2496        !A [] $208 !1 !3
  2497      #ELSE
  2498        !A [] $205 !1 !3
  2499      #ENDIF
  2500    #ENDIF
  2501  #ELSE
  2502    AUTO4$ PRINT !1 TO PAGE!f !2
  2503  #ENDIF
  2504#ENDCOMMAND
  2505
  2506#COMMAND PRINT_WRAP #L
  2507  #IF !0>2
  2508    #IF !0>3
  2509      #FORMAT !3 !4
  2510      #CHECK !4 _CVFW#L
  2511    #ENDIF
  2512    #CHECK !2 "TO"
  2513    #CHECK !3 _CVF#L
  2514    #IFCLASS !1 "F"
  2515      !A [] $209 |CS"DBMS:!1" !3 // assign seq file to wrap window.
  2516    #ELSE
  2517      !A [] $209 !1 !3
  2518    #ENDIF
  2519  #ELSE
  2520    AUTO4$ PRINT_WRAP !1 TO PAGE!f !2
  2521  #ENDIF
  2522#ENDCOMMAND
  2523
  2524#COMMAND READ
  2525  #IFSAME !1 CHANNEL
  2526    !A [] $10A |CI0 !2
  2527    #IF !0>2
  2528      #CHECK !3 _ULEC
  2529      READ !3 !4 !5 !6 !7 !8 !9
  2530    #ENDIF
  2531  #ELSE
  2532    !A [] $108 !1
  2533    #IF !0>1
  2534      #CHECK !2 _ULEC
  2535      READ !2 !3 !4 !5 !6 !7 !8 !9
  2536    #ENDIF
  2537  #ENDIF
  2538#ENDCOMMAND
  2539
  2540#COMMAND READLN
  2541  #IFSAME !1 CHANNEL
  2542    #CHECK !3 _ULE
  2543    !A [] $10A |CI0 !2
  2544    READLN !3 !4 !5 !6 !7 !8 !9
  2545  #ELSE
  2546    #IF !0=0
  2547      !A [] $104 |CS''
  2548    #ENDIF
  2549    #IF !0=1
  2550      !A [] $104 !1
  2551    #ENDIF
  2552    #IF !0>1
  2553      #CHECK !1 _ULE
  2554      !A [] $108 !1
  2555      READLN !2 !3 !4 !5 !6 !7 !8 !9
  2556    #ENDIF
  2557  #ENDIF
  2558#ENDCOMMAND
  2559
  2560#COMMAND READ_BLOCK
  2561  #IFSAME !1 CHANNEL
  2562    !A [] $10A |CI0 !2
  2563    #IF !0>2
  2564      #CHECK !3 _ULE
  2565      #CHECK !4 _RU
  2566      !A [] $109 !3 !4
  2567    #ENDIF
  2568  #ELSE
  2569    #CHECK !1 _ULEC
  2570    #CHECK !2 _RU
  2571    !A [] $109 !1 !2
  2572  #ENDIF
  2573#ENDCOMMAND
  2574
  2575#COMMAND READ_DFINI &#LGOBDR .
  2576  !A [] $14C !1
  2577#ENDCOMMAND
  2578
  2579#COMMAND REAL TR
  2580  #REAL V$
  2581  #REPLACE !1 |VR!v
  2582  #IF (!0>1)
  2583    REAL !2 !3 !4 !5 !6 !7 !8 !9
  2584  #ENDIF
  2585#ENDCOMMAND
  2586
  2587//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2588//
  2589//  Command:
  2590//      REGISTER_RESOURCE resourceName
  2591//
  2592//   Descrtiption:
  2593//      A command to register a resource for use prior to its inclusion.
  2594//
  2595//   Parmeters:
  2596//       resourceName
  2597//            Name of the resource (NOT in quotes).
  2598//
  2599//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2600
  2601#COMMAND REGISTER_RESOURCE _R
  2602  #IFDEF !1.RSC
  2603  #ELSE
  2604    #REPLACE !1.RSC |CI!ZR // create unique resource symbol.
  2605    #RESOURCE $0 !Zr 0 !1  // register resource; $0 = no filename; 0 = no type.
  2606  #ENDIF
  2607#ENDCOMMAND
  2608
  2609#COMMAND REGISTRATION &#RLUGCE #LUGEC .
  2610  !A [] $307 !1 !2
  2611#ENDCOMMAND
  2612
  2613#COMMAND RENAMEFILE &#LGU "TO" R#LGU .
  2614  !A [] $2C2 !1 !3
  2615#ENDCOMMAND
  2616
  2617#COMMAND REPEAT &.
  2618  #SET N$ !N
  2619  #PUSH !R
  2620  #XPUSH !n $INIT
  2621  #IFIND // INCLUDE JUMPS IF INDICATORS ON LINE
  2622  // GOTO BEGIN$!r
  2623  !A [] $041 |CL0
  2624  #FREF BEGIN$!r !a
  2625  #$ !A 0 0 0 $041 |CL0
  2626  #FREF END$!r !a
  2627  #ENDIF
  2628  #$ WHILE#!r:
  2629  #$ BEGIN$!r:
  2630#ENDCOMMAND
  2631
  2632
  2633
  2634#COMMAND REPLACE #LG "IN" #LGCE "WITH" #LRG
  2635  #IFIND
  2636    [] BEGIN
  2637    POS !1 IN !3
  2638    #$ [FOUND] MOVESTR (REPLACE(!1,!3,!5)) TO !3
  2639    END
  2640 #ELSE
  2641    POS !1 IN !3
  2642    [FOUND] MOVESTR (REPLACE(!1,!3,!5)) TO !3
  2643 #ENDIF
  2644#ENDCOMMAND
  2645
  2646#COMMAND REPORT T "BY""DOWN" VFW%LGR "BREAK"""
  2647  #CHECK !1.RECNUM _UVCWGL
  2648  #IFDEF RECCOUNT
  2649  #ELSE
  2650     INTEGER RECCOUNT
  2651  #ENDIF
  2652  #SET P$ 0
  2653  //          MOVEINT 20000 TO LINECOUNT  // start with a full page
  2654  !A [] $82 |CI20000 |VI10
  2655  //          MOVE 0 TO RECCOUNT
  2656  !A [] $82 |CI0 RECCOUNT
  2657  //          BREAKINIT           // init breakpoints
  2658  !A [] $207
  2659  //          INDICATE FIRSTREC TRUE      // used for subtotals
  2660  #IFDEF FIRSTREC
  2661  #ELSE
  2662    #REPLACE FIRSTREC |!C
  2663  #ENDIF
  2664  !A [] $4028 |CI0 |CI0 FIRSTREC~
  2665  #IFSAME !2 BY
  2666    FIND GE !1 BY !3          // FIND first record
  2667  #ELSE
  2668    FIND LE !1 BY !3
  2669  #ENDIF
  2670  [~FOUND] GOTO END$OF$REPORT
  2671  //          CLEARSCREEN         // start with a clear screen
  2672  !A [] $144
  2673  RPT.LOOP://   INDICATE SELECT TRUE      // default for SELECT
  2674  #IFDEF SELECT
  2675  #ELSE
  2676    #REPLACE SELECT |!C
  2677  #ENDIF
  2678  !A [] $4028 |CI0 |CI0 SELECT~
  2679  //          GOSUB RPT.SELECTION     // go to user selection
  2680  !A [] $42 |CL0
  2681  #FREF RPT.SELECTION !a
  2682  //[NOT SELECT] GOTO RPT.CONT        // test SELECT
  2683  !A [~ SELECT] $41 |CL0
  2684  #FREF RPT.CONT !a
  2685  BREAK$ !5 !6 !7 !8 !9       // set breakpoints
  2686  #SET X$ !p                  // set up to break down
  2687  [NOT FIRSTREC] BREAK$DOWN RPT.SUBTOTAL  // break down for SUBTOTAL
  2688  #SET X$ 0               // set up to break up
  2689  //          RELATE !1           // get related records
  2690  !A [] $C4 !1.RECNUM
  2691  BREAK$UP RPT.SUBHEADER      // break up for SUBHEADER
  2692  //          INCREMENT RECCOUNT
  2693  !A [] $083 RECCOUNT |CI0
  2694  //          GOSUB RPT.BODY          // print body
  2695  !A [] $42 |CL0
  2696  #FREF RPT.BODY !a
  2697  //          INDICATE FIRSTREC FALSE     // not first any more
  2698  !A [] $4028 |CI0 |CI0 FIRSTREC
  2699  RPT.CONT:
  2700  #IFSAME !2 BY
  2701    FIND GT !1 BY !3          // FIND next record
  2702  #ELSE
  2703    FIND LT !1 BY !3
  2704  #ENDIF
  2705  //          KEYCHECK            // check keyboard
  2706  !A [] $46
  2707  //[FOUND NOT KEYPRESS] GOTO RPT.LOOP    // if ok, loop
  2708  !A [FOUND ~ KEYPRESS] $41 RPT.LOOP
  2709  //[KEYPRESS]  GOSUB RPT.KEYPRESS    // user can disable KEYPRESS
  2710  !A [FOUND KEYPRESS]   $42 |CL0
  2711  #FREF RPT.KEYPRESS !a
  2712  !A [FOUND ~ KEYPRESS] $41 RPT.LOOP
  2713  #SET X$ !p                  // set up for break down
  2714  END.OF.REPORT:
  2715  [~ FIRSTREC]  BREAK$DOWN RPT.SUBTOTAL $X    // break down for last subtotals
  2716  //[FIRSTREC]  GOSUB RPT.TOTAL       // print TOTAL
  2717  !A [~ FIRSTREC] $42 |CL0
  2718  #FREF RPT.TOTAL !a
  2719  //          GOTO END$OF$REPORT      // GOTO end
  2720  !A [] $41 |CL0
  2721  #FREF END$OF$REPORT !a
  2722  NEWPAGE://    GOSUB RPT.HEADER      // new page, print HEADER
  2723  !A [] $42 |CL0
  2724  #FREF RPT.HEADER !a
  2725  #SET X$ 0    // this will reprint the page headers if included //
  2726  [NOT FIRSTREC] BREAK$PRT SUBHEADER      // reprint pages
  2727  //          RETURN              // end of NEWPAGE
  2728  !A [] $43 |CI0
  2729  RPT.SELECTION:              // selection starts after REPORT
  2730#ENDCOMMAND
  2731
  2732#COMMAND REPORTEND .         // end of REPORT
  2733  MAKEDEF$ RPT.HEADER RPT.SELECTION RPT.BODY RPT.TOTAL
  2734  #SET X$ 0
  2735  BREAK$T3
  2736  // RETURN
  2737  !A [] $43 |CI0
  2738  #IFDEF RPT.KEYPRESS
  2739  #ELSE
  2740    RPT.KEYPRESS:
  2741    // STRING AKEY$ 1
  2742    #IFDEF AKEY$
  2743    #ELSE
  2744      #STR V$ 1
  2745      #REPLACE AKEY$ |VS!v
  2746    #ENDIF
  2747    // SHOWLN 'A KEY HAS BEEN PRESSED.'
  2748    !A [] $142 |CS'A KEY HAS BEEN PRESSED.'
  2749    !A [] $143
  2750    // SHOW   'DO YOU WANT TO STOP THE REPORT (Y or N)? '
  2751    !A [] $142 |CS'DO YOU WANT TO STOP THE REPORT (Y or N)? '
  2752    // INKEY AKEY$
  2753    !A [] $147 AKEY$
  2754    !A [] $141 AKEY$
  2755    // IF NOT AKEY$ IN 'Yy' RETURN RPT.LOOP
  2756    INDCT$AS SELECT AS AKEY$ IN 'Yy'
  2757    //JJT-5.1
  2758    //[~ SELECT] RETURN RPT.LOOP
  2759    [~ SELECT] Gosub_RETURN RPT.LOOP
  2760    //JJT-5.1
  2761    //RETURN END$OF$REPORT  // Necessary to pop stack
  2762    Gosub_RETURN END$OF$REPORT  // Necessary to pop stack
  2763  #ENDIF
  2764  END$OF$REPORT:
  2765#ENDCOMMAND
  2766
  2767// JJT-5.1
  2768//#COMMAND RETURN VFWNDE#G
  2769//  #IF !0=0
  2770//    !A [] $043 |CL0
  2771//  #ELSE
  2772//    #IFSAME !1 RETURN
  2773//      #SET Q$ (!a+2)
  2774//      !A [] $043 |CL!q // RETURN RETURN
  2775//      RETURN !2 !3 !4 !5 !6 !7 !8 !9
  2776//    #ELSE
  2777//      #IFDEF !1
  2778//        #CHECK !1 _S
  2779//        #CHECK !2 .
  2780//        !A [] $043 !1
  2781//      #ELSE
  2782//        !A [] $043 |CL0
  2783//        #FREF !1 !a
  2784//      #ENDIF
  2785//    #ENDIF
  2786//  #ENDIF
  2787//#ENDCOMMAND
  2788
  2789#COMMAND RIGHT &#UGRL$ "TO" #UGRLEC L#% .
  2790  #IF !0>3
  2791    !A [] $082 !4 STRLEN
  2792  #ENDIF
  2793  !A [] $242 !1 !3
  2794#ENDCOMMAND
  2795
  2796#COMMAND RUNPROGRAM_PIPE #RLGU #RLGU #RLGU .
  2797    !A [] $2D6 !3    // Specify the object to receive MSG_INSERT
  2798                     // with the output from the pipe.
  2799    !A [] $2D7 !1 !2 // Execute the OS command with any arguments.
  2800#ENDCOMMAND
  2801
  2802#COMMAND RUNPROGRAM #RLG #LGU #LGU #LGU .
  2803    #IFSAME !1 WAIT BACKGROUND
  2804      #IF !0>3
  2805        #ERROR 162 TOO MANY ARGUMENTS TO RUNPROGRAM !1
  2806      #ELSE
  2807          #IFSAME !1 WAIT
  2808              !A [] $2CC !2 !3
  2809            #ELSE // BACKGROUND
  2810              !A [] $2CD !2 !3
  2811            #ENDIF
  2812      #ENDIF
  2813    #ELSE
  2814        // Number of args is checked by type checking of command for PIPE.
  2815      #IFSAME !1 PIPE
  2816          #IF !0<4
  2817              RUNPROGRAM_PIPE !2 "" !3 !4 !5 !6 !7 !8 !9
  2818          #ELSE
  2819              RUNPROGRAM_PIPE !2 !3 !4 !5 !6 !7 !8 !9
  2820          #ENDIF
  2821      #ELSE // Plain RUNPROGRAM.
  2822          #IF !0>2
  2823              #ERROR 162 TOO MANY ARGUMENTS TO RUNPROGRAM
  2824          #ELSE
  2825                !A [] $2C0 !1 !2
  2826          #ENDIF
  2827      #ENDIF
  2828    #ENDIF
  2829#ENDCOMMAND
  2830
  2831#COMMAND SCREENMODE #%LGR # .
  2832  #IFSAME !1 ON
  2833    !A [] $148 |CE(458752)     // SCREENMODE on 0x70000
  2834  #ELSE
  2835    #IFSAME !1 OFF
  2836      !A [] $148 |CE(196608)       // SCREENMODE off 0x30000
  2837    #ELSE
  2838      #CHECK !1 _U
  2839      !A [] $148 !1
  2840    #ENDIF
  2841  #ENDIF
  2842  #IF !0>1
  2843    SCREENMODE !2
  2844  #ENDIF
  2845#ENDCOMMAND
  2846
  2847#COMMAND SECTION &RT #LGU .
  2848  #IFSAME !1 SELECTION            // SELECTION is null SECTION
  2849  #ELSE
  2850    // RETURN                   // RETURN from last routine
  2851    !A [] $43 |CI0
  2852    RPT.!1:                 // label SECTION
  2853    #IFDEF !2       // LINES REQ SPEC
  2854      // PAGECHECK !2
  2855      !A [] $203 !2
  2856      // [PAGEBREAK] GOSUB NEWPAGE
  2857      !A [PAGEBREAK] $42 NEWPAGE
  2858      #IFDEF !1.LINES
  2859        #SET F$ !1.N
  2860        #SET E$ 0
  2861      #ENDIF
  2862    #ELSE
  2863      #IFDEF !1.LINES                 // is there a page?
  2864        // PAGECHECK !1.LINES           // check for end of page
  2865        !A [] $203 !1.LINES |CI0
  2866        //[PAGEBREAK] GOSUB NEWPAGE     // if end, GOSUB NEWPAGE
  2867        !A [PAGEBREAK] $42 NEWPAGE
  2868        // AUTOPAGE !1              // start default page
  2869        #SET F$ !1.N
  2870        #SET E$ 0
  2871      #ENDIF
  2872    #ENDIF
  2873  #ENDIF
  2874#ENDCOMMAND
  2875
  2876#COMMAND SET_ARGUMENT_SIZE &#LGRBOUSD .
  2877  !A [] $24E !1
  2878#ENDCOMMAND
  2879
  2880#COMMAND SET_DFPATH "TO" &#LGRBOUD .
  2881  !A [] $2D0 !2
  2882#ENDCOMMAND
  2883
  2884#COMMAND SET_CHANNEL_POSITION  &#LRUG$ "TO" &#LRUG$ .
  2885  !A [] $10C !1 !3
  2886#ENDCOMMAND
  2887
  2888#COMMAND SET_OPTION #LGR . // Sets window options
  2889  #IFCLASS !1 _C         // To stay on perminantly until
  2890    #SET Q$ !1         // Turned off with CLEAR_OPTION.
  2891    !A [] $04A |CI!q |CI0     // SET_OPTION NO_CALC // Turn off calculate.
  2892  #ELSE
  2893    !A [] $04A !1 |CI0    // THIS COMMAND IS FOR INTERNAL USE.
  2894  #ENDIF
  2895#ENDCOMMAND
  2896
  2897#COMMAND SET_RELATE &#LGOBRWCV "TO" #LGOBRWCV .
  2898  !A [] $348 !1 !3
  2899#ENDCOMMAND
  2900
  2901#COMMAND SET_TERMLIST &#LGOBDR #LGOBDIN .
  2902  !A [] $14A !1 !2
  2903#ENDCOMMAND
  2904
  2905#COMMAND SETCHANGE &RCVF%G .
  2906  !A [] $1C7 !1
  2907#ENDCOMMAND
  2908
  2909#COMMAND SHOW #ULRG$
  2910  !A [] $142 !1
  2911  #IF (!0>1)
  2912    SHOW !2 !3 !4 !5 !6 !7 !8 !9
  2913  #ENDIF
  2914#ENDCOMMAND
  2915
  2916#COMMAND SHOWLN #LGU$
  2917  #IF (!0>0)
  2918    SHOW !1 !2 !3 !4 !5 !6 !7 !8 !9
  2919  #ENDIF
  2920  !A [] $143
  2921#ENDCOMMAND
  2922
  2923#COMMAND SLEEP #LGURDBO .
  2924  !A [] $02CE !1
  2925#ENDCOMMAND
  2926
  2927#COMMAND STATUS$ &CVW#LG "TO" #LUGRE
  2928  #IFDEF !1
  2929    !A [] $304 !1 !3
  2930  #ELSE
  2931    #CHECK !1.RECNUM _CVWLR#GU
  2932    !A [] $304 !1.RECNUM !3
  2933  #ENDIF
  2934#ENDCOMMAND
  2935
  2936#COMMAND STOP &.
  2937  !A [] $144
  2938  !A [] $040
  2939#ENDCOMMAND
  2940
  2941#COMMAND STOP_HERE
  2942    !A [] $4d !1
  2943#ENDCOMMAND
  2944
  2945// JJT-5.1
  2946//#COMMAND STRING TR E#L%
  2947//  #IF (!0>1)
  2948//    #IFDEF !2
  2949//      #CHECK !2 _VSWDF
  2950//      #STR V$ !2
  2951//      #REPLACE !1 |VS!v
  2952//      #IF (!0>2)
  2953//        STRING !3 !4 !5 !6 !7 !8 !9
  2954//      #ENDIF
  2955//    #ELSE
  2956//      #STR V$ 80
  2957//      #REPLACE !1 |VS!v
  2958//      STRING !2 !3 !4 !5 !6 !7 !8 !9
  2959//    #ENDIF
  2960//  #ELSE
  2961//    #STR V$ 80
  2962//    #REPLACE !1 |VS!v
  2963//  #ENDIF
  2964//#ENDCOMMAND
  2965
  2966#COMMAND SUBTOTAL RFVC#LSD
  2967  PRINT !1% !2 !3 !4 !5
  2968  !A [] $082 |CI0 !1%
  2969#ENDCOMMAND
  2970
  2971#REM Get system date, hour, min, seconds.
  2972#REM WILL NOT WORK UNDER CPM 2.2
  2973
  2974#COMMAND SYSDATE$HELP
  2975//  #IFDEF IS$WINDOWS     // This code is no longer required in VDF5. KCR
  2976//      !A [] $2E2 |CI2 !2
  2977//  #ENDIF
  2978  !A [] $2C9 !1 !2
  2979  #IF !0>2
  2980    //MOVE STRLEN TO !3
  2981    !A [] $82 STRLEN !3
  2982  #ENDIF
  2983  #IF !0>3
  2984    //MOVE STRMARK TO !4
  2985    !A [] $82 STRMARK !4
  2986     #IF !0>4
  2987      //MOVE |VI37 TO !5
  2988      !A [] $82 |VI37 !5
  2989    #ENDIF
  2990  #ENDIF
  2991#ENDCOMMAND
  2992
  2993#COMMAND SYSDATE #ERCUGL #ECUGL #ECUGL #ECUGL . // SYSDATE DATE HR MIN SECOND
  2994    SYSDATE$HELP !1 DFFALSE !2 !3 !4 !5 !6 !7 !8 !9
  2995#ENDCOMMAND
  2996
  2997#COMMAND SYSDATE4 #ERCUGL #ECUGL #ECUGL #ECUGL . // SYSDATE DATE HR MIN SECOND
  2998    SYSDATE$HELP !1 DFTRUE !2 !3 !4 !5 !6 !7 !8 !9
  2999#ENDCOMMAND
  3000
  3001#COMMAND SYSTEM &.
  3002  !A [] $2C7
  3003#ENDCOMMAND
  3004
  3005#COMMAND TRIM &#LUG$ "TO" C#ELRUG .  // remove pre- and trailing spaces
  3006  !A [] $24B !1 !3
  3007#ENDCOMMAND
  3008
  3009#COMMAND UNLOCK &.
  3010  !A [] $0C8
  3011#ENDCOMMAND
  3012
  3013#COMMAND UNTIL R L L L .
  3014  #POP S$
  3015  IFNOT_ !1 !2 !3 !4 GOTO BEGIN$!s
  3016  END$!s:
  3017  #SET N$ !n-1
  3018#ENDCOMMAND
  3019
  3020#COMMAND UPPERCASE &C#LUGRND$ "TO""" C#LUG$END .
  3021  #IF !0>1
  3022    !A [] $249 !1 !3
  3023  #ELSE
  3024    !A [] $249 !1 !1
  3025  #ENDIF
  3026#ENDCOMMAND
  3027
  3028#COMMAND WHILE R L L L .
  3029  #SET N$ !N
  3030  #PUSH !R
  3031  #XPUSH !n $INIT
  3032  // GOTO WHILE$!r
  3033  !A [] $041 |CL0
  3034  #FREF WHILE$!r !a
  3035  #$ !A 0 0 0 $041 |CL!a
  3036  #FREF END$!r !a
  3037  #$ WHILE$!r:
  3038  #$ BEGIN$!r:
  3039  #$ IFNOT_ !1 !2 !3 !4 GOTO END$!r
  3040#ENDCOMMAND
  3041
  3042#COMMAND WRITE$STR #ULRG$
  3043    !A [] $106 !1
  3044    #IF (!0>1)
  3045      WRITE$STR !2 !3 !4 !5 !6 !7 !8 !9
  3046    #ENDIF
  3047#ENDCOMMAND
  3048
  3049#COMMAND WRITE
  3050  #IFSAME !1 CHANNEL
  3051    !A [] $10A |CI1 !2
  3052    #IF !0>2
  3053      WRITE$STR !3 !4 !5 !6 !7 !8 !9
  3054    #ENDIF
  3055  #ELSE
  3056    #IF (!0>0)
  3057      WRITE$STR !1 !2 !3 !4 !5 !6 !7 !8 !9
  3058    #ENDIF
  3059  #ENDIF
  3060#ENDCOMMAND
  3061
  3062#COMMAND WRITELN
  3063  #IFSAME !1 CHANNEL
  3064    !A [] $10A |CI1 !2
  3065    #IF !0>2
  3066      WRITE$STR !3 !4 !5 !6 !7 !8 !9
  3067    #ENDIF
  3068  #ELSE
  3069    #IF (!0>0)
  3070      WRITE$STR !1 !2 !3 !4 !5 !6 !7 !8 !9
  3071    #ENDIF
  3072  #ENDIF
  3073  !A [] $107
  3074#ENDCOMMAND
  3075
  3076#COMMAND SOUND &_L#RUG .
  3077  !A [] $395 !1  // INTERNAL USE ONLY.
  3078#ENDCOMMAND
  3079
  3080#COMMAND GRAPHIC "ON""OFF" GDLOB# GNDIELOB# .
  3081  #IFSAME !1 ON
  3082    !A [] $382 !2 !3        //cmdgraphon mode device
  3083  #ELSE
  3084    !A [] $383 !2 |CN0      //cmdgraphoff
  3085  #ENDIF
  3086#ENDCOMMAND
  3087
  3088#COMMAND GRSHOW #ULRG$
  3089  !A [] $3aa !1
  3090  #IF (!0>1)
  3091    GRSHOW !2 !3 !4 !5 !6 !7 !8 !9
  3092  #ENDIF
  3093#ENDCOMMAND
  3094
  3095#COMMAND GRSHOWLN #LGU$
  3096  #IF (!0>0)
  3097    GRSHOW !1 !2 !3 !4 !5 !6 !7 !8 !9
  3098  #ENDIF
  3099  !A [] $3ab
  3100#ENDCOMMAND
  3101
  3102#COMMAND GRXY &GDLOB# RGDLOB# .
  3103  !A [] $384 !1 !2        //cmdgraphxy row column
  3104#ENDCOMMAND
  3105
  3106#COMMAND GET_GRXY &#GDLOBCE R#GDLOBCE .
  3107  !A [] $38C !1 !2        //cmdgraphgetpos row column
  3108#ENDCOMMAND
  3109
  3110#COMMAND GET_CHANNEL_POSITION &#LRUG$ "TO" &#LRUG$EC .
  3111  !A [] $10B !1 !3
  3112#ENDCOMMAND
  3113
  3114#COMMAND CIRCLE R#GDLOB R#GDLOB R#GDLOB #GDLOB .
  3115  #IF !0>3
  3116    SCREENMODE !4
  3117  #ENDIF
  3118  !A [] $384 !1 !2        //cmdgraphxy row column
  3119  #IF !0>3
  3120    !A [] $388 !3           //cmdgraphfcircle radius
  3121  #ELSE
  3122    !A [] $390 !3           //cmdgraphcircle radius
  3123  #ENDIF
  3124#ENDCOMMAND
  3125
  3126#COMMAND BOX R#GDLOB R#GDLOB R#GDLOB R#GDLOB #GDLOB .
  3127  #IF !0>4
  3128    SCREENMODE !5
  3129  #ENDIF
  3130  !A [] $381 !1 !2        //cmdgraphtmp row1 column1
  3131  !A [] $387 !3 !4        //cmdgraphbox row2 column2
  3132#ENDCOMMAND
  3133
  3134#COMMAND BAR R#GDLOB R#GDLOB R#GDLOB R#GDLOB #GDLOB .
  3135  #IF !0>4
  3136    SCREENMODE !5
  3137  #ENDIF
  3138  !A [] $381 !1 !2        //cmdgraphtmp row1 column1
  3139  !A [] $391 !3 !4        //cmdgraphbox row2 column2
  3140#ENDCOMMAND
  3141
  3142#COMMAND LINE R#GDLOB R#GDLOB #GDLOB .
  3143  #IF !0>2
  3144    SCREENMODE !3
  3145  #ENDIF
  3146  !A [] $385 !1 !2        //cmdgraphline end_row end_column
  3147#ENDCOMMAND
  3148
  3149#COMMAND PLOT R#GDLOB R#GDLOB #GDLOB .
  3150  #IF !0>2
  3151    SCREENMODE !3
  3152  #ENDIF
  3153  !A [] $386 !1 !2        //cmdgraphplot row column
  3154#ENDCOMMAND
  3155
  3156#COMMAND PIE R#GDLOB R#GDLOB R#GDLOB R#GDLOB #GDLOB .
  3157  #IF !0>4
  3158    SCREENMODE !5
  3159  #ENDIF
  3160  !A [] $381 !1 !2        //cmdgraphtmp radius arc1
  3161  !A [] $389 !3 !4        //cmdgraphpie arc2 fill_color
  3162#ENDCOMMAND
  3163
  3164#COMMAND ARC R#GDLOB R#GDLOB R#GDLOB #GDLOB .
  3165  #IF !0>3
  3166    SCREENMODE !4
  3167  #ENDIF
  3168  !A [] $381 !1 !2        //cmdgraphtmp radius arc1
  3169  !A [] $38A !3           //cmdgrapharc arc2
  3170#ENDCOMMAND
  3171
  3172#COMMAND ELLIPSE R#GDLOB R#GDLOB #GDLOB .
  3173  #IF !0>2
  3174    SCREENMODE !3
  3175  #ENDIF
  3176  !A [] $38B !1 !2        //cmdgraphellipse RADIUS ASPECT
  3177#ENDCOMMAND
  3178
  3179#COMMAND FLOOD &R#GDLOB .
  3180  !A [] $3A0 !1           //cmdgraphflood color
  3181#ENDCOMMAND
  3182
  3183#COMMAND PALETTE &#GDLOB R#GDLOB .
  3184  !A [] $38E !1 !2        //cmdgraphpalette background palette
  3185#ENDCOMMAND
  3186
  3187#COMMAND GR_PRINT &#GDLOBI .
  3188  !A [] $392 !1
  3189#ENDCOMMAND
  3190
  3191#COMMAND SET_LINE_STYLE &GDLOB# GDLOB# .
  3192  !A [] $3A1 !1 !2            //cmdsetlnstyle STYLE WIDTH
  3193#ENDCOMMAND
  3194
  3195#COMMAND SET_TEXT &#GDLOB R#GDLOB .
  3196  !A [] $394 !1 !2            //cmdsettext SIZE ROTATION
  3197#ENDCOMMAND
  3198
  3199#COMMAND DISPLAY_GRAPHIC &R#GDLOBI .
  3200  !A [] $397 !1
  3201#ENDCOMMAND
  3202
  3203#COMMAND SAVE_GRAPHIC &R#GDLOBI .
  3204  !A [] $396 !1
  3205#ENDCOMMAND
  3206
  3207#COMMAND SAVE_CUT #GDLOBNIE #GDLOB #GDLOB #GDLOB R#GDLOB
  3208  #IFSAME !1 DBMS
  3209    #IFCLASS !2 "F" // if field ref, use as is
  3210      SAVE_CUT |CS"!1:!2" !3 !4 !5 !6 !7 !8 !9
  3211    #ELSE
  3212      #IFDEF !2 // for all classes/types, assume variable string for field ref
  3213        SAVE_CUT ('!1:' + string(!2)) !3 !4 !5 !6 !7 !8 !9
  3214      #ELSE
  3215        #CHECK !2 _U // force cannot be untyped error.
  3216      #ENDIF
  3217    #ENDIF
  3218  #ELSE
  3219    GRXY !2 !3            //Start x and y
  3220    !A [] $381 !4 !5      //End x and y
  3221    !A [] $3A3 !1
  3222  #ENDIF
  3223#ENDCOMMAND
  3224
  3225#COMMAND DISPLAY_CUT #GDLOBNI #GDLOB R#GDLOB #GDLOB
  3226  #IFSAME !1 DBMS
  3227    #IFCLASS !2 "F" // if field ref, use as is
  3228      DISPLAY_CUT |CS"!1:!2" !3 !4 !5 !6 !7 !8 !9
  3229    #ELSE
  3230      #IFDEF !2 // for all classes/types, assume variable string for field ref
  3231        DISPLAY_CUT ('!1:' + string(!2)) !3 !4 !5 !6 !7 !8 !9
  3232      #ELSE
  3233        #CHECK !2 _U // force cannot be untyped error.
  3234      #ENDIF
  3235    #ENDIF
  3236  #ELSE
  3237    !A [] $381 !2 !3      //Display at x and y
  3238    !A [] $3A2 !1 !4      //cmdgetcut CUT_NAME MODE
  3239  #ENDIF
  3240#ENDCOMMAND
  3241
  3242#COMMAND SETWORLD &#GDLOB #GDLOB #GDLOB R#GDLOB .
  3243  !A [] $381 !1 !2        //cmdgraphtmp LOWER LEFT
  3244  !A [] $398 !3 !4        //setworld UPPER RIGHT
  3245#ENDCOMMAND
  3246
  3247#COMMAND GETDRANGE &E#GDLOBC ER#GDLOBC .
  3248  !A [] $399 !1 !2
  3249#ENDCOMMAND
  3250
  3251#COMMAND GRAPH_INIT &.
  3252  !A [] $39A
  3253#ENDCOMMAND
  3254
  3255#COMMAND GRAPH_VALUE &#GDLOB R#GDLOB .
  3256  !A [] $39B !1 !2
  3257#ENDCOMMAND
  3258
  3259#COMMAND GRAPH_SUM &#GDLOBC R#GDLOBC .
  3260  !A [] $39C !1 !2
  3261#ENDCOMMAND
  3262
  3263#COMMAND GRAPH_STAT &E#GDLOBC ER#GDLOBC .
  3264  !A [] $39D !1 !2
  3265#ENDCOMMAND
  3266
  3267#COMMAND GRAPH_GETFIRST #GDLOBIENC ER#GDLOBC .
  3268  !A [] $39E !1 !2
  3269#ENDCOMMAND
  3270
  3271#COMMAND GRAPH_GETNEXT #GDLOBCIENC ER#GDLOBC .
  3272  !A [] $39F !1 !2
  3273#ENDCOMMAND
  3274
  3275#COMMAND ASPECT R#GDLOBCE #GDLOB .
  3276  !A [] $3A5 !1 !2
  3277#ENDCOMMAND
  3278
  3279#COMMAND CHART_INIT .
  3280  #IFDEF GRAPH$NUM
  3281  #ELSE
  3282    string  graph$label graph$title graph$ytitle graph$xtitle
  3283    real    total$value min$value max$value value$
  3284    real    radius mid$radian last$radian radian value$step
  3285    integer text$size text$center graph$num num$values bar$width bar$space
  3286    integer lower$left$x lower$left$y upper$right$x upper$right$y axis$base
  3287    integer last$x last$y dev$x dev$y label$color chart$color axis$color gr$tmp
  3288    indicator bar$chart line$chart pie$chart
  3289    move 1 to label$color
  3290    move 1 to chart$color
  3291    move 1 to axis$color
  3292  #ENDIF
  3293  graph_init
  3294  indicate bottom$label true
  3295#ENDCOMMAND
  3296
  3297#COMMAND CHART "BAR""LINE""PIE"
  3298  #IFSAME !1 BAR
  3299    indicate bar$chart true
  3300  #ENDIF
  3301  #IFSAME !1 LINE
  3302    indicate line$chart true
  3303  #ENDIF
  3304  #IFSAME !1 PIE
  3305    indicate pie$chart true
  3306  #ENDIF
  3307  #IF (!0>1)
  3308    trim !2 to graph$title
  3309  #ELSE
  3310    move '' to graph$title
  3311  #ENDIF
  3312  #IFSAME !1 PIE
  3313  #ELSE
  3314    #IF (!0>2)
  3315      trim !3 to graph$ytitle
  3316    #ELSE
  3317      move '' to graph$ytitle
  3318    #ENDIF
  3319  #ENDIF
  3320  #IFSAME !1 PIE
  3321  #ELSE
  3322    #IF (!0>3)
  3323      trim !4 to graph$xtitle
  3324    #ELSE
  3325      move '' to graph$xtitle
  3326    #ENDIF
  3327  #ENDIF
  3328  move |VI34 to |VI35
  3329  gosub do$chart
  3330  screenmode |VI35
  3331  #IFSAME !1 BAR
  3332    indicate bar$chart false
  3333  #ENDIF
  3334  #IFSAME !1 LINE
  3335    indicate line$chart false
  3336  #ENDIF
  3337  #IFSAME !1 PIE
  3338    indicate pie$chart false
  3339  #ENDIF
  3340
  3341  #IFDEF DO$CHART
  3342  #ELSE
  3343    goto do$chart$end
  3344
  3345    do$chart:
  3346    graph_sum total$value num$values
  3347    graph_stat min$value max$value
  3348    gosub sc$init
  3349    gosub calc$value
  3350    gosub draw$axis
  3351    indicate first$value true
  3352    for graph$num from 1 to num$values
  3353      [first$value]  graph_getfirst graph$label value$
  3354      [~first$value] graph_getnext graph$label value$
  3355      trim graph$label to graph$label
  3356      [bar$chart] gosub graph$bar
  3357      [line$chart] gosub graph$line
  3358      [pie$chart] gosub graph$pie
  3359      indicate first$value false
  3360    loop
  3361    gosub_return
  3362
  3363    graph$bar:
  3364    move (axis$base+((value$/(max$value-min$value))*800)) to upper$right$y
  3365    move (lower$left$x+bar$width) to upper$right$x
  3366    bar lower$left$x lower$left$y upper$right$x upper$right$y chart$color
  3367    [~bottom$label] grxy lower$left$x (upper$right$y-50)
  3368    [ bottom$label] grxy lower$left$x 50
  3369    screenmode label$color
  3370    grshow graph$label
  3371    move (lower$left$x+bar$width+bar$space) to lower$left$x
  3372    return
  3373
  3374    graph$line:
  3375    move (axis$base+((value$/(max$value-min$value))*800)) to lower$left$y
  3376    grxy lower$left$x lower$left$y
  3377    [~first$value] line last$x last$y chart$color
  3378    circle lower$left$x lower$left$y 5 axis$color
  3379    move lower$left$x to last$x
  3380    move lower$left$y to last$y
  3381    [~bottom$label] grxy lower$left$x (lower$left$y-50)
  3382    [ bottom$label] grxy lower$left$x 50
  3383    screenmode label$color
  3384    grshow graph$label
  3385    move (lower$left$x+bar$width+bar$space) to lower$left$x
  3386    return
  3387
  3388    graph$pie:
  3389    move ((6.28318 * (value$/total$value)) + last$radian) to radian
  3390    move ((radian+last$radian)/2) to mid$radian
  3391    move (cos(mid$radian)*30+500) to last$x
  3392    move (sin(mid$radian)*30) to last$y
  3393    move (last$y + (last$y*dev$y/dev$x) + 500) to last$y
  3394    grxy last$x last$y
  3395    pie radius last$radian radian chart$color axis$color
  3396    move radian to last$radian
  3397    move (cos(mid$radian)*(radius+50)+500) to last$x
  3398    move (sin(mid$radian)*(radius+50)) to last$y
  3399    move (last$y + (last$y*dev$y/dev$x) + 500) to last$y
  3400    if last$x lt 500 ;
  3401      move (0 max (last$x - (length(graph$label)*8000/dev$x))) to last$x
  3402    grxy last$x last$y
  3403    screenmode label$color
  3404    grshow graph$label
  3405    return
  3406
  3407    sc$init:
  3408    setworld 0 0 1000 1000
  3409    clearscreen
  3410    return
  3411
  3412    calc$value:
  3413    move (max$value*1.05) to max$value
  3414    move (min$value*1.05) to min$value
  3415    if min$value gt 0 move 0 to min$value  // zero base pos ranges
  3416    if max$value lt 0 move 0 to max$value
  3417
  3418    real scaler$
  3419    integer increments$
  3420    move (10^(integer(log(max$value max -min$value)/log(10)))) to scaler$
  3421    move (max$value/scaler$+1) to increments$
  3422    move (scaler$*increments$) to max$value
  3423    if min$value lt 0 begin
  3424      move (scaler$*integer(min$value/scaler$-1)) to min$value
  3425      move (increments$-integer(min$value/scaler$)) to increments$
  3426    end
  3427    if increments$ le 6 move (increments$*2) to increments$
  3428
  3429    move ((((-min$value max min$value)/(max$value-min$value)) ;
  3430      * 800)+100) to axis$base
  3431    move axis$base to lower$left$y
  3432    return
  3433
  3434    center$title:
  3435    move 3 to text$size
  3436    center$title2:
  3437    repeat
  3438      move (text$size-1) to text$size
  3439      move (((gr$tmp-((length(graph$label)+1)* ;
  3440        (text$size*8)))/2)*1000/gr$tmp) to text$center
  3441    until text$center ge 0
  3442    return
  3443
  3444    draw$axis:
  3445    getdrange dev$x dev$y
  3446    screenmode label$color
  3447    if (length(graph$title)) gt 0 begin
  3448      move dev$x to gr$tmp
  3449      move graph$title to graph$label
  3450      gosub center$title
  3451      if (text$size*8000/dev$y) gt 50 gosub center$title2
  3452      set_text text$size 0
  3453      grxy text$center 950
  3454      grshow graph$title
  3455    end
  3456
  3457    [pie$chart] begin
  3458      indicate first$value true
  3459      move 0 to gr$tmp
  3460      for graph$num from 1 to num$values
  3461        [first$value]  graph_getfirst graph$label value$
  3462        [~first$value] graph_getnext graph$label value$
  3463        trim graph$label to graph$label
  3464        move (gr$tmp max length(graph$label)) to gr$tmp
  3465        indicate first$value false
  3466      loop
  3467      set_text 1 0
  3468      move 0 to last$radian
  3469      move ((50 max ((dev$x*0.4)-(gr$tmp*8)*1000/dev$x)) min 190) to radius
  3470      return
  3471    end
  3472
  3473    if (length(graph$xtitle)) gt 0 begin
  3474      move graph$xtitle to graph$label
  3475      gosub center$title
  3476      set_text text$size 0
  3477      move (text$size*8000.0/dev$y) to gr$tmp
  3478//    move ((text$size+1)*8000.0/dev$y) to gr$tmp
  3479      grxy text$center gr$tmp
  3480      grshow graph$xtitle
  3481      setworld 0 (-gr$tmp) 1000 1000
  3482    end
  3483
  3484    if (length(graph$ytitle)) gt 0 begin
  3485      move dev$y to gr$tmp
  3486      move graph$ytitle to graph$label
  3487      gosub center$title
  3488      set_text text$size 1
  3489      grxy 0 text$center
  3490      grshow graph$ytitle
  3491    end
  3492    else move 0 to text$size
  3493
  3494    set_text 1 0
  3495    screenmode label$color
  3496
  3497    move min$value to value$
  3498    integer indent$
  3499    move 0 to indent$
  3500    move ((max$value-min$value)/increments$) to value$step
  3501    while value$ le max$value
  3502      move (axis$base+((value$/(max$value-min$value))*800)) ;
  3503        to upper$right$y
  3504      grxy (((text$size*8)+2)*1000/dev$x) upper$right$y
  3505      grshow value$
  3506      move (indent$ max length(value$)) to indent$
  3507      move (value$+value$step) to value$
  3508    end
  3509    move ((((indent$+text$size)*8)+12)*1000/dev$x) to indent$
  3510    move (real(900-indent$)/num$values * 0.8) to bar$width
  3511    move (real(900-indent$)/num$values * 0.2) to bar$space
  3512    move (indent$+bar$space) to lower$left$x
  3513    bar (indent$-10) 90 indent$ 900 axis$color
  3514    bar indent$ 90 900 100 axis$color
  3515    grxy indent$ axis$base
  3516    line 900 axis$base
  3517    return
  3518
  3519    do$chart$end:
  3520  #ENDIF
  3521#ENDCOMMAND
  3522
  3523// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  3524//
  3525//   Command:
  3526//     INITIALIZE_INTERFACE
  3527//
  3528//   Parameters:
  3529//     None.
  3530//
  3531//   Description:
  3532//     INITIALIZE_INTERFACE initializes the object resource information.
  3533//     It should be executed before any other object related operations
  3534//     are performed.
  3535//
  3536// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  3537
  3538#COMMAND INITIALIZE_INTERFACE &.
  3539  // B$ obj_flag        bit 0 = in_object, bit 1 = in_class, bit 2 = in proc/func
  3540  // X.AGG agg_count(class)     defined count of objects in class
  3541
  3542  // ZA$ procedure/function label for procedures and functions
  3543  // ZB$ current_dep        the current dependant number to assign
  3544  // ZC$ current_message    the current flex message number
  3545  // ZD$ group_size         size of the current item group
  3546  // ZE$ group_id           unique id of current item group
  3547  // ZF$ super_class_count  count of objects in superclass
  3548  // ZG$ temp               temp counter (items, functions etc)
  3549  // ZH$ access_method      the current access method identifyer
  3550  // ZI$ sub_obj_count      the sub object counter
  3551  // ZJ$ current_object     the current_object number
  3552
  3553//  #SET ZC$ $400             // begin up high, past predefinded
  3554  #SET ZC$ $1000            // now reserving 4K for predefined msgs
  3555
  3556//  #SET ZH$ $4001          // begin access methods here
  3557  #SET ZH$ $40000001        // now using 32-bit msg ids; allows for 256M objs
  3558
  3559  #SET ZJ$ 2                // desktop and clipboard are first
  3560
  3561  #REPLACE IS$NEW$FMAC |CI1 // indicates that this is the new fmac
  3562  //#REPLACE IS$WINDOWS |CI1  // comment this to create character mode version
  3563
  3564  #IFDEF IS$WINDOWS
  3565    #REM EXTENDED FMAC FOR DATAFLEX FOR WINDOWS.
  3566  #ELSE
  3567    #REM EXTENDED FMAC FOR DATAFLEX CHARACTER MODE.
  3568  #ENDIF
  3569
  3570#IFDEF IS$WINDOWS
  3571
  3572  // Current FMAC Version, Revision and Build
  3573  #REPLACE FMAC_VERSION  |CI6
  3574  #REPLACE FMAC_REVISION |CI0
  3575  #REPLACE FMAC_BUILD    |CI0
  3576
  3577  // Define object class types.
  3578  #REPLACE U_DESKTOP            |CI1    // a desktop class object
  3579  #REPLACE U_MESSAGE            |CI2    // a message class object
  3580  #REPLACE U_cm_MENU            |CI3    // a menu class object
  3581  #REPLACE U_cm_EDIT            |CI4    // a edit class object
  3582  #REPLACE U_SCROLLB            |CI5    // a scroll bar class object
  3583  #REPLACE U_cm_LIST            |CI6    // a list class object
  3584  #REPLACE U_cm_BUTTON          |CI7    // a button class object
  3585  #REPLACE U_cm_CHECKBOX        |CI8    // a check box class object
  3586  #REPLACE U_cm_CHECKLIST       |CI9    // a check box class object
  3587  #REPLACE U_cm_FORM            |CI10   // a form class object
  3588  #REPLACE U_cm_FORMLIST        |CI11   // a form class object
  3589  #REPLACE U_CLIENT             |CI12   // a client area class object
  3590  #REPLACE U_cm_TITLE           |CI13   // a title bar class object
  3591  #REPLACE U_cm_ACTION_BAR      |CI14   // a action bar class object
  3592  #REPLACE U_cm_WARNING_MSG     |CI15   // a warning message class object
  3593  #REPLACE U_cm_CRIT_MSG        |CI16   // a critical error class object
  3594  #REPLACE U_cm_ERROR           |CI17   // a standard error class object
  3595  #REPLACE U_cm_HELP            |CI18   // a help class object
  3596  #REPLACE U_ARRAY              |CI19   // a array class of mixed scalars
  3597  #REPLACE U_TRACE              |CI20   // a trace class object
  3598  #REPLACE U_cm_ENTRY           |CI21   // a data entry class object
  3599  #REPLACE U_cm_ENTRYLIST       |CI22   // a data entry class object
  3600  #REPLACE U_cm_DIALOG          |CI23   // a DIALOG area class object
  3601  #REPLACE U_cm_RADIO           |CI24   // a radio button area
  3602  #REPLACE U_cm_RADIOLIST       |CI25   // a radio list  area
  3603  #REPLACE U_cm_VCONSOLE        |CI26   // a virtual console area
  3604  #REPLACE U_CLIPBOARD          |CI27   // the clipboard handler
  3605#ELSE
  3606
  3607  // Current FMAC Version, Revision and Build
  3608  #REPLACE FMAC_VERSION  |CI32
  3609  #REPLACE FMAC_REVISION |CI0
  3610  #REPLACE FMAC_BUILD    |CI0
  3611
  3612  // Define object class types.
  3613  #REPLACE U_DESKTOP            |CI1    // a desktop class object
  3614  #REPLACE U_MESSAGE            |CI2    // a message class object
  3615  #REPLACE U_MENU               |CI3    // a menu class object
  3616  #REPLACE U_EDIT               |CI4    // a edit class object
  3617  #REPLACE U_SCROLLB            |CI5    // a scroll bar class object
  3618  #REPLACE U_LIST               |CI6    // a list class object
  3619  #REPLACE U_BUTTON             |CI7    // a button class object
  3620  #REPLACE U_CHECKBOX           |CI8    // a check box class object
  3621  #REPLACE U_CHECKLIST          |CI9    // a check box class object
  3622  #REPLACE U_FORM               |CI10   // a form class object
  3623  #REPLACE U_FORMLIST           |CI11   // a form class object
  3624  #REPLACE U_CLIENT             |CI12   // a client area class object
  3625  #REPLACE U_TITLE              |CI13   // a title bar class object
  3626  #REPLACE U_ACTION_BAR         |CI14   // a action bar class object
  3627  #REPLACE U_WARNING_MSG        |CI15   // a warning message class object
  3628  #REPLACE U_CRIT_MSG           |CI16   // a critical error class object
  3629  #REPLACE U_ERROR              |CI17   // a standard error class object
  3630  #REPLACE U_HELP               |CI18   // a help class object
  3631  #REPLACE U_ARRAY              |CI19   // a array class of mixed scalars
  3632  #REPLACE U_TRACE              |CI20   // a trace class object
  3633  #REPLACE U_ENTRY              |CI21   // a data entry class object
  3634  #REPLACE U_ENTRYLIST          |CI22   // a data entry class object
  3635  #REPLACE U_DIALOG             |CI23   // a DIALOG area class object
  3636  #REPLACE U_RADIO              |CI24   // a radio button area
  3637  #REPLACE U_RADIOLIST          |CI25   // a radio list  area
  3638  #REPLACE U_VCONSOLE           |CI26   // a virtual console area
  3639  #REPLACE U_CLIPBOARD          |CI27   // the clipboard handler
  3640#ENDIF
  3641
  3642  // Base data structures
  3643  #REPLACE MESSAGE_CLASS        |CI0
  3644  #REPLACE MENU_CLASS           |CI1
  3645  #REPLACE LIST_CLASS           |CI2
  3646  #REPLACE EDIT_CLASS           |CI3
  3647  #REPLACE SCROLL_CLASS         |CI4
  3648  #REPLACE ARRAY_CLASS          |CI5
  3649
  3650
  3651  // Define physical key names
  3652  #REPLACE KEY_ALT              |VI$8200
  3653  #REPLACE KEY_SHIFT            |VI$8400
  3654  #REPLACE KEY_CTRL             |VI$8800
  3655
  3656  #REPLACE KEY_ENTER            |VI$9001
  3657  #REPLACE KEY_TAB              |VI$9002
  3658  #REPLACE KEY_BACK_SPACE       |VI$9003
  3659  #REPLACE KEY_ESCAPE           |VI$9004
  3660  #REPLACE KEY_UP_ARROW         |VI$9005
  3661  #REPLACE KEY_DOWN_ARROW       |VI$9006
  3662  #REPLACE KEY_LEFT_ARROW       |VI$9007
  3663  #REPLACE KEY_RIGHT_ARROW      |VI$9008
  3664  #REPLACE KEY_HOME             |VI$9009
  3665  #REPLACE KEY_END              |VI$900A
  3666  #REPLACE KEY_PGUP             |VI$900B
  3667  #REPLACE KEY_PGDN             |VI$900C
  3668  #REPLACE KEY_INSERT           |VI$900D
  3669  #REPLACE KEY_DELETE           |VI$900E
  3670  #REPLACE KEY_F1               |VI$9010
  3671  #REPLACE KEY_F2               |VI$9011
  3672  #REPLACE KEY_F3               |VI$9012
  3673  #REPLACE KEY_F4               |VI$9013
  3674  #REPLACE KEY_F5               |VI$9014
  3675  #REPLACE KEY_F6               |VI$9015
  3676  #REPLACE KEY_F7               |VI$9016
  3677  #REPLACE KEY_F8               |VI$9017
  3678  #REPLACE KEY_F9               |VI$9018
  3679  #REPLACE KEY_F10              |VI$9019
  3680  #REPLACE KEY_F11              |VI$901A
  3681  #REPLACE KEY_F12              |VI$901B
  3682  #REPLACE KEY_A                |VI$8041
  3683  #REPLACE KEY_B                |VI$8042
  3684  #REPLACE KEY_C                |VI$8043
  3685  #REPLACE KEY_D                |VI$8044
  3686  #REPLACE KEY_E                |VI$8045
  3687  #REPLACE KEY_F                |VI$8046
  3688  #REPLACE KEY_G                |VI$8047
  3689  #REPLACE KEY_H                |VI$8048
  3690  #REPLACE KEY_I                |VI$8049
  3691  #REPLACE KEY_J                |VI$804A
  3692  #REPLACE KEY_K                |VI$804B
  3693  #REPLACE KEY_L                |VI$804C
  3694  #REPLACE KEY_M                |VI$804D
  3695  #REPLACE KEY_N                |VI$804E
  3696  #REPLACE KEY_O                |VI$804F
  3697  #REPLACE KEY_P                |VI$8050
  3698  #REPLACE KEY_Q                |VI$8051
  3699  #REPLACE KEY_R                |VI$8052
  3700  #REPLACE KEY_S                |VI$8053
  3701  #REPLACE KEY_T                |VI$8054
  3702  #REPLACE KEY_U                |VI$8055
  3703  #REPLACE KEY_V                |VI$8056
  3704  #REPLACE KEY_W                |VI$8057
  3705  #REPLACE KEY_X                |VI$8058
  3706  #REPLACE KEY_Y                |VI$8059
  3707  #REPLACE KEY_Z                |VI$805A
  3708  #REPLACE KEY_SPACE            |VI$8020
  3709  #REPLACE KSPACE               |VI$8020
  3710  #REPLACE KEY_0                |VI$8030
  3711  #REPLACE KEY_1                |VI$8031
  3712  #REPLACE KEY_2                |VI$8032
  3713  #REPLACE KEY_3                |VI$8033
  3714  #REPLACE KEY_4                |VI$8034
  3715  #REPLACE KEY_5                |VI$8035
  3716  #REPLACE KEY_6                |VI$8036
  3717  #REPLACE KEY_7                |VI$8037
  3718  #REPLACE KEY_8                |VI$8038
  3719  #REPLACE KEY_9                |VI$8039
  3720  #REPLACE KEY_PLUS             |VI$802B
  3721  #REPLACE KEY_MINUS            |VI$802D
  3722  #REPLACE KEY_EQUAL            |VI$803D
  3723  #REPLACE KEY_BACK_SLASH       |VI$805C
  3724  #REPLACE KEY_SLASH            |VI$802F
  3725
  3726  // Define Accelerator key names.
  3727  #REPLACE KHELP                |CI274
  3728  #REPLACE KSAVE_RECORD         |CI265
  3729  #REPLACE KDELETE_RECORD       |CI266
  3730  #REPLACE KEXIT_FUNCTION       |CI281
  3731  #REPLACE KEXIT_APPLICATION    |CI282
  3732  #REPLACE KPROMPT              |CI283
  3733  #REPLACE KPRINT_SCREEN        |CI258
  3734  #REPLACE KCLEAR               |CI269
  3735  #REPLACE KREFRESH_SCREEN      |CI284
  3736  #REPLACE KSWITCH              |CI285
  3737  #REPLACE KSWITCH_BACK         |CI286
  3738  #REPLACE KFIND                |CI263
  3739  #REPLACE KFIND_PREVIOUS       |CI270
  3740  #REPLACE KFIND_NEXT           |CI271
  3741  #REPLACE KSUPER_FIND          |CI264
  3742  #REPLACE KSUPER_FIND_PREVIOUS |CI287
  3743  #REPLACE KSUPER_FIND_NEXT     |CI288
  3744  #REPLACE KACTION_BAR          |CI289
  3745  #REPLACE KENTER               |CI257
  3746  #REPLACE KUPARROW             |CI272
  3747  #REPLACE KDOWNARROW           |CI273
  3748  #REPLACE KLEFTARROW           |CI260
  3749  #REPLACE KRIGHTARROW          |CI261
  3750  #REPLACE KSCROLL_BACK         |CI290
  3751  #REPLACE KSCROLL_FORWARD      |CI291
  3752  #REPLACE KSCROLL_LEFT         |CI292
  3753  #REPLACE KSCROLL_RIGHT        |CI293
  3754  #REPLACE KBEGIN_OF_LINE       |CI294
  3755  #REPLACE KEND_OF_LINE         |CI295
  3756  #REPLACE KNEXT_ITEM           |CI296
  3757  #REPLACE KPREVIOUS_ITEM       |CI262
  3758  #REPLACE KDELETE_CHARACTER    |CI277
  3759  #REPLACE KERASE_END_OF_LINE   |CI297
  3760  #REPLACE KBACK_SPACE          |CI278
  3761  #REPLACE KCANCEL              |CI259
  3762  #REPLACE KBEGIN_OF_PANEL      |CI298
  3763  #REPLACE KEND_OF_PANEL        |CI299
  3764  #REPLACE KBEGIN_OF_DATA       |CI300
  3765  #REPLACE KEND_OF_DATA         |CI301
  3766  #REPLACE KWORD_LEFT           |CI302
  3767  #REPLACE KWORD_RIGHT          |CI303
  3768  #REPLACE KINSERT              |CI276
  3769  #REPLACE KCLEAR_AND_RETURN    |CI279
  3770  #REPLACE KADD_MODE            |CI304
  3771  #REPLACE KPASTE               |CI305
  3772  #REPLACE KCOPY                |CI306
  3773  #REPLACE KCUT                 |CI307
  3774  #REPLACE KCLEAR_ALL           |CI308
  3775  #REPLACE KMOUSE               |CI309
  3776  #REPLACE KMARK                |CI310
  3777  #REPLACE KZOOM                |CI311
  3778  #REPLACE KCLOSE_PANEL         |CI312
  3779
  3780  //OLD KEY DEFINITIONS
  3781  #REPLACE KCALCULATE           |CI267
  3782  #REPLACE KUSER                |CI268
  3783  #REPLACE KUSER2               |CI275
  3784  #REPLACE KCLEOW               |CI280
  3785
  3786  // Built in UI messages
  3787  #REPLACE GET_ACTIVE_STATE         |CI$0001
  3788  #REPLACE GET_PARENT               |CI$0002
  3789  #REPLACE SET_PARENT               |CI$0003
  3790  #REPLACE MSG_PAGE_OBJECT          |CI$0004
  3791  #REPLACE GET_LOCATION             |CI$0005
  3792  #REPLACE SET_LOCATION             |CI$0006
  3793  #REPLACE GET_ENTRY_MSG            |CI$0007
  3794  #REPLACE SET_ENTRY_MSG            |CI$0008
  3795  #REPLACE GET_EXIT_MSG             |CI$0009
  3796  #REPLACE SET_EXIT_MSG             |CI$000A
  3797  #REPLACE SET_SIZE                 |CI$000B
  3798  #REPLACE GET_SIZE                 |CI$000C
  3799  #REPLACE GET_CURRENT_ITEM         |CI$000D
  3800  #REPLACE SET_CURRENT_ITEM         |CI$000E
  3801  #REPLACE GET_TOP_ITEM             |CI$000F
  3802  #REPLACE SET_TOP_ITEM             |CI$0010
  3803  #REPLACE GET_VALUE                |CI$0011
  3804  #REPLACE SET_VALUE                |CI$0012
  3805  #REPLACE GET_MESSAGE              |CI$0013
  3806  #REPLACE SET_MESSAGE              |CI$0014
  3807  #REPLACE GET_ITEM_COUNT           |CI$0015
  3808  #REPLACE SET_ITEM_COUNT           |CI$0016
  3809  #REPLACE GET_SELECT_COUNT         |CI$0017
  3810  #REPLACE SET_SELECT_COUNT         |CI$0018
  3811  #REPLACE GET_MULTI_SELECT_MSG     |CI$0019
  3812  #REPLACE SET_MULTI_SELECT_MSG     |CI$001A
  3813  #REPLACE SET_FOCUS_MODE           |CI$001B
  3814  #REPLACE GET_FOCUS_MODE           |CI$001C
  3815  #REPLACE SET_VISIBLE_STATE        |CI$001D
  3816  #REPLACE GET_VISIBLE_STATE        |CI$001E
  3817  #REPLACE SET_SELECT_MODE          |CI$001F
  3818  #REPLACE GET_SELECT_MODE          |CI$0020
  3819  #REPLACE SET_WRAP_STATE           |CI$0021
  3820  #REPLACE GET_WRAP_STATE           |CI$0022
  3821  #REPLACE SET_SHADOW_STATE         |CI$0023
  3822  #REPLACE GET_SHADOW_STATE         |CI$0024
  3823  #REPLACE GET_SELECT_STATE         |CI$0025
  3824  #REPLACE SET_SELECT_STATE         |CI$0026
  3825  #REPLACE SET_AUTOCLEAR_STATE      |CI$0027
  3826  #REPLACE GET_AUTOCLEAR_STATE      |CI$0028
  3827  #REPLACE SET_CENTER_STATE         |CI$0029
  3828  #REPLACE GET_CENTER_STATE         |CI$002A
  3829  #REPLACE SET_CHECKBOX_ITEM_STATE  |CI$002B
  3830  #REPLACE GET_CHECKBOX_ITEM_STATE  |CI$002C
  3831  #REPLACE MSG_STOP_UI              |CI$002D
  3832  #REPLACE MSG_ERROR                |CI$002E
  3833  #REPLACE MSG_HELP                 |CI$002F
  3834  #REPLACE MSG_BELL                 |CI$0030
  3835  #REPLACE MSG_PAINT                |CI$0031
  3836  #REPLACE MSG_NONE                 |CI$0032
  3837  #REPLACE MSG_EXIT                 |CI$0033
  3838  #REPLACE MSG_NEXT                 |CI$0034
  3839  #REPLACE MSG_PULL_RIGHT           |CI$0035
  3840  #REPLACE MSG_PULL_LEFT            |CI$0036
  3841  #REPLACE MSG_KEY                  |CI$0037
  3842  #REPLACE MSG_INSERT_ITEM          |CI$0038
  3843  #REPLACE MSG_ADD_ITEM             |CI$0039
  3844  #REPLACE MSG_DELETE_ITEM          |CI$003A
  3845  #REPLACE MSG_DELETE_DATA          |CI$003B
  3846  #REPLACE MSG_SORT_ITEMS           |CI$003C
  3847  #REPLACE GET_ITEM_MATCHING        |CI$003D
  3848  #REPLACE GET_AUX_VALUE            |CI$003E
  3849  #REPLACE SET_AUX_VALUE            |CI$003F
  3850  #REPLACE GET_SEARCH_MODE          |CI$0040
  3851  #REPLACE SET_SEARCH_MODE          |CI$0041
  3852  #REPLACE GET_INVERSE_STATE        |CI$0042
  3853  #REPLACE SET_INVERSE_STATE        |CI$0043
  3854  #REPLACE MSG_SCROLL               |CI$0044
  3855  #REPLACE SET_CLASS_COLORS         |CI$0045
  3856  #REPLACE GET_HORIZONTAL_INCREMENT |CI$0046
  3857  #REPLACE SET_HORIZONTAL_INCREMENT |CI$0047
  3858  #REPLACE MSG_UP                   |CI$0048
  3859  #REPLACE MSG_DOWN                 |CI$0049
  3860  #REPLACE MSG_RIGHT                |CI$004A
  3861  #REPLACE MSG_LEFT                 |CI$004B
  3862  #REPLACE MSG_BEGINNING_OF_DATA    |CI$004C
  3863  #REPLACE MSG_END_OF_DATA          |CI$004D
  3864  #REPLACE MSG_BEGINNING_OF_PANEL   |CI$004E
  3865  #REPLACE MSG_END_OF_PANEL         |CI$004F
  3866  #REPLACE MSG_BEGINNING_OF_LINE    |CI$0050
  3867  #REPLACE MSG_END_OF_LINE          |CI$0051
  3868  #REPLACE MSG_PAGE_UP              |CI$0052
  3869  #REPLACE MSG_PAGE_DOWN            |CI$0053
  3870  #REPLACE SET_INSERT_MODE          |CI$0054
  3871  #REPLACE MSG_GOTO_LINE            |CI$0055
  3872  #REPLACE MSG_MOVE_ABSOLUTE        |CI$0056
  3873  #REPLACE MSG_MOVE_RELATIVE        |CI$0057
  3874  #REPLACE MSG_MARK_ON              |CI$0058
  3875  #REPLACE MSG_PASTE                |CI$0059
  3876  #REPLACE MSG_CUT                  |CI$005A
  3877  #REPLACE MSG_COPY                 |CI$005B
  3878  #REPLACE MSG_INSERT               |CI$005C
  3879  #REPLACE MSG_DELETE_CHAR          |CI$005D
  3880  #REPLACE MSG_DELETE_LINE          |CI$005E
  3881  #REPLACE MSG_DELETE_TO_EOL        |CI$005F
  3882  #REPLACE MSG_FIND                 |CI$0060
  3883  #REPLACE GET_FIND                 |CI$0060 //dup
  3884  #REPLACE MSG_REPLACE              |CI$0061
  3885  #REPLACE GET_REPLACE              |CI$0061 //dup
  3886  #REPLACE MSG_PRINT                |CI$0062
  3887  #REPLACE GET_MARK                 |CI$0063
  3888  #REPLACE GET_CHANGED_STATE        |CI$0064
  3889  #REPLACE SET_CHANGED_STATE        |CI$0065
  3890  #REPLACE SET_RIGHT_MARGIN         |CI$0066
  3891  #REPLACE GET_LINE_COUNT           |CI$0067
  3892  #REPLACE SET_STATUS_LINE_STATE    |CI$0068
  3893  #REPLACE SET_BLOCK_MOUSE_STATE    |CI$0069
  3894  #REPLACE GET_BLOCK_MOUSE_STATE    |CI$006A
  3895  #REPLACE SET_COLUMN_MODE          |CI$006B
  3896  #REPLACE GET_COLUMN_MODE          |CI$006C
  3897  #REPLACE SET_FILE_NAME            |CI$006D
  3898  #REPLACE GET_FILE_NAME            |CI$006E
  3899  #REPLACE MSG_DEFAULT_KEY          |CI$006F
  3900  #REPLACE SET_DYNAMIC_UPDATE_STATE |CI$0070
  3901  #REPLACE GET_FOCUS                |CI$0071
  3902  #REPLACE MSG_REFRESH_SCREEN       |CI$0072
  3903  #REPLACE MSG_PREVIOUS             |CI$0073
  3904  #REPLACE SET_CHECK_STRING         |CI$0074
  3905  #REPLACE MSG_ACTIVATE             |CI$0075
  3906  #REPLACE MSG_ACTIVATE_GROUP       |CI$0076
  3907  #REPLACE MSG_DEACTIVATE           |CI$0077
  3908  #REPLACE MSG_DEACTIVATE_GROUP     |CI$0078
  3909  #REPLACE SET_LOCAL_ROTATE_STATE   |CI$0079
  3910  #REPLACE GET_LOCAL_ROTATE_STATE   |CI$007A
  3911  #REPLACE SET_CLIENT_AREA_STATE    |CI$007B
  3912  #REPLACE GET_CLIENT_AREA_STATE    |CI$007C
  3913  #REPLACE GET_READ_ONLY_STATE      |CI$007D
  3914  #REPLACE SET_READ_ONLY_STATE      |CI$007E
  3915  #REPLACE SET_LINE_WIDTH           |CI$007F
  3916  #REPLACE GET_LINE_SIZE            |CI$0080
  3917  #REPLACE GET_DISPLAY_SIZE         |CI$0081
  3918  #REPLACE SET_SCROLL_BAR_VISIBLE_STATE |CI$0082
  3919  #REPLACE SET_ORIGIN               |CI$0083
  3920  #REPLACE GET_ORIGIN               |CI$0084
  3921  #REPLACE GET_POSITION             |CI$0085
  3922  #REPLACE MSG_TRUE                 |CI$0086
  3923  #REPLACE MSG_FALSE                |CI$0087
  3924  #REPLACE MSG_LAST_KEY_PRESSED     |CI$0088
  3925  #REPLACE GET_LAST_KEY_PRESSED     |CI$0088 //dup
  3926  #REPLACE SET_RADIO_STRING         |CI$0089
  3927  #REPLACE SET_ENTRY_STATE          |CI$008A
  3928  #REPLACE GET_ENTRY_STATE          |CI$008B
  3929  #REPLACE MSG_READ                 |CI$008C
  3930  #REPLACE MSG_WRITE                |CI$008D
  3931  #REPLACE SET_SCROLL_BAR_OFFSET    |CI$008E
  3932  #REPLACE GET_SCROLL_BAR_OFFSET    |CI$008F
  3933  #REPLACE MSG_ITEM_CHANGE          |CI$0090
  3934  #REPLACE GET_ITEM_CHANGED_STATE   |CI$0091
  3935  #REPLACE SET_ITEM_CHANGED_STATE   |CI$0092
  3936  #REPLACE GET_AUTO_TOP_ITEM_STATE  |CI$0093
  3937  #REPLACE SET_AUTO_TOP_ITEM_STATE  |CI$0094
  3938  #REPLACE SET_KBD_INPUT_MODE       |CI$0095
  3939  #REPLACE MSG_SUPPLY_KEY           |CI$0096
  3940  #REPLACE GET_INSERT_MODE          |CI$0097
  3941  #REPLACE MSG_OK                   |CI$0098
  3942  #REPLACE MSG_CANCEL               |CI$0099
  3943  #REPLACE GET_ARRAY_VALUE          |CI$009A
  3944  #REPLACE SET_ARRAY_VALUE          |CI$009B
  3945  #REPLACE MSG_CONSTRUCT_OBJECT     |CI$009C
  3946  #REPLACE MSG_ACTIVATING           |CI$009D
  3947  #REPLACE MSG_TRACE_SWITCH         |CI$009E
  3948  #REPLACE MSG_TRACE_MESSAGE        |CI$009F
  3949  #REPLACE MSG_TRACE_STEP           |CI$00A0
  3950  #REPLACE MSG_TRACE_OUTPUT         |CI$00A1
  3951  #REPLACE MSG_DEACTIVATING         |CI$00A2
  3952  #REPLACE GET_CLASS                |CI$00A3
  3953  #REPLACE GET_HELP_NAME            |CI$00A4
  3954  #REPLACE MSG_EXIT_APPLICATION     |CI$00A5
  3955  #REPLACE MSG_PRINT_SCREEN         |CI$00A6
  3956  #REPLACE GET_RIGHT_MARGIN         |CI$00A7
  3957  #REPLACE GET_DELEGATION_MODE      |CI$00A8
  3958  #REPLACE SET_DELEGATION_MODE      |CI$00A9
  3959  #REPLACE GET_BASE_CLASS           |CI$00AA
  3960  #REPLACE SET_ITEM_ENTRY_MSG       |CI$00AB
  3961  #REPLACE GET_ITEM_ENTRY_MSG       |CI$00AC
  3962  #REPLACE SET_ITEM_EXIT_MSG        |CI$00AD
  3963  #REPLACE GET_ITEM_EXIT_MSG        |CI$00AE
  3964  #REPLACE SET_ITEM_VALIDATE_MSG    |CI$00AF
  3965  #REPLACE GET_ITEM_VALIDATE_MSG    |CI$00B0
  3966  #REPLACE SET_DATA_FILE            |CI$00B1
  3967  #REPLACE GET_DATA_FILE            |CI$00B2
  3968  #REPLACE SET_DATA_FIELD           |CI$00B3
  3969  #REPLACE GET_DATA_FIELD           |CI$00B4
  3970  #REPLACE SET_DATA_WINDOW          |CI$00B5
  3971  #REPLACE GET_DATA_WINDOW          |CI$00B6
  3972  #REPLACE SET_ITEM_OPTIONS         |CI$00B7
  3973  #REPLACE GET_ITEM_OPTIONS         |CI$00B8
  3974  #REPLACE SET_ITEM_OPTION          |CI$00B9
  3975  #REPLACE GET_ITEM_OPTION          |CI$00BA
  3976  #REPLACE MSG_ENTRY_UPDATE         |CI$00BB
  3977  #REPLACE MSG_ENTRY_FIND           |CI$00BC
  3978  #REPLACE MSG_ENTRY_SUPERFIND      |CI$00BD
  3979  #REPLACE MSG_ENTRY_DISPLAY        |CI$00BE
  3980  #REPLACE MSG_ENTRY_CLEAR          |CI$00BF
  3981  #REPLACE GET_VALIDATE_ITEMS       |CI$00C0
  3982  #REPLACE GET_ITEM_WINDOW          |CI$00C1
  3983  #REPLACE MSG_COPY_ITEMS           |CI$00C2
  3984  #REPLACE GET_IMAGE_NUMBER         |CI$00C3
  3985  #REPLACE MSG_ENTRY_CLEAR_ALL      |CI$00C4
  3986  #REPLACE MSG_SELECT_TOGGLING      |CI$00C5
  3987  #REPLACE GET_ITEM_ENTRY           |CI$00C6
  3988  #REPLACE GET_ITEM_EXIT            |CI$00C7
  3989  #REPLACE GET_ITEM_VALIDATE        |CI$00C8
  3990  #REPLACE GET_READ_ONLY_ERROR      |CI$00C9
  3991  #REPLACE GET_NAME                 |CI$00CA
  3992  #REPLACE GET_ENTRY                |CI$00CB
  3993  #REPLACE MSG_DESTROY_OBJECT       |CI$00CC
  3994  #REPLACE MSG_DESTROY_ALL_OBJECTS  |CI$00CD
  3995  #REPLACE GET_MOUSE_HIT            |CI$00CE
  3996  #REPLACE SET_OBJECT_COLOR         |CI$00CF
  3997  #REPLACE SET_ARROWS               |CI$00D0
  3998  #REPLACE MSG_SWITCH               |CI$00D1
  3999  #REPLACE MSG_SWITCH_BACK          |CI$00D2
  4000  #REPLACE GET_WAS_FOUND            |CI$00D3
  4001  #REPLACE GET_STATUS_LINE_STATE    |CI$00D4
  4002  #REPLACE SET_HIGHLIGHT_STATE      |CI$00D5    // INTERNAL
  4003  #REPLACE MSG_ROTATE_UP            |CI$00D6    // INTERNAL
  4004  #REPLACE MSG_POP_PAGES            |CI$00D7    // INTERNAL
  4005  #REPLACE SET_CLASS                |CI$00D8    // INTERNAL
  4006  #REPLACE MSG_FETCH_HELP           |CI$00D9    // INTERNAL
  4007  #REPLACE GET_OBJECT_ID            |CI$00DA    // INTERNAL
  4008  #REPLACE MSG_INIT_INSTANCE        |CI$00DB    // INTERNAL
  4009  #REPLACE MSG_PAGE                 |CI$00DC    // INTERNAL
  4010  #REPLACE MSG_PAGE_DELETE          |CI$00DD    // INTERNAL
  4011  //#REPLACE GET_COLORS             |CI$00DE    // INTERNAL
  4012  #REPLACE GET_BAR_LOCATION         |CI$00DF    // INTERNAL
  4013  #REPLACE RETURN_LOCATION          |CI$00E0    // INTERNAL
  4014  #REPLACE MSG_CHANGE_LOCATION      |CI$00E1    // INTERNAL
  4015  #REPLACE MSG_WRITE_DBMS           |CI$00E2
  4016  #REPLACE MSG_READ_DBMS            |CI$00E3
  4017  #REPLACE MSG_WRITE_IMAGE          |CI$00E2    // same as dbms
  4018  #REPLACE MSG_READ_IMAGE           |CI$00E3    // same as dbms
  4019  #REPLACE GET_STRING_VALUE         |CI$00E4
  4020  #REPLACE GET_NUMBER_VALUE         |CI$00E5
  4021  #REPLACE GET_DATE_VALUE           |CI$00E6
  4022  #REPLACE GET_INTEGER_VALUE        |CI$00E7
  4023  #REPLACE GET_REAL_VALUE           |CI$00E8
  4024  #REPLACE SET_BASE_ITEM            |CI$00E9
  4025  #REPLACE GET_BASE_ITEM            |CI$00EA
  4026  #REPLACE SET_ITEM_LIMIT           |CI$00EB
  4027  #REPLACE GET_ITEM_LIMIT           |CI$00EC
  4028  #REPLACE MSG_MARK_OFF             |CI$00ED
  4029  #REPLACE SET_SEARCH_CASE          |CI$00EE
  4030  #REPLACE SET_PRIOR_FOCUS          |CI$00EF
  4031  #REPLACE GET_PRIOR_FOCUS          |CI$00F0
  4032  #REPLACE SET_NEXT_FOCUS           |CI$00F1
  4033  #REPLACE GET_NEXT_FOCUS           |CI$00F2
  4034  #REPLACE SET_SCROLLBAR            |CI$00F3
  4035  #REPLACE GET_ASCII_STATE          |CI$00F4
  4036  #REPLACE SET_ASCII_STATE          |CI$00F5
  4037  #REPLACE GET_TEXT_INDENT          |CI$00F6
  4038  #REPLACE SET_TEXT_INDENT          |CI$00F7
  4039  #REPLACE MSG_ENTRY_AUTOFIND       |CI$00F8
  4040  #REPLACE SET_SCOPE_STATE          |CI$00F9
  4041  #REPLACE GET_SCOPE_STATE          |CI$00FA
  4042  #REPLACE MSG_MOUSE_CHANGE_FOCUS   |CI$00FB
  4043  #REPLACE GET_CHILD_COUNT          |CI$00FC
  4044  #REPLACE MSG_MOUSE_UP             |CI$00FD
  4045  #REPLACE MSG_MOUSE_UP2            |CI$00FE
  4046  #REPLACE MSG_MOUSE_UP3            |CI$00FF
  4047  #REPLACE MSG_MOUSE_CLICK          |CI$0100
  4048  #REPLACE MSG_MOUSE_CLICK2         |CI$0101
  4049  #REPLACE MSG_MOUSE_CLICK3         |CI$0102
  4050  #REPLACE MSG_MOUSE_DOWN           |CI$0103
  4051  #REPLACE MSG_MOUSE_DOWN2          |CI$0104
  4052  #REPLACE MSG_MOUSE_DOWN3          |CI$0105
  4053  #REPLACE MSG_MOUSE_DRAG           |CI$0106
  4054  #REPLACE MSG_MOUSE_DRAG2          |CI$0107
  4055  #REPLACE MSG_MOUSE_DRAG3          |CI$0108
  4056  #REPLACE GET_ABSOLUTE_MOUSE_LOCATION |CI$0109
  4057  #REPLACE SET_ABSOLUTE_MOUSE_LOCATION |CI$010A
  4058  #REPLACE GET_DYNAMIC_UPDATE_STATE |CI$010B
  4059  #REPLACE SET_MAX_LINES            |CI$010C
  4060  #REPLACE GET_MAX_LINES            |CI$010D
  4061  #REPLACE MSG_VIRTUAL_CONSOLE      |CI$010E
  4062  #REPLACE GET_NEXT_ENTRY_OK        |CI$010F
  4063  #REPLACE GET_PREVIOUS_ENTRY_OK    |CI$0110
  4064  #REPLACE SET_DYNAMIC_COLORS       |CI$0111
  4065  #REPLACE SET_NEW_ITEM             |CI$0112
  4066  #REPLACE SET_BROADCAST_STATE      |CI$0113
  4067  #REPLACE GET_BROADCAST_STATE      |CI$0114
  4068  #REPLACE GET_WRAPPING             |CI$0115
  4069  #REPLACE GET_ROW_CHANGING         |CI$0116
  4070  #REPLACE MSG_ADD_FOCUS            |CI$0117
  4071  #REPLACE MSG_REMOVE_OBJECT        |CI$0118
  4072  #REPLACE MSG_RELEASE_FOCUS        |CI$0119
  4073  #REPLACE MSG_ENTERING             |CI$011A
  4074  #REPLACE MSG_EXITING              |CI$011B
  4075  #REPLACE MSG_ENTERING_SCOPE       |CI$011C
  4076  #REPLACE MSG_EXITING_SCOPE        |CI$011D
  4077  #REPLACE MSG_SWITCH_NEXT_GROUP    |CI$011E
  4078  #REPLACE MSG_SWITCH_PRIOR_GROUP   |CI$011F
  4079  #REPLACE GET_CURRENT_SCOPE        |CI$0120
  4080  #REPLACE SET_CURRENT_SCOPE        |CI$0121
  4081  #REPLACE MSG_POPUP                |CI$0122
  4082  #REPLACE MSG_POPUP_GROUP          |CI$0123
  4083  #REPLACE SET_POPUP_STATE          |CI$0124
  4084  #REPLACE GET_POPUP_STATE          |CI$0125
  4085  #REPLACE SET_RING_STATE           |CI$0126
  4086  #REPLACE GET_RING_STATE           |CI$0127
  4087  #REPLACE MSG_MOVE_FOCUS_TREE      |CI$0128
  4088  #REPLACE SET_PROMPT_OBJECT        |CI$0129
  4089  #REPLACE GET_PROMPT_OBJECT        |CI$012A
  4090  #REPLACE SET_ZOOM_OBJECT          |CI$012B
  4091  #REPLACE GET_ZOOM_OBJECT          |CI$012C
  4092  #REPLACE GET_PRIOR_LEVEL          |CI$012D
  4093  #REPLACE GET_NEXT_LEVEL           |CI$012E
  4094  #REPLACE GET_PRIOR_SCOPE          |CI$012F
  4095  #REPLACE GET_NEXT_SCOPE           |CI$0130
  4096  #REPLACE MSG_SWITCH_PRIOR_SCOPE   |CI$0131
  4097  #REPLACE MSG_SWITCH_NEXT_SCOPE    |CI$0132
  4098  #REPLACE SET_ATTACH_PARENT_STATE  |CI$0133
  4099  #REPLACE GET_ATTACH_PARENT_STATE  |CI$0134
  4100  #REPLACE MSG_CHILD_WRAPPING       |CI$0135
  4101  #REPLACE SET_DISPLAY_MODE         |CI$0136
  4102  #REPLACE GET_DISPLAY_MODE         |CI$0137
  4103  #REPLACE MSG_COLOR_BLOCK          |CI$0138
  4104  #REPLACE MSG_NEXT_OBJECT          |CI$0139
  4105  #REPLACE MSG_PRIOR_OBJECT         |CI$013A
  4106  #REPLACE SET_APPLICATION_NAME     |CI$013B
  4107  #REPLACE GET_APPLICATION_NAME     |CI$013C
  4108  #REPLACE SET_MODULE_NAME          |CI$013D
  4109  #REPLACE GET_MODULE_NAME          |CI$013E
  4110  #REPLACE GET_LAST_CHILD           |CI$013F
  4111  #REPLACE SET_WINDOW_COLOR         |CI$0140
  4112  #REPLACE GET_WINDOW_COLOR         |CI$0141
  4113  #REPLACE MSG_PROCESS_KEY          |CI$0142
  4114  #REPLACE MSG_ACTIVATE_SCOPE       |CI$0143
  4115  #REPLACE GET_FIND_SCOPE           |CI$0144
  4116  #REPLACE GET_SCOPE_FOCUS          |CI$0145
  4117  #REPLACE GET_VALID_ITEM           |CI$0146
  4118  #REPLACE MSG_UPDATE_DISPLAY       |CI$0147
  4119  #REPLACE SET_ITEM                 |CI$0148
  4120  #REPLACE MSG_TRACE_COMMAND        |CI$0149    // INTERNAL
  4121  #REPLACE GET_OBJECT_COLOR         |CI$014A
  4122  #REPLACE SET_OBJECT_VALIDATION    |CI$014B
  4123  #REPLACE GET_OBJECT_VALIDATION    |CI$014C
  4124  #REPLACE GET_NEXT_OBJECT_ID       |CI$014D
  4125  #REPLACE GET_PRIOR_OBJECT_ID      |CI$014E
  4126  #REPLACE GET_CLASS_COLORS         |CI$014F
  4127  #REPLACE GET_LOCATION_TYPE        |CI$0150
  4128  #REPLACE GET_OBJECT_SIZE          |CI$0151
  4129  #REPLACE GET_IN_USE_STATE         |CI$0152
  4130  #REPLACE SET_IN_USE_STATE         |CI$0153
  4131  #REPLACE MSG_ATTACH_DEO_TO_SERVER |CI$0154
  4132  #REPLACE MSG_REQUEST_CLEAR_ALL    |CI$0155
  4133  #REPLACE MSG_CLEAR                |CI$0156
  4134  #REPLACE SET_CURRENT_RECORD       |CI$0157
  4135  #REPLACE GET_CURRENT_RECORD       |CI$0158
  4136  #REPLACE MSG_REBUILD_CONSTRAINTS  |CI$0159
  4137  #REPLACE MSG_CONSTRAIN            |CI$015A
  4138  #REPLACE SET_MAIN_FILE            |CI$015B
  4139  #REPLACE GET_MAIN_FILE            |CI$015C
  4140  #REPLACE GET_FIND_SERVER          |CI$015D
  4141  #REPLACE GET_LOCATE_SERVER        |CI$015E
  4142  #REPLACE MSG_MARK_AS_COMPONENT    |CI$015F
  4143  #REPLACE MSG_DELETING             |CI$0160
  4144  #REPLACE GET_VALIDATE_DELETE      |CI$0161
  4145  #REPLACE MSG_REQUEST_DELETE       |CI$0162
  4146  #REPLACE MSG_DISPLAY              |CI$0163
  4147  #REPLACE MSG_RELATE_MAIN_FILE     |CI$0164
  4148  #REPLACE MSG_CLEAR_UI             |CI$0165
  4149  #REPLACE MSG_DISPLAY_UI           |CI$0166
  4150  #REPLACE MSG_REQUEST_ASSIGN       |CI$0167
  4151  #REPLACE GET_VALIDATE_SAVE        |CI$0168
  4152  #REPLACE MSG_ATTACH_MAIN_FILE     |CI$0169
  4153  #REPLACE MSG_REQUEST_CLEAR        |CI$016A
  4154  #REPLACE MSG_BACKOUT              |CI$016B
  4155  #REPLACE MSG_UPDATE               |CI$016C
  4156  #REPLACE MSG_SAVE_MAIN_FILE       |CI$016D
  4157  #REPLACE MSG_DELETE_MAIN_FILE     |CI$016E
  4158  #REPLACE GET_ENTRY_PERMISSIVE_STATE |CI$016F
  4159  #REPLACE SET_ENTRY_PERMISSIVE_STATE |CI$0170
  4160  #REPLACE SET_ORDERING             |CI$0171
  4161  #REPLACE GET_ORDERING             |CI$0172
  4162  #REPLACE GET_COMPONENT_STATE      |CI$0173
  4163  #REPLACE SET_COMPONENT_STATE      |CI$0174
  4164  #REPLACE GET_HAS_COMPONENTS_STATE |CI$0175
  4165  #REPLACE SET_HAS_COMPONENTS_STATE |CI$0176
  4166  #REPLACE MSG_REQUEST_SAVE         |CI$0177
  4167  #REPLACE MSG_REMOVE_FOCUS         |CI$0178
  4168  #REPLACE MSG_ATTACH_SERVER        |CI$0179
  4169  #REPLACE MSG_DETACH_SERVER        |CI$017A
  4170  #REPLACE MSG_ATTACH_CLIENT        |CI$017B
  4171  #REPLACE MSG_DETACH_CLIENT        |CI$017C
  4172  #REPLACE MSG_ADD_USER_INTERFACE   |CI$017D
  4173  #REPLACE MSG_REMOVE_USER_INTERFACE |CI$017E
  4174  #REPLACE MSG_MAIN_FILE_CHANGED    |CI$017F
  4175  #REPLACE GET_IS_SUPERFIND_REQUIRED |CI$0180
  4176  #REPLACE MSG_REQUEST_FIND         |CI$0181
  4177  #REPLACE MSG_ADD_PARENT_FILE      |CI$0182
  4178  #REPLACE MSG_REMOVE_PARENT_FILE   |CI$0183
  4179  #REPLACE MSG_REQUEST_SUPERFIND    |CI$0184
  4180  #REPLACE MSG_REQUEST_READ         |CI$0185
  4181  #REPLACE MSG_READ_BY_RECNUM       |CI$0186
  4182  #REPLACE MSG_FIND_BY_RECNUM       |CI$0187
  4183  #REPLACE MSG_ESTABLISH_FIND_DIRECTION |CI$0188
  4184  #REPLACE MSG_LOCATE_NEXT          |CI$0189
  4185  #REPLACE GET_RECORD_NOT_FOUND     |CI$018A
  4186  #REPLACE MSG_INIT_CLASS           |CI$018B
  4187  #REPLACE SET_IMAGE_NUMBER         |CI$018C
  4188  #REPLACE GET_ROW                  |CI$018D
  4189  #REPLACE GET_CURRENT_ROW          |CI$018E
  4190  #REPLACE GET_TOP_ROW              |CI$018F
  4191  #REPLACE GET_BOTTOM_ITEM          |CI$0190
  4192  #REPLACE GET_BOTTOM_ROW           |CI$0191
  4193  #REPLACE GET_ROW_COUNT            |CI$0192
  4194  #REPLACE GET_DISPLAYABLE_ROWS     |CI$0193
  4195  #REPLACE MSG_ADD_ROW              |CI$0194
  4196  #REPLACE MSG_INSERT_ROW           |CI$0195
  4197  #REPLACE SET_PALETTE_COLOR        |CI$0196
  4198  #REPLACE GET_PALETTE_COLOR        |CI$0197
  4199  #REPLACE SET_CLASS_PALETTE        |CI$0198
  4200  #REPLACE GET_CLASS_PALETTE        |CI$0199
  4201  #REPLACE GET_NO_DELETE_STATE      |CI$019A
  4202  #REPLACE SET_NO_DELETE_STATE      |CI$019B
  4203  #REPLACE MSG_REQUEST_ENTRY_UPDATE |CI$019C
  4204  #REPLACE MSG_SCROLL_PAINT         |CI$019D
  4205  #REPLACE MSG_SHOW_ITEM            |CI$019E
  4206  #REPLACE SET_EXTERNAL_PAINT_STATE |CI$019F
  4207  #REPLACE GET_EXTERNAL_PAINT_STATE |CI$01A0
  4208  #REPLACE SET_MATRIX_SIZE          |CI$01A1
  4209  #REPLACE GET_MATRIX_SIZE          |CI$01A2
  4210  #REPLACE SET_SKIP_STATE           |CI$01A3
  4211  #REPLACE GET_SKIP_STATE           |CI$01A4
  4212  #REPLACE GET_REQUEST_VALIDATE     |CI$01A5
  4213  #REPLACE GET_AUTO_FILL_STATE      |CI$01A6
  4214  #REPLACE SET_AUTO_FILL_STATE      |CI$01A7
  4215  #REPLACE GET_FIND_PERMISSIVE_STATE |CI$01A8
  4216  #REPLACE SET_FIND_PERMISSIVE_STATE |CI$01A9
  4217  #REPLACE MSG_TRANSACTION_ABORTED  |CI$01AA
  4218  #REPLACE MSG_CLEAR_ALL            |CI$01AB
  4219  #REPLACE MSG_CREATING             |CI$01AC
  4220  #REPLACE MSG_DESTROYING           |CI$01AD // OBSOLETE
  4221  #REPLACE GET_SHOULD_SAVE          |CI$01AE
  4222  #REPLACE GET_WHICH_DATA_SET       |CI$01AF
  4223  #REPLACE GET_VALIDATE_CONSTRAINTS |CI$01B0
  4224  #REPLACE MSG_ERROR_REPORT         |CI$01B1
  4225  #REPLACE MSG_REQUEST_RELATE       |CI$01B2
  4226  #REPLACE GET_ERROR_TEXT           |CI$01B3
  4227  #REPLACE GET_SUGGESTED_ORDERING   |CI$01B4
  4228  #REPLACE SET_SUGGESTED_ORDERING   |CI$01B5
  4229  #REPLACE GET_NO_RELATE_STATE      |CI$01B6
  4230  #REPLACE SET_NO_RELATE_STATE      |CI$01B7
  4231  #REPLACE GET_WINDOW_LOCATION      |CI$01B8
  4232  #REPLACE GET_SIGNON_STATUS        |CI$01B9
  4233//  #REPLACE MSG_ADD_WATCHER          |CI$01BA
  4234//  #REPLACE MSG_REMOVE_WATCHER       |CI$01BB
  4235  #REPLACE GET_SEARCH_CASE          |CI$01BC
  4236  #REPLACE GET_SHOULD_SAVE_ROW      |CI$01BD
  4237  #REPLACE MSG_DISPLAY_STATUS       |CI$01BE
  4238  #REPLACE MSG_CLEAR_SET            |CI$01BF
  4239  #REPLACE GET_AUTOFIND_ITEM        |CI$01C0
  4240  #REPLACE SET_KEY_PATH             |CI$01C1
  4241  #REPLACE GET_KEY_PATH             |CI$01C2
  4242  #REPLACE GET_CAN_DELETE           |CI$01C3
  4243  #REPLACE MSG_UPDATE_DEPENDENT_ITEMS |CI$01C4
  4244  #REPLACE GET_SUPERFIND_FIELD      |CI$01C5
  4245  #REPLACE MSG_REFRESH              |CI$01C6
  4246  #REPLACE MSG_PROCESS_ACCELERATOR  |CI$01C7
  4247  #REPLACE GET_ERROR_TEXT_AVAILABLE |CI$01C8
  4248  #REPLACE GET_PROTOTYPE_OBJECT     |CI$01C9
  4249  #REPLACE MSG_REFIND_RECORDS       |CI$01CA
  4250  #REPLACE MSG_END_CONSTRUCT_OBJECT |CI$01CB
  4251  #REPLACE MSG_CLEAR_MAIN_FILE      |CI$01CC
  4252  #REPLACE MSG_REQUEST_CLEAR_FILE   |CI$01CD
  4253  #REPLACE GET_CALLBACK             |CI$01CE
  4254  #REPLACE GET_IS_CRITICAL          |CI$01CF
  4255  #REPLACE GET_VIRTUAL_CONSOLE      |CI$01D0
  4256  #REPLACE SET_VIRTUAL_CONSOLE      |CI$01D1
  4257  #REPLACE GET_KBD_INPUT_MODE       |CI$01D2
  4258  #REPLACE GET_VERIFY_RETRY         |CI$01D3
  4259  #REPLACE GET_DATA_SET_SERVER               |CI$0292
  4260  #REPLACE GET_DATA_SET_CLIENT               |CI$0293
  4261  #REPLACE GET_DATA_SET_USER_INTERFACE       |CI$0294
  4262  #REPLACE GET_DATA_SET_SERVER_COUNT         |CI$0295
  4263  #REPLACE GET_DATA_SET_CLIENT_COUNT         |CI$0296
  4264  #REPLACE GET_DATA_SET_USER_INTERFACE_COUNT |CI$0297
  4265  #REPLACE SET_ALWAYS_REFRESH_STATE          |CI$0298
  4266  #REPLACE GET_ALWAYS_REFRESH_STATE          |CI$0299
  4267  #REPLACE MSG_RESET_FILEMODES_FOR_LOCK      |CI$029A
  4268  #REPLACE SET_SMART_FILEMODE_STATE          |CI$029B
  4269  #REPLACE GET_SMART_FILEMODE_STATE          |CI$029C
  4270  #REPLACE SET_SMART_FILEMODE_FOR_LOCK       |CI$029D
  4271  #REPLACE GET_SMART_FILEMODE_FOR_LOCK       |CI$029E
  4272  #REPLACE SET_SMART_FILEMODE_FOR_NO_LOCK    |CI$029F
  4273  #REPLACE GET_SMART_FILEMODE_FOR_NO_LOCK    |CI$02A0
  4274  #REPLACE SET_CASCADE_DELETE_STATE          |CI$02A1
  4275  #REPLACE GET_CASCADE_DELETE_STATE          |CI$02A2
  4276  #REPLACE GET_VALIDATE_DELETE_NO_CASCADE    |CI$02A3
  4277  #REPLACE MSG_ADD_CLIENT_FILE               |CI$02A4
  4278  #REPLACE MSG_REMOVE_CLIENT_FILE            |CI$02A5
  4279  #REPLACE GET_CLIENT_FILE                   |CI$02A6
  4280  #REPLACE GET_CLIENT_FILE_COUNT             |CI$02A7
  4281  #REPLACE MSG_ADD_SERVER_FILE               |CI$02A8
  4282  #REPLACE MSG_REMOVE_SERVER_FILE            |CI$02A9
  4283  #REPLACE GET_SERVER_FILE                   |CI$02AA
  4284  #REPLACE GET_SERVER_FILE_COUNT             |CI$02AB
  4285  #REPLACE GET_PARENT_FILE                   |CI$02AC
  4286  #REPLACE GET_PARENT_FILE_COUNT             |CI$02AD
  4287  #REPLACE MSG_OPERATION_NOT_ALLOWED         |CI$02AE
  4288  #REPLACE MSG_NEW_CURRENT_RECORD            |CI$02AF
  4289
  4290  //#FREG |CI$01CE STRING PERCENTAGE RETURNS INTEGER
  4291
  4292  #REPLACE DFLT$VALUE               __X__
  4293  #REPLACE DFLT$MESSAGE             __X__
  4294  #REPLACE DFLT$AUX_VALUE           __X__
  4295  #REPLACE DFLT$SHADOW_STATE        __X__
  4296  #REPLACE DFLT$SELECT_STATE        __X__
  4297  #REPLACE DFLT$CHECKBOX_ITEM_STATE __X__
  4298  #REPLACE DFLT$AUTOCLEAR_STATE     __X__
  4299  #REPLACE DFLT$CENTER_STATE        __X__
  4300  #REPLACE DFLT$ENTRY_STATE         __X__
  4301  #REPLACE DFLT$ITEM_CHANGED_STATE  __X__
  4302  #REPLACE DFLT$ITEM_ENTRY_MSG      __X__
  4303  #REPLACE DFLT$ITEM_EXIT_MSG       __X__
  4304  #REPLACE DFLT$ITEM_VALIDATE_MSG   __X__
  4305  #REPLACE DFLT$DATA_FILE           __X__
  4306  #REPLACE DFLT$DATA_FIELD          __X__
  4307  #REPLACE DFLT$DATA_WINDOW         __X__
  4308  #REPLACE DFLT$ITEM_OPTIONS        __X__
  4309  #REPLACE DFLT$ITEM_OPTION         __X__
  4310  #REPLACE DFLT$PROMPT_OBJECT       __X__
  4311  #REPLACE DFLT$ZOOM_OBJECT         __X__
  4312
  4313  //Reserve$Internal$Functions // this disallows these names to be used in
  4314                               // in functions, properties or cts.
  4315  #REPLACE FN$Abs                          __F__
  4316  #REPLACE FN$Acos                         __F__
  4317  #REPLACE FN$Append                       __F__
  4318  #REPLACE FN$Ascii                        __F__
  4319  #REPLACE FN$Asin                         __F__
  4320  #REPLACE FN$Atan                         __F__
  4321  #REPLACE FN$Center                       __F__
  4322  #REPLACE FN$Character                    __F__
  4323  #REPLACE FN$Cos                          __F__
  4324  #REPLACE FN$Date                         __F__
  4325  #REPLACE FN$Eval                         __F__
  4326  #REPLACE FN$Exp                          __F__
  4327  #REPLACE FN$Hi                           __F__
  4328  #REPLACE FN$If                           __F__
  4329  #REPLACE FN$Insert                       __F__
  4330  #REPLACE FN$Integer                      __F__
  4331  #REPLACE FN$Left                         __F__
  4332  #REPLACE FN$Length                       __F__
  4333  #REPLACE FN$Log                          __F__
  4334  #REPLACE FN$Low                          __F__
  4335  #REPLACE FN$Lowercase                    __F__
  4336  #REPLACE FN$Ltrim                        __F__
  4337  #REPLACE FN$Mid                          __F__
  4338  #REPLACE FN$Mod                          __F__
  4339  #REPLACE FN$Not                          __F__
  4340  #REPLACE FN$Number                       __F__
  4341  #REPLACE FN$Overstrike                   __F__
  4342  #REPLACE FN$Pad                          __F__
  4343  #REPLACE FN$Pos                          __F__
  4344  #REPLACE FN$Random                       __F__
  4345  #REPLACE FN$Real                         __F__
  4346  #REPLACE FN$Remove                       __F__
  4347  #REPLACE FN$Repeat                       __F__
  4348  #REPLACE FN$Replace                      __F__
  4349  #REPLACE FN$Replaces                     __F__
  4350  #REPLACE FN$Right                        __F__
  4351  #REPLACE FN$Round                        __F__
  4352  #REPLACE FN$Rtrim                        __F__
  4353  #REPLACE FN$Sin                          __F__
  4354  #REPLACE FN$Sqrt                         __F__
  4355  #REPLACE FN$String                       __F__
  4356  #REPLACE FN$Tan                          __F__
  4357  #REPLACE FN$Trim                         __F__
  4358  #REPLACE FN$Uppercase                    __F__
  4359
  4360  #IFDEF IS$WINDOWS
  4361    // new internal functions for VDF7
  4362    #REPLACE FN$CurrentDateTime              __F__
  4363    #REPLACE FN$DateGetDay                   __F__
  4364    #REPLACE FN$DateGetDayofWeek             __F__
  4365    #REPLACE FN$DateGetDayofYear             __F__
  4366    #REPLACE FN$DateGetHour                  __F__
  4367    #REPLACE FN$DateGetMinute                __F__
  4368    #REPLACE FN$DateGetMonth                 __F__
  4369    #REPLACE FN$DateGetSecond                __F__
  4370    #REPLACE FN$DateGetYear                  __F__
  4371    #REPLACE FN$DateSetDay                   __F__
  4372    #REPLACE FN$DateSetHour                  __F__
  4373    #REPLACE FN$DateSetMinute                __F__
  4374    #REPLACE FN$DateSetMonth                 __F__
  4375    #REPLACE FN$DateSetSecond                __F__
  4376    #REPLACE FN$DateSetYear                  __F__
  4377    #REPLACE FN$IsDateValid                  __F__
  4378    #REPLACE FN$SpanDays                     __F__
  4379    #REPLACE FN$SpanHours                    __F__
  4380    #REPLACE FN$SpanMinutes                  __F__
  4381    #REPLACE FN$SpanSeconds                  __F__
  4382    #REPLACE FN$SpanTotalDays                __F__
  4383    #REPLACE FN$SpanTotalHours               __F__
  4384    #REPLACE FN$SpanTotalMinutes             __F__
  4385    #REPLACE FN$SpanTotalSeconds             __F__
  4386    #REPLACE FN$Addressof                    __F__
  4387    #REPLACE FN$Cast                         __F__
  4388    #REPLACE FN$Convert                      __F__
  4389    #REPLACE FN$InvokeXML                    __F__
  4390    //
  4391    #REPLACE FN$Storec                       __F__
  4392    #REPLACE FN$Storew                       __F__
  4393    #REPLACE FN$Storedw                      __F__
  4394    #REPLACE FN$Derefc                       __F__
  4395    #REPLACE FN$Derefw                       __F__
  4396    #REPLACE FN$Derefdw                      __F__
  4397    #REPLACE FN$MemCopy                      __F__
  4398    #REPLACE FN$MemSet                       __F__
  4399  #ENDIF // is windows
  4400
  4401
  4402  // Object commands
  4403  #REPLACE OBJ$INIT         $0440
  4404  #REPLACE OBJ$CREATE       $0441
  4405  #REPLACE OBJ$ILIST        $0442
  4406  #REPLACE OBJ$ITEM         $0443
  4407  #REPLACE OBJ$ENDILIST     $0444
  4408  #REPLACE OBJ$ACCLIST      $0445 // not used
  4409  #REPLACE OBJ$ONKEY        $0446
  4410  #REPLACE OBJ$ENDALIST     $0447 // not used
  4411  #REPLACE OBJ$ENDDEFINE    $0448 // not used
  4412  #REPLACE OBJ$IODISPATCH   $0449
  4413  #REPLACE OBJ$SET          $044A
  4414  #REPLACE OBJ$GET          $044B
  4415  #REPLACE OBJ$SEND         $044C
  4416  #REPLACE OBJ$FIX          $044D  // not used
  4417  #REPLACE OBJ$END          $044E
  4418  #REPLACE OBJ$FWDFIX       $044F  // not used
  4419  #REPLACE OBJ$HRET         $0450
  4420  #REPLACE OBJ$ITEM_EXEC    $0451
  4421  #REPLACE OBJ$ACCEPT       $0452
  4422  #REPLACE CREATE$CLASS     $0453
  4423  #REPLACE HANDLE$FOR       $0454
  4424  #REPLACE OBJ$END$HANDLER  $0455
  4425  #REPLACE LOCAL$ARGUMENT   $0456
  4426  #REPLACE FIND$OBJECT      $0457
  4427  #REPLACE END$CLASS        $0458
  4428  #REPLACE CREATE$SUB$PAGE  $0459
  4429  #REPLACE CLONE$CLASS      $045A
  4430  #REPLACE OBJ$ENTRY$ITEM   $045B
  4431  #REPLACE MOVE$SUB$PAGE    $045C
  4432  #REPLACE OBJ$TIMER        $045D
  4433  #REPLACE SCREEN$OPT       $045E
  4434  #REPLACE CREATE$PROPERTY  $045F
  4435  #REPLACE REDEFINE$SUB$PAGE $0464
  4436
  4437  //Focus modes:
  4438  #REPLACE FOCUSABLE    |CI0
  4439  #REPLACE NONFOCUSABLE |CI1
  4440  #REPLACE POINTER_ONLY |CI2
  4441  #REPLACE NO_ACTIVATE  |CI3
  4442
  4443  //Search modes:
  4444  #REPLACE FIRST_CHARACTER  |CI0
  4445  #REPLACE INCREMENTAL      |CI1
  4446  #REPLACE CAPITAL          |CI2
  4447  #REPLACE NO_SEARCH        |CI3
  4448
  4449  //Delegation modes:
  4450  #REPLACE DELEGATE_TO_PARENT       |CI0
  4451  #REPLACE NO_DELEGATE_OR_ERROR     |CI1
  4452  #REPLACE NO_DELEGATION            |CI2
  4453  #REPLACE RETURN_INVALID_MESSAGE   |CI3
  4454  #REPLACE DELEGATE_PRIOR_LEVEL     |CI4
  4455
  4456  //Location modes:
  4457  #REPLACE ABSOLUTE         |CI0
  4458  #REPLACE RELATIVE         |CI1
  4459  #REPLACE ITEM_RELATIVE    |CI2
  4460
  4461  //Sort modes:
  4462  #REPLACE ASCENDING        |CI0
  4463  #REPLACE DESCENDING       |CI1
  4464
  4465  //Select Modes:
  4466  #REPLACE NO_SELECT        |CI0
  4467  #REPLACE SINGLE_SELECT    |CI1
  4468  #REPLACE MULTI_SELECT     |CI2
  4469  #REPLACE AUTO_SELECT      |CI3
  4470
  4471  //Entry item options:
  4472  #REPLACE IWINDOW          $C0A1
  4473  #REPLACE IENTRY           $C0A2
  4474  #REPLACE IEXIT            $C0A3
  4475  #REPLACE IVALIDATE        $C0A4
  4476  #REPLACE IZOOM            $C0A5
  4477  #REPLACE IPROMPT          $C0A6
  4478
  4479  //Import modes
  4480  #REPLACE INHERIT          1
  4481  #REPLACE NO_OVERWRITE     2
  4482
  4483  //System integers
  4484  #REPLACE CURRENT_OBJECT     |VI85
  4485  #REPLACE FORWARD$MESSAGE    |VI87
  4486  #REPLACE CURRENT_MESSAGE    |VI88
  4487  #REPLACE TOTAL_OBJECTS      |VI89
  4488
  4489  // Define the desktop objects
  4490  #REPLACE NULL_OBJECT          |CI0
  4491  #REPLACE CLIPBOARD            |CI1
  4492  #REPLACE CLIPBOARD.N          |CI0
  4493  //#REPLACE DESKTOP              |CI2            // now defined in flex$init
  4494  #REPLACE DESKTOP.N            |CI0
  4495  //#REPLACE END_FUNCTION         END_PROCEDURE   // now defined in flex$init
  4496  //#REPLACE PROCEDURE_RETURN     FUNCTION_RETURN // now defined in flex$init
  4497  #REPLACE NO_IMAGE             |CI-9999
  4498
  4499  #REPLACE CURRENT              |CI-99 //use current item#
  4500  #REPLACE TOGGLE_STATE         |CI3   //toggle boolean state
  4501  #REPLACE UPWARD_DIRECTION     |CI0   //scroll up
  4502  #REPLACE DOWNWARD_DIRECTION   |CI1   //scroll down
  4503
  4504//  #REPLACE GET_SCROLLBAR        |CI$4000
  4505//  #REPLACE GET_CLIPBOARD        |CI$4001
  4506//  #FREG |CI$4000 RETURNS INTEGER
  4507//  #FREG |CI$4001 RETURNS INTEGER
  4508
  4509// bumped up for 32-bit msg ids
  4510  #REPLACE GET_SCROLLBAR        |CI$40000000
  4511  #REPLACE GET_CLIPBOARD        |CI$40000001
  4512  #FREG |CI$40000000 RETURNS INTEGER
  4513  #FREG |CI$40000001 RETURNS INTEGER
  4514
  4515  #REPLACE ERROR_OBJECT_ID      |VI100
  4516  #REPLACE ERROR_TYPE           |VI101
  4517
  4518  #REPLACE ERROR_CHILD_INHERITS_PARENT  |CI0
  4519  #REPLACE ERROR_OFF_IN_CHILD           |CI1
  4520  #REPLACE ERROR_DEFAULT_IN_CHILD       |CI2
  4521
  4522  //deactivate search modes
  4523  #REPLACE SCOPE_TYPE                   |CI1
  4524  #REPLACE POPUP_TYPE                   |CI2
  4525  #REPLACE AREA_TYPE                    |CI3
  4526
  4527  //add_focus/activate/deactivate/release_focus error return codes
  4528  #REPLACE ERROR_ENTERING               |CI1
  4529  #REPLACE ERROR_EXITING                |CI2
  4530  #REPLACE ERROR_ACTIVATING             |CI3
  4531  #REPLACE ERROR_DEACTIVATING           |CI4
  4532  #REPLACE ERROR_CANT_ACCEPT_FOCUS      |CI5
  4533  #REPLACE ERROR_CANT_CREATE_TREE       |CI6
  4534  #REPLACE ERROR_ADD_TO_INACTIVE_OBJECT |CI7
  4535  #REPLACE ERROR_NO_FOCUSABLE_CHILDREN  |CI8
  4536
  4537
  4538  #CHKSUB 1 1                   // Verify the UI subsystem.
  4539  !A [] OBJ$INIT |CI0           // INITIALIZE_INTERFACE
  4540  #FREF OBJ$DESK$NUM !a         // Number of desktop dependants
  4541  #IFDEF IS$WINDOWS
  4542     // in windows this is done in winbase.pkg
  4543  #ELSE
  4544     !A [] $2e4                     //  BEGIN$NEW$ERROR$SYSTEM  // this activates the new error system
  4545     #REPLACE NEW$ERROR$SYSTEM |CI1 // for internal use only!
  4546  #ENDIF
  4547#ENDCOMMAND
  4548
  4549// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4550//
  4551//   Command:
  4552//     Object ObjectName IS [A|AN] ObjectClass {ImageName} {SubImageNames...}
  4553//
  4554//   Parameters:
  4555//     ObjectName is a string.
  4556//     ObjectClass is an integer.
  4557//     ImageName is a string.
  4558//
  4559//   Description:
  4560//
  4561// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4562
  4563// JJT-5.1
  4564//#COMMAND OBJECT R "IS" "A""AN" RVD#I
  4565//  #IF (!0<5)                // if no image try to aquire one
  4566//    OBJECT !1 !2 !3 !4 !1
  4567//  #ELSE
  4568//    #DATA               // start up the data stream
  4569//    #PUSH !Zj               // save the unique object label
  4570//    #PUSH !b                // save current definition state
  4571//    #IF (!b = 4)            // if in procedure and not class
  4572//      #SET ZJ$ 0                // do not inc z
  4573//    #ELSE
  4574//      #SET ZJ$ !ZB          // assign the next object id
  4575//    #ENDIF
  4576//    #PUSH !Zb               // save this level on stack
  4577//    #IFDEF !4.AGG           // was this a class with sub objects?
  4578//      #SET ZB$ !4.AGG           // sub objects will begin at the
  4579//    #ELSE               // next object after superclass
  4580//      #SET ZB$ 0                // base classes start at 0
  4581//    #ENDIF
  4582//    #SET ZI$ !ZI                // count this object at the current level
  4583//    #PUSH !Zi               // and push the level
  4584//    #IF (!b > 0)            // if (in_object | in_class)
  4585//      #IF (!b & 2)              // obj_flag == in_class?
  4586//        #IF (!b & 1)              // obj_flag == in_Object?
  4587//        #ELSE           // No Name for Subobject in constructor
  4588//          #REPLACE !$.!1.OBJ |CI-!Zj  // object_name = -current_object
  4589//        #ENDIF
  4590//      #ENDIF
  4591//// (LS) removed setting of ZJ; it is NOT being used.
  4592//// (Removed when max lines increased > 32k)
  4593////      #SET ZJ$ (32766-!a)           // a very unique label for this object
  4594//      #DPUSH |CS".!1"           // make name from parent and child
  4595//    #ELSE               // global object name
  4596//      #DPUSH |CS"!1"            // assign an absolute name to object
  4597//    #ENDIF
  4598//    #CHECK U_!4 _U          // does class exist?
  4599//    #DPUSH U_!4             // define then class the class id
  4600//    GET$OBJ$IMAGE !5            // define the objects image
  4601//    #IF ((!b & 3) = 2)          // if in_class & !in_object
  4602//      #DPUSH !$.!1.OBJ          // pick the assigned dependant number
  4603//    #ELSE               //
  4604//      #IF (!b = 0)          // A global object must assign #
  4605//        #IFDEF !1.OBJ           // Is the symbol defined, name_object?
  4606//          #DPUSH |CI0           // pick the next dependant number
  4607//        #ELSE
  4608//          #DPUSH |CI!Zj         // force the dependant number
  4609////          #SET ZJ$ ($1000+!Zj)       // mark as global object
  4610//          #SET ZJ$ ($10000000+!Zj)   // using 32-bit ids now
  4611//          #REPLACE !1.OBJ |CI!Zj        // Assign an ID to this object
  4612//        #ENDIF
  4613//      #ELSE
  4614//        #DPUSH |CI0         // pick the next dependant number
  4615//      #ENDIF
  4616//    #ENDIF
  4617//    REGISTER_OBJECT !1
  4618//    #DPUSH GET_!1
  4619//    #SET B$ (!b | 1)            // we are in a object definition
  4620//    !A [] OBJ$CREATE |VL        // create the object now
  4621
  4622//    #IFDEF !1.OBJ
  4623//      #IFCLASS !1.OBJ V$        // does this object have a global?
  4624//        MOVE CURRENT_OBJECT TO !1.OBJ   // Move the object id to its global
  4625//      #ENDIF
  4626//    #ENDIF
  4627
  4628//    #SPUSH !$   //save the old class name
  4629//    #SET $$ !4
  4630//    #IFSUB '!$$SC' // if flex-defined class
  4631//      #IFSUB '!$$SM' // if begin-instance macro exists
  4632//        !$$SM !$ !5 !6 !7 !8 !9
  4633//      #ELSE
  4634//        FORWARD_BEGIN_CONSTRUCT !$ !5 !6 !7 !8 !9
  4635//      #ENDIF
  4636//    #ELSE
  4637//      ADD$IMAGE$ARGS MSG_CONSTRUCT_OBJECT !5 !6 !7 !8 !9  //else use default
  4638//    #ENDIF
  4639//  #ENDIF
  4640//#ENDCOMMAND
  4641
  4642#COMMAND GET$OBJ$IMAGE          // identify the image type
  4643  #IFDEF !1             // is it a int (dynamic?)
  4644    #DPUSH !1
  4645  #ELSE
  4646    #IFDEF !1.N             // try typical naming scheme
  4647      #DPUSH !1.N
  4648    #ELSE
  4649      #DPUSH |CI0           // not found, make it dynamic
  4650    #ENDIF
  4651  #ENDIF
  4652#ENDCOMMAND
  4653
  4654#COMMAND ADD$IMAGE$ARGS         // pass sub image args to constructor
  4655  #IF (!0>0)                // while there are args to process
  4656    #IFDEF !1               // image name a int?
  4657      #IFSAME !1 MSG_CONSTRUCT_OBJECT   // a special flag to get it going
  4658        #DATA               // start the data stream
  4659      #ENDIF
  4660      #DPUSH !1             // save the message or image id
  4661    #ELSE
  4662      #IFDEF !1.N           // typical image name
  4663        #DPUSH !1.N
  4664      #ELSE
  4665        #DPUSH |CI0         // dynamic image name
  4666      #ENDIF
  4667    #ENDIF
  4668    ADD$IMAGE$ARGS !2 !3 !4 !5 !6 !7 !8 !9
  4669  #ELSE
  4670    !A [] OBJ$SEND CURRENT_OBJECT |VL
  4671  #ENDIF
  4672#ENDCOMMAND
  4673
  4674// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4675//
  4676//   Command:
  4677//  Register_Object Object_Name
  4678//
  4679//   Parameters:
  4680//
  4681//   Description:
  4682//
  4683// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4684
  4685// JJT-5.1
  4686//#COMMAND REGISTER_OBJECT R
  4687//  #IFDEF UI.EXISTS
  4688//  #ELSE
  4689//    USE UI
  4690//  #ENDIF
  4691//  #IFDEF GET_!1
  4692//  #ELSE
  4693//    #REPLACE GET_!1 |CI!ZH
  4694//    #FREG GET_!1 RETURNS INTEGER
  4695//  #ENDIF
  4696//#ENDCOMMAND
  4697
  4698// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4699//
  4700//   Command:
  4701//     ITEM_LIST
  4702//
  4703//   Parameters:
  4704//     None.
  4705//
  4706//   Description:
  4707//     This is the startment that markes the beginning of a list of
  4708//     items to be attached to the current object.  A list class object
  4709//     can not have a item list.
  4710//
  4711// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4712
  4713// JJT-5.1
  4714//#COMMAND ITEM_LIST .
  4715//  #PUSH !Zg
  4716//  #PUSH !Zj
  4717//  #SET ZJ$ !a
  4718//  #PUSH !Zj
  4719//  #SET ZG$ 0              // Set the item counter to zero.  This is used to
  4720//                         // count and assign ID's to the items.
  4721//  !A [] OBJ$ILIST |CI0   // Create the command to save the item count,
  4722//  #FREF OBJ$!Zj$INUM !a    // and tell flex to update it later.
  4723//#ENDCOMMAND
  4724
  4725// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4726//
  4727//   Command:
  4728//    ON_Item {Value} {[SEND Message {TO Object} | BEGIN_PULL_DOWN Pull_Down_Name {Pull_Down_Image}]}
  4729//
  4730//   Parameters:
  4731//     Value is a string.
  4732//     Message is a integer.
  4733//     Object is a integer.
  4734//
  4735//   Description:
  4736//     The ITEM command adds the next item to the current object list.
  4737//     The Message is the value which will be passed to the handler
  4738//     if this item is selected.
  4739//
  4740// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4741
  4742//#COMMAND ON_ITEM NDI """SEND""BEGIN_PULL_DOWN"
  4743//  #IF (!0<2)
  4744//    #IF (!0<1)
  4745//      ON_ITEM '' SEND MSG_NONE
  4746//    #ELSE
  4747//      ON_ITEM !1 SEND MSG_NONE
  4748//    #ENDIF
  4749//  #ELSE
  4750//    #IFSAME !1 SEND
  4751//      ON_ITEM '' !1 !2 !3 !4 !5 !6 !7 !8 !9
  4752//    #ELSE
  4753//      #IFSAME !2 SEND
  4754//        #SET ZG$ !ZG                   // Increment the item counter
  4755//        #IFSAME !4 TO
  4756//          #CHECK !6 .
  4757//          #DATA
  4758//          #IFDEF !3
  4759//            #DPUSH !3           // Push the (variable) message
  4760//          #ELSE
  4761//            #IFDEF MSG_!3
  4762//              #DPUSH MSG_!3     // Push the constant message
  4763//            #ELSE
  4764//              #DPUSH |CI0
  4765//              #FREF MSG_!3 !a,0     // Forward fef the message
  4766//            #ENDIF
  4767//          #ENDIF
  4768//          #IFDEF !5
  4769//            #DPUSH !5           // Push the (expression, var) dest object
  4770//          #ELSE
  4771//            #IFDEF !5.OBJ
  4772//              #DPUSH !5.OBJ     // Push the global object
  4773//            #ELSE
  4774//              #DPUSH |CI0
  4775//              #FREF !5.OBJ !a,1     // Forward ref the object
  4776//            #ENDIF
  4777//          #ENDIF
  4778//          !A [] OBJ$ITEM_EXEC !1 |VL
  4779//        #ELSE
  4780//          #IF (!0 > 3)
  4781//            #CHECK !4 "TO"
  4782//          #ENDIF
  4783//          #IFDEF MSG_!3
  4784//            !A [] OBJ$ITEM MSG_!3 !1       // Create the item passing name and value.
  4785//          #ELSE
  4786//            #IFDEF !3
  4787//              !A [] OBJ$ITEM !3 !1         // Create the item passing name and value.
  4788//            #ELSE
  4789//              !A [] OBJ$ITEM |CI0 !1       // Create the item passing name and value.
  4790//              #FREF MSG_!3 !a              // fix value later with procedure address
  4791//            #ENDIF
  4792//          #ENDIF
  4793//        #ENDIF
  4794//      #ELSE
  4795//        #IFSAME !2 BEGIN_PULL_DOWN
  4796//          #CHECK !3 R
  4797//          REGISTER_OBJECT !3
  4798//          ON_ITEM !1 SEND ACTIVATE_PULL_DOWN TO (!3(CURRENT_OBJECT))
  4799//          #IFSUB 'END_MENU'
  4800//            CREATE_MENU !3 SUB_LOCATION !4 !5 !6 !7 !8 !9
  4801//          #ELSE
  4802//            #ERROR 1000 INVALID ARGUMENT: "BEGIN_PULL_DOWN" REQUIRES MENU_SYSTEM PACKAGE
  4803//          #ENDIF
  4804//        #ENDIF
  4805//      #ENDIF
  4806//    #ENDIF
  4807//  #ENDIF
  4808//#ENDCOMMAND
  4809
  4810// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4811//
  4812//   Command:
  4813//      Repeat_Item Count# TIMES {Item_Syntax}
  4814//
  4815//   Parameters:
  4816//
  4817//   Description:
  4818//
  4819// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4820
  4821#COMMAND REPEAT_ITEM _RNDE "TIMES"
  4822  ON_ITEM !3 !4 !5 !6 !7 !8 !9
  4823  #SET Q$ (!1-1)
  4824  #IF (!q>0)
  4825    REPEAT_ITEM !q TIMES !3 !4 !5 !6 !7 !8 !9
  4826  #ENDIF
  4827#ENDCOMMAND
  4828
  4829// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4830//
  4831//   Command:
  4832//  Entry_Item File.Field {Entry_Options}
  4833//
  4834//   Parameters:
  4835//
  4836//   Description:
  4837//
  4838// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4839
  4840// JJT-5.1
  4841//#COMMAND ENTRY_ITEM R
  4842//  #SET ZG$ !ZG
  4843//  #DATA
  4844//  #IFCLASS !1 "EC"
  4845//    #ENTOPT {$C0A0=!1,$C002,$C003,!2}
  4846//  #ELSE
  4847//    #ENTOPT {$C0A0=!1,!2}
  4848//  #ENDIF
  4849//  !A [] OBJ$ENTRY$ITEM |CI0 |VL
  4850//#ENDCOMMAND
  4851
  4852// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4853//
  4854//   Command:
  4855//     END_ITEM_LIST
  4856//
  4857//   Parameters:
  4858//     None.
  4859//
  4860//   Description:
  4861//     The END_ITEM_LIST command marks the end of a list of items.
  4862//
  4863// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4864
  4865// JJT-5.1
  4866//#COMMAND END_ITEM_LIST .
  4867//  #POP ZJ$
  4868//  #REPLACE OBJ$!Zj$INUM |CI!Zg     // Update the count in the ITEM_LIST cmd.
  4869//  !A [] OBJ$ENDILIST OBJ$!Zj$INUM         // Tell runtime this is the end of list.
  4870//  #POP ZJ$
  4871//  #POP ZG$
  4872//#ENDCOMMAND
  4873
  4874// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4875//
  4876//   Command:
  4877//  END_PULL_DOWN
  4878//
  4879//   Parameters:
  4880//  None.
  4881//
  4882//   Description:
  4883//      Ends the structure of an ON_ITEM ... BEGIN_PULL_DOWN ... as used by
  4884//      Menu_System package.
  4885//
  4886// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4887
  4888#COMMAND END_PULL_DOWN .
  4889  #IFSUB 'END_MENU'
  4890    END_ITEM_LIST
  4891    END_OBJECT
  4892  #ELSE
  4893    #ERROR 1000 INVALID ARGUMENT: "BEGIN_PULL_DOWN" REQUIRES MENU_SYSTEM PACKAGE
  4894  #ENDIF
  4895#ENDCOMMAND
  4896
  4897// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4898//
  4899//   Command:
  4900//  On_Key KeyName SEND Message {TO Object} {PRIVATE}
  4901//
  4902//   Parameters:
  4903//     KeyName is a valid hot key name.
  4904//     Message is valid message name.
  4905//     Object is the a valid object name.
  4906//
  4907//   Description:
  4908//     The ON_KEY command tells the menu manager to pass the
  4909//     specified Message code to the specified Object when the
  4910//     KeyNAme is pressed.  If no Object name is passed, the current
  4911//     object is used.  Passing MSG_NONE for Message causes the key to do
  4912//     nothing, passing MSG_DEFAULT_KEY will restore the default key definition.
  4913//
  4914// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4915
  4916//#COMMAND ON_KEY RULGBO#SDN "SEND" RLGBO#SDN """TO""PRIVATE" _DNOB """PRIVATE" .
  4917//  #IFSAME !4 PRIVATE
  4918//    ON_KEY !1 !2 !3 TO |CI-1 PRIVATE
  4919//  #ELSE
  4920//    #DATA
  4921//    #DPUSH !1
  4922//    #IFSAME !4 TO
  4923//      #IFDEF !5
  4924//        #DPUSH !5
  4925//      #ELSE
  4926//        #IFDEF !5.OBJ
  4927//          #DPUSH !5.OBJ
  4928//        #ELSE
  4929//          #DPUSH |CI0
  4930//          #FREF !5.OBJ !a,1
  4931//        #ENDIF
  4932//      #ENDIF
  4933//    #ELSE
  4934//      #DPUSH |CI-1
  4935//    #ENDIF
  4936//    #IFSAME !6 PRIVATE
  4937//      #DPUSH |CI1
  4938//    #ENDIF
  4939//    #IFDEF !3
  4940//      !A [] OBJ$ONKEY !3 |VL
  4941//    #ELSE
  4942//      #IFDEF MSG_!3
  4943//        !A [] OBJ$ONKEY MSG_!3 |VL
  4944//      #ELSE             // else the command is defined in flex code
  4945//        !A [] OBJ$ONKEY |CI0 |VL        // get flex to fix the fwd ref
  4946//        #FREF MSG_!3 !a
  4947//      #ENDIF
  4948//    #ENDIF
  4949//  #ENDIF
  4950//#ENDCOMMAND
  4951
  4952// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4953//
  4954//   Command:
  4955//     END_OBJECT
  4956//
  4957//   Parameters:
  4958//     None required
  4959//
  4960//   Description:
  4961//     END_OBJECT tells the manager we are done defining an object.
  4962//
  4963// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4964
  4965// JJT-5.1
  4966//#COMMAND END_OBJECT
  4967//  //
  4968//  // The following section was added 01-08-90 by SAL to support inheritable
  4969//  // end-instance macros for classes
  4970//  //
  4971//  #IFSUB '!$$SC'  //if flex-defined class
  4972//    #IFSUB '!$$EM'  //if end-instance macro defined for class,
  4973//      !$$EM !$ !1 !2 !3 !4 !5 !6 !7 !8 !9
  4974//    #ELSE
  4975//      FORWARD_END_CONSTRUCT !$ !1 !2 !3 !4 !5 !6 !7 !8 !9
  4976//    #ENDIF
  4977//  #ELSE
  4978//    DEFAULT_END_OBJECT  //else use default
  4979//  #ENDIF
  4980//  #SPOP           //restore old class name
  4981//  //
  4982//  // end of addition 01-08-90 by SAL
  4983//  //
  4984//#ENDCOMMAND
  4985
  4986// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4987//
  4988//   Command:
  4989//     DEFAULT_END_OBJECT
  4990//
  4991//   Parameters:
  4992//     NONE
  4993//
  4994//   Description:
  4995//     This command terminates an object declaration
  4996//
  4997// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4998
  4999#COMMAND DEFAULT_END_OBJECT .
  5000  !A [] OBJ$END //Mark the end of the object list.
  5001  #POP ZI$              //restore sub_obj_count
  5002  #POP ZB$              //restore current_dep
  5003  #POP B$               //restore obj_flag
  5004  #POP ZJ$              //restore temp label
  5005#ENDCOMMAND
  5006
  5007// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5008//
  5009//   Command:
  5010//  Start_Ui {Object}
  5011//
  5012//   Parameters:
  5013//     NONE
  5014//
  5015//   Description:
  5016//  This command will dispatch io to the current focus.  it will
  5017//  remain in this routine until a non-zero return code is received.
  5018//
  5019// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5020
  5021#COMMAND START_UI
  5022  #IF (!0>0)
  5023    SEND ACTIVATE TO !1
  5024  #ENDIF
  5025  !A [] OBJ$IODISPATCH |CI0 |CI0
  5026#ENDCOMMAND
  5027
  5028// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5029//
  5030//   Command:
  5031//  UI_ACCEPT Object {GROUP | OBJECT} TO ReturnValue
  5032//
  5033//   Parameters:
  5034//
  5035//   Description:
  5036//
  5037// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5038
  5039#COMMAND UI_ACCEPT RSDGBO#L RDGBO#L RDGBO#L _CEL#BOG .
  5040  #IFSAME !2  GROUP OBJECT
  5041    #CHECK !3 "TO"
  5042    #DATA
  5043    #IFSAME !2 GROUP
  5044      #DPUSH |CI1
  5045    #ELSE
  5046      #IFSAME !2 OBJECT
  5047        #DPUSH |CI0
  5048      #ENDIF
  5049    #ENDIF
  5050    #DPUSH !4
  5051    #IFDEF !1
  5052      !A [] OBJ$ACCEPT !1 |VL
  5053    #ELSE
  5054      #IFDEF !1.OBJ
  5055        !A [] OBJ$ACCEPT !1.OBJ |VL
  5056      #ELSE
  5057        !A [] OBJ$ACCEPT |CI0 |VL
  5058        #FREF !1.OBJ !a
  5059      #ENDIF
  5060    #ENDIF
  5061  #ELSE
  5062    UI_ACCEPT !1 OBJECT !2 !3 !4 !5 !6 !7
  5063  #ENDIF
  5064#ENDCOMMAND
  5065
  5066// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5067//
  5068//   Command:
  5069//  SET Property {OF Object} {ITEM #} TO Value {...}
  5070//
  5071//   Parameters:
  5072//
  5073//   Description:
  5074//
  5075// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5076
  5077#COMMAND SET
  5078  GET$SET SET !1 !2 !3 !4 !5 !6 !7 !8 !9
  5079#ENDCOMMAND
  5080
  5081// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5082//
  5083//   Command:
  5084//  GET Property {OF Object} {ITEM #} TO Value {...}
  5085//
  5086//   Parameters:
  5087//
  5088//   Description:
  5089//
  5090// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5091
  5092#COMMAND GET
  5093  GET$SET GET !1 !2 !3 !4 !5 !6 !7 !8 !9
  5094#ENDCOMMAND
  5095
  5096// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5097//
  5098//   Command:
  5099//  FORWARD {GET | SET | SEND} Property {...}
  5100//
  5101//   Parameters:
  5102//
  5103//   Description:
  5104//
  5105// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5106
  5107#COMMAND FORWARD "GET""SET""SEND"
  5108  MOVE 1 TO FORWARD$MESSAGE
  5109  !1 !2 !3 !4 !5 !6 !7 !8 !9
  5110#ENDCOMMAND
  5111
  5112// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5113//
  5114//   Command:
  5115//  DELEGATE {GET | SET | SEND} Property {...}
  5116//
  5117//   Parameters:
  5118//
  5119//   Description:
  5120//
  5121// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5122
  5123#COMMAND DELEGATE "GET""SET""SEND"
  5124  MOVE 8 TO FORWARD$MESSAGE
  5125  !1 !2 !3 !4 !5 !6 !7 !8 !9
  5126#ENDCOMMAND
  5127
  5128// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5129//
  5130//   Command:
  5131//  BROADCAST {RECURSIVE | RECURSIVE_UP} {IGNORE_RETURN} {GET | SET | SEND} Property {...}
  5132//
  5133//   Parameters:
  5134//
  5135//   Description:
  5136//
  5137// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5138
  5139#COMMAND BROADCAST "GET""SET""SEND""RECURSIVE""RECURSIVE_UP""NO_STOP"
  5140  #IFSAME !1 RECURSIVE RECURSIVE_UP
  5141    #CHECK !2 '"GET""SET""SEND""NO_STOP"'
  5142    #IFSAME !1 RECURSIVE
  5143      MOVE 20 TO FORWARD$MESSAGE    // broadcast + recursive_down
  5144    #ELSE
  5145      MOVE 68 TO FORWARD$MESSAGE    // broadcast + recursive_up
  5146    #ENDIF
  5147    #IFSAME !2 NO_STOP
  5148      #CHECK !3 '"GET""SET""SEND"'
  5149      MOVE (FORWARD$MESSAGE+128) TO FORWARD$MESSAGE // no stop on non-0 return
  5150      !3 !4 !5 !6 !7 !8 !9
  5151    #ELSE
  5152      !2 !3 !4 !5 !6 !7 !8 !9
  5153    #ENDIF
  5154  #ELSE
  5155    MOVE 4 TO FORWARD$MESSAGE       // broadcast
  5156    #IFSAME !1 NO_STOP
  5157      #CHECK !2 '"GET""SET""SEND"'
  5158      MOVE (FORWARD$MESSAGE+128) TO FORWARD$MESSAGE // + no_stop
  5159      !2 !3 !4 !5 !6 !7 !8 !9
  5160    #ELSE
  5161      !1 !2 !3 !4 !5 !6 !7 !8 !9
  5162    #ENDIF
  5163  #ENDIF
  5164#ENDCOMMAND
  5165
  5166#COMMAND BROADCAST_FOCUS "GET""SET""SEND""RECURSIVE""RECURSIVE_UP""NO_STOP"
  5167  #IFSAME !1 RECURSIVE RECURSIVE_UP
  5168    #CHECK !2 '"GET""SET""SEND""NO_STOP"'
  5169    #IFSAME !1 RECURSIVE
  5170      MOVE 52 TO FORWARD$MESSAGE    // broadcast + focus + recursive_down
  5171    #ELSE
  5172      MOVE 100 TO FORWARD$MESSAGE   // broadcast + focus + recursive_up
  5173    #ENDIF
  5174    #IFSAME !2 NO_STOP
  5175      #CHECK !3 '"GET""SET""SEND"'
  5176      MOVE (FORWARD$MESSAGE+128) TO FORWARD$MESSAGE // no stop on non-0 return
  5177      !3 !4 !5 !6 !7 !8 !9
  5178    #ELSE
  5179      !2 !3 !4 !5 !6 !7 !8 !9
  5180    #ENDIF
  5181  #ELSE
  5182    MOVE 36 TO FORWARD$MESSAGE      // broadcast + focus
  5183    #IFSAME !1 NO_STOP
  5184      #CHECK !2 '"GET""SET""SEND"'
  5185      MOVE (FORWARD$MESSAGE+128) TO FORWARD$MESSAGE // + no_stop
  5186      !2 !3 !4 !5 !6 !7 !8 !9
  5187    #ELSE
  5188      !1 !2 !3 !4 !5 !6 !7 !8 !9
  5189    #ENDIF
  5190  #ENDIF
  5191#ENDCOMMAND
  5192
  5193// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5194//
  5195//   Command:
  5196//
  5197//   Parameters:
  5198//
  5199//   Description:
  5200//
  5201// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5202
  5203// JJT-5.1
  5204//#COMMAND GET$SET
  5205//  #IFSAME !3 OF
  5206//    #IFSAME DFLT$!2 __X__   // is this a item type message?
  5207//      #IFSAME !5 ITEM       // is the item keyword used?
  5208//        OBJECT$PROPERTIES !1 !2 !4 !6 !7 !8 !9 // pass it on
  5209//      #ELSE
  5210//        OBJECT$PROPERTIES !1 !2 !4 -99 !5 !6 !7 !8 !9  // use dflt
  5211//      #ENDIF
  5212//    #ELSE
  5213//      #IFSAME !5 TO
  5214//        OBJECT$PROPERTIES !1 !2 !4 !6 !7 !8 !9  // just supply args
  5215//      #ELSE
  5216//        OBJECT$PROPERTIES !1 !2 !4 !5 !6 !7 !8 !9  // just supply args
  5217//      #ENDIF
  5218//    #ENDIF
  5219//  #ELSE
  5220//    GET$SET !1 !2 OF CURRENT_OBJECT !3 !4 !5 !6 !7 !8 !9
  5221//  #ENDIF
  5222//#ENDCOMMAND
  5223
  5224
  5225// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5226//
  5227//   Command: OBJECT$PROPERTIES
  5228//
  5229//   Parameters:
  5230//  {GET | SET} PROPERTY OBJECT { {ITEM #} | TO } VALUE {...}
  5231//
  5232//   Description:
  5233//
  5234// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5235
  5236// JJT-5.1
  5237//#COMMAND OBJECT$PROPERTIES "GET""SET" RD#OBLG RSND#OBLG R
  5238//  #DATA
  5239//  #IFDEF !2         // is message in a variable?
  5240//    #DPUSH !2           // yes, just push the value
  5241//  #ELSE
  5242//    #IFDEF !1_!2        // is this message defined?
  5243//      #DPUSH !1_!2      // yes, push the definition
  5244//    #ELSE
  5245//      #DPUSH |CI0       // forward reference the message
  5246//      #FREF !1_!2 !a,0      // add the reference to be defined
  5247//    #ENDIF
  5248//  #ENDIF
  5249//  #PUSH !Zg
  5250//  #SET ZG$ 0
  5251//  PROPERTY$HELP !4 !5 !6 !7 !8 !9
  5252//  #POP ZG$
  5253//  #IFDEF !3
  5254//    !A [] OBJ$!1 !3 |VL
  5255//  #ELSE
  5256//    #IFDEF !3.OBJ
  5257//      !A [] OBJ$!1 !3.OBJ |VL
  5258//    #ELSE
  5259//      !A [] OBJ$!1 |CI0 |VL
  5260//      #FREF !3.OBJ !a
  5261//    #ENDIF
  5262//  #ENDIF
  5263//#ENDCOMMAND
  5264
  5265// JJT-5.1
  5266//#COMMAND PROPERTY$HELP
  5267//  #IF (!0>0)
  5268//    #IFSAME !1 TO
  5269//    #ELSE
  5270//      #IFSAME !1 ITEM
  5271//      #ELSE
  5272//        #SET ZG$ !ZG
  5273//        #IFDEF !1
  5274//          #DPUSH !1
  5275//        #ELSE
  5276//          #IFCLASS !1 0123456789ABCDEF
  5277//            #DPUSH !1
  5278//          #ELSE
  5279//            #IFDEF MSG_!1
  5280//              #DPUSH MSG_!1
  5281//            #ELSE
  5282//              #DPUSH |CI0
  5283//              #FREF MSG_!1 !a,!Zg
  5284//            #ENDIF
  5285//          #ENDIF
  5286//        #ENDIF
  5287//      #ENDIF
  5288//    #ENDIF
  5289//    PROPERTY$HELP !2 !3 !4 !5 !6 !7 !8 !9
  5290//  #ENDIF
  5291//#ENDCOMMAND
  5292
  5293// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5294//
  5295//   Command:
  5296//  Send Message {OptionalArguments...} {TO Object} {OptionalArguments...}
  5297//
  5298//   Parameters:
  5299//
  5300//   Description:
  5301//
  5302// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5303
  5304// JJT-5.1
  5305//#COMMAND SEND RSD#OBLG
  5306//  #DATA
  5307//  #IFDEF !1
  5308//    #DPUSH !1
  5309//  #ELSE
  5310//    #IFDEF MSG_!1
  5311//      #DPUSH MSG_!1
  5312//    #ELSE
  5313//      #DPUSH |CI0
  5314//      #FREF MSG_!1 !a,0
  5315//    #ENDIF
  5316//  #ENDIF
  5317//  #IFSAME !2 TO
  5318//    SEND$HELP !4 !5 !6 !7 !8 !9
  5319//    SEND$CMD TO !2 !3
  5320//  #ELSE
  5321//    SEND$HELP !2 !3 !4 !5 !6 !7 !8 !9
  5322//    SEND$CMD TO TO CURRENT_OBJECT
  5323//  #ENDIF
  5324//#ENDCOMMAND
  5325
  5326// JJT-5.1
  5327//#COMMAND SEND$HELP U
  5328//  #IF (!0>0)
  5329//    #DPUSH !1
  5330//    SEND$HELP !2 !3 !4 !5 !6 !7 !8 !9
  5331//  #ENDIF
  5332//#ENDCOMMAND
  5333//
  5334//#COMMAND SEND$CMD
  5335//  #IFSAME !1 !2
  5336//    #IFDEF !3
  5337////      !A [] OBJ$SEND !3 |VL
  5338//      !A [] $044C !3 |VL
  5339//    #ELSE
  5340//      #IFDEF !3.OBJ
  5341//        !A [] OBJ$SEND !3.OBJ |VL
  5342//      #ELSE
  5343//        !A [] OBJ$SEND |CI0 |VL
  5344//        #FREF !3.OBJ !a
  5345//      #ENDIF
  5346//    #ENDIF
  5347//  #ELSE
  5348//    !A [] OBJ$SEND CURRENT_OBJECT |VL
  5349//  #ENDIF
  5350//#ENDCOMMAND
  5351
  5352// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5353//
  5354//   Command:
  5355//  Procedure {Set} Message {FOR Class} {{Type Argument} ...}
  5356//
  5357//   Parameters:
  5358//
  5359//   Description:
  5360//
  5361// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5362
  5363#COMMAND PROCEDURE R
  5364  #IFSAME !1 SET
  5365    HANDLE$MESSAGE SET_!2 !3 !4 !5 !6 !7 !8 !9
  5366  #ELSE
  5367    HANDLE$MESSAGE MSG_!1 !2 !3 !4 !5 !6 !7 !8 !9
  5368  #ENDIF
  5369#ENDCOMMAND
  5370
  5371// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5372//
  5373//   Command:
  5374//  Function Message {FOR Class} {Type Argument} RETURNS Type
  5375//
  5376//   Parameters:
  5377//
  5378//   Description:
  5379//
  5380// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5381
  5382// JJT-5.1
  5383//#COMMAND FUNCTION R
  5384//    HANDLE$MESSAGE GET_!1 !2 !3 !4 !5 !6 !7 !8 !9
  5385//#ENDCOMMAND
  5386
  5387
  5388// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5389//
  5390//   Command: HANDLE$MESSAGE Message { FOR Class } { RETURNS Type } { Type Argument }
  5391//
  5392//   Parameters:
  5393//
  5394//   Description:
  5395//
  5396// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5397
  5398// JJT-5.1
  5399//#COMMAND HANDLE$MESSAGE RGOBL#
  5400//  #IFDEF UI.EXISTS
  5401//  #ELSE
  5402//    USE UI
  5403//  #ENDIF
  5404//  #IF (!b & 4)
  5405//    #ERROR 100 Procedures and Functions may .not. be nested.
  5406//  #ENDIF
  5407//  #CHECK NUM_ARGUMENTS _T
  5408//  #PUSH !Zg
  5409//  #PUSH !Za
  5410//  #SET ZA$ !a
  5411//  #PUSH !Zu
  5412//  #DATA
  5413//  #STKSYM               // forget all old stack symbols
  5414//  #SET B$ (!b | 4)          // set flag to in_procedure
  5415//  #REPLACE NUM_ARGUMENTS |SI0       // define the arg count
  5416//  #IFSAME !2 GLOBAL
  5417//    #DPUSH |CI0         // No message
  5418//    #DPUSH |CI0         // for no class
  5419//    #CHECK !1 T         // cant have dups of these globals
  5420//    #SET ZG$ (0-!a-2)       // make it negative to distuinguish it
  5421//    #REPLACE !1 |CI!Zg      // this will cause all fwd refs to be fixed.
  5422//    #IF (!0>1)              // do we have arguments?
  5423//      #SET ZG$ 1                    // starting argument number
  5424//      DEFINE_ARGUMENTS !3 !4 !5 !6 !7 !8 !9
  5425//    #ENDIF
  5426//    #FREG !1 !2 !3 !4 !5 !6 !7 !8 !9
  5427//  #ELSE
  5428//    #IFSAME !2 FOR          // are we explict about the class?
  5429//      MESSAGE$ADDRESS !1            // create id symbol for this message
  5430//      #DPUSH !1
  5431//      #IFDEF !3
  5432//        #IFSAME !3 DESKTOP
  5433//          #DPUSH U_DESKTOP      // Message for the desktop class
  5434//        #ELSE
  5435//          #DPUSH !3         // Message for the named class
  5436//        #ENDIF
  5437//      #ELSE
  5438//        #CHECK U_!3 RSDNU           // check the class for goodness
  5439//        #DPUSH U_!3         // Message for the named class
  5440//      #ENDIF
  5441//      #IF (!0>3)
  5442//        #SET ZG$ 1                  // starting argument number
  5443//        DEFINE_ARGUMENTS !4 !5 !6 !7 !8 !9
  5444//      #ENDIF
  5445//      #FREG !1 !4 !5 !6 !7 !8 !9
  5446//    #ELSE
  5447//      #IF (!b & 2)              // obj_flag == in_class?
  5448//        MESSAGE$ADDRESS !1      // yes, same as handle "for"
  5449//        #DPUSH !1               // the message
  5450//        #DPUSH U_!$         // handle msg for "current class"
  5451//      #ELSE
  5452//        #IF (!b & 1)            // in_object, instance method
  5453//          !A [] CLONE$CLASS
  5454//          MESSAGE$ADDRESS !1        // yes, same as handle "for"
  5455//          #DPUSH !1         // the message
  5456//          #DPUSH |CI0           // handle for objects class
  5457//        #ELSE               // just your simple global message
  5458//          #DPUSH |CI0           // No message
  5459//          #DPUSH |CI0           // for no class
  5460//          #CHECK !1 T           // cant have dups of these globals
  5461//          #SET ZG$ (0-!a-2)     // make it negative to distuinguish it
  5462//          #REPLACE !1 |CI!Zg        // this will cause all fwd refs to be fixed.
  5463//        #ENDIF
  5464//      #ENDIF
  5465//      #IF (!0>1)                // do we have arguments?
  5466//        #SET ZG$ 1                  // starting argument number
  5467//        DEFINE_ARGUMENTS !2 !3 !4 !5 !6 !7 !8 !9
  5468//      #ENDIF
  5469//      #FREG !1 !2 !3 !4 !5 !6 !7 !8 !9
  5470//    #ENDIF
  5471//  #ENDIF
  5472////  !A [] HANDLE$FOR |CI0 |VL     // handle the message
  5473//  !A [] $0454 |CI0 |VL
  5474//  #FREF OBJ$!Za$ENDPROC !a      // fref the end procedure line
  5475//  #SET ZG$ 0                    // starting argument number for locals
  5476//#ENDCOMMAND
  5477
  5478#COMMAND MESSAGE$ADDRESS
  5479  #IFDEF !1
  5480  #ELSE             // assign the next message number now
  5481    #SET ZC$ !ZC
  5482//    #IF (!Zc>$0FFF)
  5483    #IF (!Zc>$0FFFFFFF) // using 32-bit msg ids now (256M total allowed)
  5484      #ERROR 100 Maximum number of message/property definitions exceeded
  5485    #ELSE
  5486      #REPLACE !1 |CI!Zc      // this will cause all fwd refs to be fixed.
  5487    #ENDIF
  5488  #ENDIF
  5489#ENDCOMMAND
  5490
  5491// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5492//
  5493//   Command:
  5494//  Register_Procedure Message {FOR Class} {{Type Argument} ...}
  5495//
  5496//   Parameters:
  5497//
  5498//   Description:
  5499//
  5500// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5501
  5502#COMMAND REGISTER_PROCEDURE R
  5503  #IFDEF UI.EXISTS
  5504  #ELSE
  5505    USE UI
  5506  #ENDIF
  5507  #IFSAME !2 GLOBAL
  5508    #ERROR 101 GLOBAL PROCEDURES CANNOT BE REGISTERED
  5509  #ELSE
  5510    #IFSAME !1 SET
  5511      MESSAGE$ADDRESS SET_!2
  5512    #ELSE
  5513      MESSAGE$ADDRESS MSG_!1
  5514    #ENDIF
  5515  #ENDIF
  5516#ENDCOMMAND
  5517
  5518// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5519//
  5520//   Command:
  5521//  Register_Function Message {FOR Class} {{Type Argument} ...} RETURNS Type
  5522//
  5523//   Parameters:
  5524//
  5525//   Description:
  5526//
  5527// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5528
  5529// JJT-5.1
  5530//#COMMAND REGISTER_FUNCTION R
  5531//  #IFDEF UI.EXISTS
  5532//  #ELSE
  5533//    USE UI
  5534//  #ENDIF
  5535//  #IFSAME !1 GLOBAL
  5536//    #ERROR 101 GLOBAL FUNCTIONS CANNOT BE REGISTERED
  5537//  #ELSE
  5538//    MESSAGE$ADDRESS GET_!1
  5539//    #IFSAME !2 FOR
  5540//      #FREG GET_!1 !4 !5 !6 !7 !8 !9
  5541//    #ELSE
  5542//      #FREG GET_!1 !2 !3 !4 !5 !6 !7 !8 !9
  5543//    #ENDIF
  5544//  #ENDIF
  5545//#ENDCOMMAND
  5546
  5547#COMMAND DEFINE_ARGUMENTS
  5548  #IF (!0>0)
  5549    #IFSAME !1 STRING
  5550      #REPLACE !2 |SS-!ZG
  5551    #ELSE
  5552      #IFSAME !1 NUMBER
  5553        #REPLACE !2 |SN-!ZG
  5554      #ELSE
  5555        #IFSAME !1 INTEGER
  5556          #REPLACE !2 |SI-!ZG
  5557        #ELSE
  5558          #IFSAME !1 DATE
  5559            #REPLACE !2 |SD-!ZG
  5560          #ELSE
  5561            #IFDEF SUPPORT$ADDRESS
  5562              #IFSAME !1 REAL
  5563                #REPLACE !2 |SR-!ZG
  5564              #ELSE
  5565                #IFSAME !1 ADDRESS
  5566                  #REPLACE !2 |SX-!ZG
  5567                #ENDIF
  5568              #ENDIF
  5569            #ELSE
  5570              #IFSAME !1 REAL
  5571                #REPLACE !2 |SR-!ZG
  5572              #ENDIF
  5573            #ENDIF
  5574          #ENDIF
  5575        #ENDIF
  5576      #ENDIF
  5577    #ENDIF
  5578    DEFINE_ARGUMENTS !3 !4 !5 !6 !7 !8 !9
  5579  #ENDIF
  5580#ENDCOMMAND
  5581
  5582// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5583//
  5584//   Command:
  5585//  END_PROCEDURE
  5586//
  5587//   Parameters:
  5588//  None.
  5589//
  5590//   Description:
  5591//
  5592// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5593
  5594// JJT-5.1
  5595//#COMMAND END_PROCEDURE .
  5596//  #SET B$ (!b & 3)       // reset flag to in_procedure
  5597//  #POP U$
  5598//  #REPLACE OBJ$!Za$LNUM |CI!Zg     // Update the count in the local cmd.
  5599////  !A [] OBJ$END$HANDLER |CI0
  5600//  !A [] $0455 |CI0
  5601//  #REPLACE OBJ$!Za$ENDPROC !a
  5602//  #POP U$
  5603//  #POP ZG$
  5604//  #STKSYM
  5605//#ENDCOMMAND
  5606
  5607// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5608//
  5609//   Command:
  5610//  FUNCTION_RETURN {OptionalReturnValue}
  5611//
  5612//   Parameters:
  5613//      Return value may be a variable or constant of any type, including
  5614//      the literals TRUE or FALSE.
  5615//
  5616//   Description:
  5617//
  5618// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5619
  5620// JJT-5.1
  5621//#COMMAND FUNCTION_RETURN GO .
  5622//  #IF (!0 > 0)
  5623//    #IFSAME !1 $0
  5624////      !A [] OBJ$HRET |CI0
  5625//      !A [] $0450 |CI0
  5626//    #ELSE
  5627//      #IFSAME !1 $1
  5628////        !A [] OBJ$HRET |CI1
  5629//        !A [] $0450 |CI1
  5630//      #ELSE
  5631//        #CHECK !1 U
  5632////        !A [] OBJ$HRET !1
  5633//        !A [] $0450 !1
  5634//      #ENDIF
  5635//    #ENDIF
  5636//  #ELSE
  5637////    !A [] OBJ$HRET |CI0
  5638//    !A [] $0450 |CI0
  5639//  #ENDIF
  5640//#ENDCOMMAND
  5641
  5642// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5643//
  5644//   Command:
  5645//  LOCAL {STRING | NUMBER | DATE | INTEGER | REAL} LocalName {...}
  5646//
  5647//   Parameters:
  5648//
  5649//   Description:
  5650//
  5651// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5652
  5653// JJT-5.1
  5654//#COMMAND LOCAL T T
  5655//  #IF (!0>0)
  5656//    #CHECK !1 '"STRING""NUMBER""DATE""INTEGER""REAL"'
  5657//    #CHECK !2 RT
  5658//    #IFDEF NUM_ARGUMENTS
  5659//      #IF (!Zg = 0)
  5660////        !A [] LOCAL$ARGUMENT |CI0  // Create the command to save the local count,
  5661//        !A [] $0456 |CI0
  5662//        #FREF OBJ$!Za$LNUM !a       // and tell flex to update it later.
  5663//      #ENDIF
  5664//      #IFSAME !1 STRING
  5665//        #REPLACE !2 |SS!ZG
  5666//      #ELSE
  5667//        #IFSAME !1 NUMBER
  5668//          #REPLACE !2 |SN!ZG
  5669//        #ELSE
  5670//          #IFSAME !1 DATE
  5671//            #REPLACE !2 |SD!ZG
  5672//          #ELSE
  5673//            #IFSAME !1 INTEGER
  5674//              #REPLACE !2 |SI!ZG
  5675//            #ELSE
  5676//              #IFSAME !1 REAL
  5677//                #REPLACE !2 |SR!ZG
  5678//              #ENDIF
  5679//            #ENDIF
  5680//          #ENDIF
  5681//        #ENDIF
  5682//      #ENDIF
  5683//    #ELSE
  5684//      !1 !2
  5685//    #ENDIF
  5686//    #IF (!0>2)
  5687//      LOCAL !1 !3 !4 !5 !6 !7 !8 !9
  5688//    #ENDIF
  5689//  #ENDIF
  5690//#ENDCOMMAND
  5691
  5692// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5693//
  5694//   Command:
  5695//  Class New_Class IS A|AN Old_Class {STARTMAC StartMacro} {ENDMAC EndMacro}
  5696//        {FgColor BgColor {HandlerName}}
  5697//
  5698//   Parameters:
  5699//
  5700//   Description:
  5701//
  5702// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5703
  5704// JJT-5.1
  5705//#COMMAND CLASS _RCDNSO "IS" "A""AN" _RDNO //_UGBO#L _UGBO#L _GBO#L .
  5706//  #CHECK U_!4 _U                      // does class exist?
  5707//  #REPLACE !1$SC !4                   //define superclass of new class
  5708//  #IFSAME !5 STARTMAC                 //if start macro specified,
  5709//    #REPLACE !1$SM !6                 //remember its name
  5710//    #IFSAME !7 ENDMAC                 //if end macro specified,
  5711//      #REPLACE !1$EM !8               //remember it
  5712//      BASE_CREATE_CLASS !1 !2 !3 !4 !9
  5713//    #ELSE
  5714//      BASE_CREATE_CLASS !1 !2 !3 !4 !7 !8 !9
  5715//    #ENDIF
  5716//  #ELSE
  5717//    #IFSAME !5 ENDMAC                 //no STARTMAC - if ENDMAC specified,
  5718//      #REPLACE !1$EM !6               //remember it
  5719//      BASE_CREATE_CLASS !1 !2 !3 !4 !7 !8 !9
  5720//    #ELSE
  5721//      BASE_CREATE_CLASS !1 !2 !3 !4 !5 !6 !7 !8 !9
  5722//    #ENDIF
  5723//  #ENDIF
  5724//#ENDCOMMAND
  5725
  5726// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5727//
  5728//   Command:
  5729// BASE_CREATE_CLASS New_Class IS A|AN Old_Class {FgColor BgColor {HandlerName}}
  5730//
  5731//   Parameters:
  5732//
  5733//   Description:
  5734//
  5735// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5736
  5737// JJT-5.1
  5738//#COMMAND BASE_CREATE_CLASS _RCDNSO "IS" "A""AN" _RDNO _UGBO#L _UGBO#L _GBO#L .
  5739//  #PUSH !b              // save obj_flag
  5740//  #PUSH !Zb             // save current_dep
  5741//  #PUSH !Zf             // save the super_class_count
  5742//  #SET B$ (!b | 2)          // set flag to in_class
  5743//  #SET ZB$ 0                // based on atomic class object
  5744//  #IF ( (!b & 1) = 0 )          // are we NOT in a create_object?
  5745//    #IFDEF !4.AGG               // bump dep number by already
  5746//      #SET ZB$ !4.AGG           // defined sub objects
  5747//    #ENDIF
  5748//  #ENDIF
  5749//  #SET ZF$ !Zb              // save the super_class_count
  5750//  #PUSH !Zi             // save current sub object count
  5751//  #SET ZI$ 0                // and init for new class
  5752
  5753//  #PUSH !x                  // save old property index
  5754//  #SET X$ 0                 //init to first array index# (0)
  5755
  5756//  #SPUSH !$             // save the old class name
  5757//  #SET $$ !1                // retain the name of the class
  5758//  #IFDEF U_!1               // if the new class id has already
  5759//  #ELSE                 // been defined, dont bother
  5760//    INTEGER U_!1            // else put it into a int of that name
  5761//  #ENDIF
  5762//  #DATA                 // wind up the stream
  5763//  #IFDEF !4
  5764//    #DPUSH !4
  5765//  #ELSE
  5766//    #DPUSH U_!4             // based upon
  5767//  #ENDIF
  5768//  #IF (!0<5)
  5769//    #DPUSH |CI0             // no colors defined, use default
  5770//  #ELSE
  5771//    #DPUSH !5               // else do what they say
  5772//  #ENDIF
  5773//  #IF (!0<6)
  5774//    #DPUSH |CI0             // no colors defined, use default
  5775//  #ELSE
  5776//    #DPUSH !6               // else do what they say
  5777//  #ENDIF
  5778//  #IF (!0=7)                // if parameter used, this will be
  5779//    #DPUSH |CS"!7"          // the name of a 'C' function.
  5780//  #ELSE
  5781//    #DPUSH |CS""            // else inherit one from the parent
  5782//  #ENDIF
  5783//  !A [] CREATE$CLASS U_!1 |VL       // let 'er rip
  5784//#ENDCOMMAND
  5785
  5786// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5787//
  5788//   Command:
  5789//  END_CLASS
  5790//
  5791//   Parameters:
  5792//  None.
  5793//
  5794//   Description:
  5795//
  5796// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5797
  5798// JJT-5.1
  5799//#COMMAND END_CLASS .
  5800//  #SET ZI$ (!Zi+!Zf)                //subobject count = self + superclass
  5801//  #REPLACE !$.AGG |CI!Zi        //define subobject count
  5802//  !A [] END$CLASS U_!$ |CI!Zi
  5803
  5804//  #SPOP                 // restore the old class name
  5805//  #POP X$                   // reset the property index
  5806//  #POP ZI$                      // reset old sub_object_count
  5807//  #POP ZF$                      // reset super_class_count
  5808//  #POP ZB$              // reset current_dep
  5809//  #POP B$                   // reset obj_flag
  5810//#ENDCOMMAND
  5811
  5812// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5813//
  5814//   Command:
  5815//  PROPERTY Type Name PRIVATE | PUBLIC {InitialValue}
  5816//
  5817//   Parameters:
  5818//      Type is a primitive DataFlex variable type, i.e. Integer, String...
  5819//      Name is the local name of the property
  5820//      PRIVATE indicates that no access handlers should be built
  5821//      PUBLIC indicates that access/set handlers should be built (default)
  5822//  InitialValue is the value the property is to have on creation
  5823//
  5824//   Description:
  5825//      PROPERTY declares an attribute of a class, and optionally provides
  5826//      get and set handlers to manipulate its value.  The class receiving
  5827//      the property is assumed to have defined an array-object named
  5828//      Attributes; properties will be stored in the Attributes array in the
  5829//      order in which they are declared.
  5830//
  5831// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5832
  5833// JJT-5.1
  5834//#COMMAND PROPERTY R R """PRIVATE""PUBLIC" UGO .
  5835//  #IFSAME !3 PRIVATE
  5836//    PROPERTY !1 !$.!2 PUBLIC !4
  5837//  #ELSE
  5838//    #IF (!b & 1)        // in_object, instance method
  5839//      !A [] CLONE$CLASS     // Create a new class
  5840//    #ENDIF
  5841//    #DATA           // Start the property
  5842//    MESSAGE$ADDRESS GET_!2
  5843//    #DPUSH GET_!2       // Push the get property id
  5844//    #FREG GET_!2 RETURNS !1
  5845//    MESSAGE$ADDRESS SET_!2
  5846//    #DPUSH SET_!2       // Push the set property id
  5847//    #DTYPE Q$ !1        // get the property type in q
  5848//    #DPUSH |CI!q        // push the type
  5849//    #IF (!0 > 3)
  5850//      #DPUSH !4
  5851//    #ELSE                // 10/30/1997: If no default param is passed force
  5852//      #IFSAME !1 STRING  // a default value. String types require
  5853//        #DPUSH |CS''     // a string, all others are numeric. This
  5854//      #ELSE              // fixes a problem in the runtime where
  5855//        #DPUSH |CI0      // dates and numbers did not initialize properly
  5856//      #ENDIF             // when no initial param was passed in the command
  5857//    #ENDIF
  5858//    !A [] CREATE$PROPERTY |CI0 |VL
  5859//  #ENDIF
  5860//#ENDCOMMAND
  5861
  5862// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5863//
  5864//   Command:
  5865//  CALL RoutineName {Parameters ...}
  5866//
  5867//   Parameters:
  5868//
  5869//   Description:
  5870//
  5871// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5872
  5873#COMMAND CALL RGBO#L
  5874  SEND !1 TO DESKTOP !2 !3 !4 !5 !6 !7 !8 !9
  5875#ENDCOMMAND
  5876
  5877// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5878//
  5879//   Command:
  5880//  SUB_PAGE NewPage FROM FromPage ;
  5881//      { (WindowNumber) | ;
  5882//      ({VERTICAL|HORIZONTAL} FromWindow ForWindows) | ;
  5883//      (RECTANGULAR FromWindow NumColumns NumRows) } {...}
  5884//
  5885//   Parameters:
  5886//
  5887//   Description:
  5888//
  5889// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5890
  5891#COMMAND SUB_PAGE RT "FROM" RGBO#L
  5892  #PUSH !Zg             // h is the number of windows on
  5893  #SET ZG$ 0                // the sub page.
  5894  #DATA                 // start up the arguments
  5895  #IFDEF !3
  5896    #DPUSH !3               // based on variable page number
  5897  #ELSE
  5898    #CHECK !3.N U
  5899    #DPUSH !3.N             // based on absolute page number
  5900  #ENDIF
  5901  SUB$IMAGE$DEFINE !4 !5 !6 !7 !8 !9    // loop thru the passed arguments
  5902  #DPUSH |CI!Zg             // store the number of windows
  5903  #IFDEF !1.N
  5904    #IFCLASS !1.N "C"
  5905      #ERROR 102 SUB_PAGE !1 ALREADY DEFINED AS A PHYSICAL IMAGE
  5906    #ELSE
  5907      !A [] REDEFINE$SUB$PAGE !1.N |VL    // create the sub image
  5908    #ENDIF
  5909  #ELSE
  5910    INTEGER !1.N            // create a int to place page # into
  5911    !A [] CREATE$SUB$PAGE !1.N |VL  // create the sub image
  5912  #ENDIF
  5913  #POP ZG$              // restore our general counter
  5914#ENDCOMMAND
  5915
  5916#COMMAND SUB$IMAGE$DEFINE
  5917  #IF (!0>0)
  5918    #IFSAME !1 VERTICAL         // define a vertical set of windows
  5919        #DPUSH |CI-1          // vertical flag
  5920        #DPUSH !2             // push the start window number
  5921        #DPUSH !3             // and the number of windows
  5922        #SET ZG$ (!Zg+!3)         // how many was that?
  5923        SUB$IMAGE$DEFINE !4 !5 !6 !7 !8 !9    // one more time
  5924    #ENDIF
  5925    #IFSAME !1 HORIZONTAL     // horzontal (contiguous) windows
  5926        #DPUSH |CI-2            // horizontal flag
  5927        #DPUSH !2           // push the start window number
  5928        #DPUSH !3           // and the number of windows
  5929        #SET ZG$ (!Zg+!3)           // how many was that?
  5930        SUB$IMAGE$DEFINE !4 !5 !6 !7 !8 !9  // one more time
  5931    #ENDIF
  5932    #IFSAME !1 RECTANGULAR      // a rectangular array of windows
  5933        #DPUSH |CI-3          // the rect. flag
  5934        #DPUSH !2         // push the start window number
  5935        #DPUSH !3         // number of windows per row
  5936        #DPUSH !4         // number of rows
  5937        #SET ZG$ (!Zg+(!3*!4))        // not bad huh
  5938        SUB$IMAGE$DEFINE !5 !6 !7 !8 !9   // and again
  5939    #ENDIF
  5940    #IFSAME !1 VERTICAL RECTANGULAR HORIZONTAL // May look strange, but reduces
  5941    #ELSE                                      // use of #if stack levels.
  5942        #DPUSH !1         // its just a single window def
  5943        #SET ZG$ !ZG          // just add one
  5944        SUB$IMAGE$DEFINE !2 !3 !4 !5 !6 !7 !8 !9  // recurse
  5945    #ENDIF
  5946  #ENDIF
  5947#ENDCOMMAND
  5948
  5949// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5950//
  5951//   Command:
  5952//
  5953//   Parameters:
  5954//
  5955//   Description:
  5956//
  5957// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5958
  5959#COMMAND MOVE_SUB_PAGE _RDOBR "TO" _RDOBRU
  5960  #IFDEF !1
  5961    !A [] MOVE$SUB$PAGE !1 !3
  5962  #ELSE
  5963    #CHECK !1.N U
  5964    !A [] MOVE$SUB$PAGE !1.N !3
  5965  #ENDIF
  5966#ENDCOMMAND
  5967
  5968// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5969//
  5970//   Command:
  5971//  USE PackageName | UI
  5972//
  5973//   Parameters:
  5974//
  5975//   Description:
  5976//
  5977// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5978
  5979#COMMAND USE R
  5980  #IFSAME !1 UI
  5981    #IFSUB '!1.EXISTS'
  5982    #ELSE
  5983      #REPLACE !1.EXISTS |CI!a
  5984      INITIALIZE_INTERFACE
  5985    #ENDIF
  5986  #ELSE
  5987    #USE !1
  5988  #ENDIF
  5989#ENDCOMMAND
  5990
  5991// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5992//
  5993//   Command:
  5994//
  5995//   Parameters:
  5996//
  5997//   Description:
  5998//
  5999// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6000
  6001#COMMAND VFIND R R R .
  6002  MOVE !2 TO INDEX_NUMBER
  6003  #IFSAME !3 $0 $1 $2 $3 $4
  6004    #SET Q$ !3
  6005    !A [] $CC !1 |CI!q
  6006  #ELSE
  6007    !A [] $CC !1 !3
  6008  #ENDIF
  6009#ENDCOMMAND
  6010
  6011// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6012//
  6013//   Command:
  6014//
  6015//   Parameters:
  6016//
  6017//   Description:
  6018//
  6019// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6020
  6021#COMMAND SCREEN_OPTIMIZE RL .
  6022  #IFSAME !1 $0 $1
  6023    #PUSH !Zg
  6024    #SET ZG$ !1
  6025    !A [] SCREEN$OPT |CI!Zg
  6026    #POP ZG$
  6027  #ELSE
  6028    !A [] SCREEN$OPT !1
  6029  #ENDIF
  6030#ENDCOMMAND
  6031
  6032// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6033//
  6034//   Command:
  6035//     FORWARD_BEGIN_CONSTRUCT ClassName { <argument> ... }
  6036//
  6037//   Parameters:
  6038//     ClassName is the name of the class which owns the macro that is
  6039//         forwarding.
  6040//     <argument> is any argument required
  6041//
  6042//   Description:
  6043//     This command allows the instance-creation macros defined for classes
  6044//     to 'inherit' the instance-creation macro(s) defined by their
  6045//     superclass(es).
  6046//
  6047// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6048
  6049#COMMAND FORWARD_BEGIN_CONSTRUCT R //<currentClassName> { <arg> ... }
  6050  #IFSUB '!1$SC' // if flex-defined class
  6051    #SPUSH !$
  6052    #SET $$ !1$SC  //get superclass name
  6053    #IFSUB '!$$SM' //if class defines start macro
  6054      !$$SM !$ !2 !3 !4 !5 !6 !7 !8 !9   //invoke it
  6055    #ELSE          //else not defined
  6056      FORWARD_BEGIN_CONSTRUCT !$ !2 !3 !4 !5 !6 !7 !8 !9
  6057    #ENDIF
  6058    #SPOP
  6059  #ELSE
  6060    ADD$IMAGE$ARGS MSG_CONSTRUCT_OBJECT !2 !3 !4 !5 !6 !7 !8 !9  //use default
  6061  #ENDIF
  6062#ENDCOMMAND
  6063
  6064// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6065//
  6066//   Command:
  6067//     FORWARD_END_CONSTRUCT ClassName { <argument> ... }
  6068//
  6069//   Parameters:
  6070//     ClassName is the name of the class which owns the macro that is
  6071//       forwarding.
  6072//     <argument> is any argument required
  6073//
  6074//   Description:
  6075//     This command allows the instance-ending macros defined for classes
  6076//     to 'inherit' the instance-ending macro(s) defined by their
  6077//     superclass(es).
  6078//
  6079// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6080
  6081#COMMAND FORWARD_END_CONSTRUCT R //<currentClassName> { <arg> ... }
  6082  #IFSUB '!1$SC' // if flex-defined class
  6083    #SPUSH !$
  6084    #SET $$ !1$SC  //get superclass name
  6085    #IFSUB '!$$EM' //if end-instance macro defined,
  6086      !$$EM !$ !2 !3 !4 !5 !6 !7 !8 !9  //use it
  6087    #ELSE
  6088      FORWARD_END_CONSTRUCT !$ !2 !3 !4 !5 !6 !7 !8 !9
  6089    #ENDIF
  6090    #SPOP
  6091  #ELSE
  6092    DEFAULT_END_OBJECT  //else use default
  6093  #ENDIF
  6094#ENDCOMMAND
  6095
  6096#COMMAND SET_DEFERRED &R .
  6097  !A [] $460 !1
  6098#ENDCOMMAND
  6099
  6100// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6101//
  6102//   Command:
  6103//     NAME_ITEM <object_name> item names...
  6104//
  6105//   Description:
  6106//      Gives names to items of objects in the form: object.item
  6107//      Assumes item number has already been set.
  6108//
  6109// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6110#COMMAND NAME_ITEM RT#L R
  6111  #IFDEF !2
  6112    #CHECK !2 #LUVFEWNSG
  6113    #SET Q$ !2
  6114    NAME_ITEM !1 !3 !4 !5 !6 !7 !8 !9
  6115  #ELSE
  6116    #IFSAME !2 ITEM
  6117      NAME_ITEM !1 !3 !4 !5 !6 !7 !8 !9
  6118    #ELSE
  6119      #IFSAME !2 COLUMN
  6120        NAME_COLUMN !1 !3 !4 !5 !6 !7 !8 !9
  6121      #ELSE
  6122        #IFSAME !2 PROPERTY
  6123          NAME_PROPERTY !1 !3 !4 !5 !6 !7 !8 !9
  6124        #ELSE
  6125          #REPLACE !1.!2 !1.OBJ ITEM !q
  6126          #SET Q$ (!q+1)
  6127          #IF !0>2
  6128              NAME_ITEM !1 !3 !4 !5 !6 !7 !8 !9
  6129          #ENDIF
  6130        #ENDIF
  6131      #ENDIF
  6132    #ENDIF
  6133  #ENDIF
  6134#ENDCOMMAND
  6135
  6136// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6137//
  6138//   Command:
  6139//     NAME_COLUMN <object_name> item names...
  6140//
  6141//   Description:
  6142//      Gives names to items of objects in the form: object.item
  6143//      Just like name_item except item numbers are relative to
  6144//      base_item.
  6145//      Assumes item number has already been set.
  6146//
  6147// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6148#COMMAND NAME_COLUMN RT#L R
  6149  #IFDEF !2
  6150    #CHECK !2 #LUVFEWNSG
  6151    #SET Q$ !2
  6152    NAME_COLUMN !1 !3 !4 !5 !6 !7 !8 !9
  6153  #ELSE
  6154    #IFSAME !2 ITEM
  6155      NAME_ITEM !1 !3 !4 !5 !6 !7 !8 !9
  6156    #ELSE
  6157      #IFSAME !2 COLUMN
  6158        NAME_COLUMN !1 !3 !4 !5 !6 !7 !8 !9
  6159      #ELSE
  6160        #IFSAME !2 PROPERTY
  6161          NAME_PROPERTY !1 !3 !4 !5 !6 !7 !8 !9
  6162        #ELSE
  6163          #REPLACE !1.!2 !1.OBJ ITEM (BASE_ITEM(!1.OBJ)+!q)
  6164          #SET Q$ (!q+1)
  6165          #IF !0>2
  6166            NAME_COLUMN !1 !3 !4 !5 !6 !7 !8 !9
  6167          #ENDIF
  6168        #ENDIF
  6169      #ENDIF
  6170    #ENDIF
  6171  #ENDIF
  6172#ENDCOMMAND
  6173
  6174
  6175// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6176//
  6177//   Command:
  6178//     NAME_PROPERTY <object_name> property names...
  6179//
  6180//   Description:
  6181//      Gives names to property of objects in the form: object.item
  6182//
  6183// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6184
  6185#COMMAND NAME_PROPERTY RT#L RT
  6186  #IFSAME !2 ITEM
  6187    NAME_ITEM !1 !3 !4 !5 !6 !7 !8 !9
  6188  #ELSE
  6189    #IFSAME !2 COLUMN
  6190      NAME_COLUMN !1 !3 !4 !5 !6 !7 !8 !9
  6191    #ELSE
  6192      #IFSAME !2 PROPERTY
  6193        NAME_PROPERTY !1 !3 !4 !5 !6 !7 !8 !9
  6194      #ELSE
  6195        #REPLACE !1.!2 (!2(!1.OBJ))
  6196        #IF !0>2
  6197          NAME_PROPERTY !1 !3 !4 !5 !6 !7 !8 !9
  6198        #ENDIF
  6199      #ENDIF
  6200    #ENDIF
  6201  #ENDIF
  6202#ENDCOMMAND
  6203
  6204
  6205// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6206//
  6207//   Command:
  6208//     NAME_OBJECT <object_name> ACCESS item names...
  6209//          ACCESS = CHILD, GLOBAL, COLUMN, PROPERTY, ITEM or ACCESS METHOD.
  6210//
  6211//   Description:
  6212//      Gives names to objects in the form: object.obj
  6213//      and allows items, properties and COLUMNs to be defined.
  6214//      Inits item number to zero and assumes item names follow.
  6215//
  6216// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6217
  6218#COMMAND NAME_OBJECT RT#L R
  6219  #SET Q$ 0
  6220  #IFDEF !2
  6221    #CHECK !2 R#LSD
  6222    #REPLACE !1.OBJ !2
  6223    #IF !0>2
  6224      NAME_ITEM !1 !3 !4 !5 !6 !7 !8 !9
  6225    #ENDIF
  6226  #ELSE
  6227//    #CHECK !2 "CHILD""ITEM""GLOBAL""COLUMN""PROPERTY"
  6228    #IFSAME !2 CHILD
  6229      REGISTER_OBJECT !1
  6230      #IFDEF !3
  6231        NAME_OBJECT !1 (!1(!3))  !4 !5 !6 !7 !8 !9
  6232      #ELSE
  6233        #CHECK !3.OBJ #LU
  6234        NAME_OBJECT !1 (!1(!3.OBJ))  !4 !5 !6 !7 !8 !9
  6235      #ENDIF
  6236    #ELSE
  6237      #IFSAME !2 GLOBAL
  6238        #IFDEF !1.OBJ
  6239          #CHECK !1.OBJ NSDFW#L
  6240        #ELSE
  6241          INTEGER !1.OBJ
  6242        #ENDIF
  6243        #IFCLASS !1.OBJ V$
  6244          #IF (!b & 1)
  6245            MOVE CURRENT_OBJECT TO !1.OBJ
  6246          #ELSE
  6247            #IF (!b)
  6248              #ERROR 100 NAME_OBJECT MUST PRECEDE CLASS OR PROCEDURE
  6249            #ELSE
  6250              MOVE 1023 TO !1.OBJ
  6251            #ENDIF
  6252          #ENDIF
  6253        #ENDIF
  6254        #IF !0>2
  6255          NAME_ITEM !1 !3 !4 !5 !6 !7 !8 !9
  6256        #ENDIF
  6257      #ELSE
  6258        NAME_!2 !1 !3 !4 !5 !6 !7 !8 !9
  6259      #ENDIF
  6260    #ENDIF
  6261  #ENDIF
  6262#ENDCOMMAND
  6263
  6264#COMMAND ITEM_GROUP .
  6265  #PUSH !Zd
  6266  #PUSH !Ze
  6267  #SET ZD$ 0
  6268  !A [] $462 |CI0        //create new item group; size is fwd-ref'd
  6269  #SET ZE$ !a
  6270  #FREF ITEM$GROUP!Ze !a
  6271#ENDCOMMAND
  6272
  6273#COMMAND END_ITEM_GROUP .
  6274  #REPLACE ITEM$GROUP!Ze |CI!Zd  //define size of item group
  6275  #POP ZE$
  6276  #POP ZD$
  6277#ENDCOMMAND
  6278
  6279#COMMAND DEPENDENT_ITEM R
  6280  #IFSAME !2 ITEM    //if ITEM is second arg, item name replacement was used
  6281    #IFDEF !1
  6282      !A [] $463 !1 !3 //add obj#,item# pair to current item group
  6283    #ELSE
  6284      !A [] $463 !1.OBJ !3 //add obj#,item# pair to current item group
  6285    #ENDIF
  6286    #SET ZD$ !ZD         //increment element counter
  6287    #IF (!0>3)
  6288      DEPENDENT_ITEM !4 !5 !6 !7 !8 !9
  6289    #ENDIF
  6290  #ELSE
  6291    #IFDEF !1
  6292      !A [] $463 !1 !2 //add obj#,item# pair to current item group
  6293    #ELSE
  6294      !A [] $463 !1.OBJ !2 //add obj#,item# pair to current item group
  6295    #ENDIF
  6296    #SET ZD$ !ZD         //increment element counter
  6297    #IF (!0>2)
  6298      DEPENDENT_ITEM !3 !4 !5 !6 !7 !8 !9
  6299    #ENDIF
  6300  #ENDIF
  6301#ENDCOMMAND
  6302
  6303
  6304// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6305//
  6306//   Command:
  6307//  IMPORT_CLASS_PROTOCOL Source Dest {Msg | ALL} {Flag}
  6308//
  6309//   Description:
  6310//  This command will copy the message definitions of the Source
  6311//  class to the Dest class.  The program may choose to copy ALL
  6312//  of the messages or only one of the messages from the Source.
  6313//  The program has the option to stop any message that would overwrite
  6314//  and to stop the copying of messages not directly defined in the
  6315//  Source class.
  6316//
  6317// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6318
  6319#COMMAND IMPORT_CLASS_PROTOCOL _RSNDLOB# _SNDLOB#
  6320  #IF (!0<2)
  6321    IMPORT_CLASS_PROTOCOL !1 CURRENT_CLASS
  6322  #ELSE
  6323    #DATA       // Begining of data
  6324    #IFDEF !1       // class is variable (integer) or constant
  6325      #DPUSH !1     // defined_in
  6326    #ELSE
  6327      #IFDEF U_!1
  6328        #DPUSH U_!1   // class is normal symbol type (integer)
  6329      #ELSE
  6330        #ERROR 111 UNDEFINED SYMBOL U_!1 IN ARGUMENT
  6331      #ENDIF
  6332    #ENDIF
  6333    #IFDEF !2       // is the destination defined?
  6334      #DPUSH !2     // add to class
  6335    #ELSE
  6336      #IFSAME !2 CURRENT_CLASS  // use this symbol for "current class"
  6337        #DPUSH U_!$     // cc is in this symbol (set by class)
  6338      #ELSE
  6339        #IFDEF U_!2
  6340          #DPUSH U_!2     // another standard class id
  6341        #ELSE
  6342          #ERROR 111 UNDEFINED SYMBOL U_!2 IN ARGUMENT
  6343        #ENDIF
  6344      #ENDIF
  6345    #ENDIF
  6346    #IF (!0>2)      // message or all specified
  6347      #IFSAME !3 ALL    // copy all messages
  6348        #DPUSH |CI0 // 0 is all
  6349      #ELSE
  6350        #IFDEF !3
  6351          #DPUSH !3 // message name, note full name required
  6352        #ELSE
  6353          #IFDEF MSG_!3
  6354            #DPUSH MSG_!3
  6355          #ELSE
  6356            #IFDEF SET_!3
  6357              #DPUSH SET_!3
  6358            #ELSE
  6359              #IFDEF GET_!3
  6360                #DPUSH GET_!3
  6361              #ELSE
  6362                #ERROR 111 UNDEFINED SYMBOL !3 IN ARGUMENT
  6363              #ENDIF
  6364            #ENDIF
  6365          #ENDIF
  6366        #ENDIF
  6367      #ENDIF
  6368      #IF (!0>3)
  6369        #SET Q$ 0
  6370        CHAIN$HELP !4 !5    // NO_INHERIT and NO_OVERWRITE
  6371        #DPUSH |CI!q    // flags
  6372      #ELSE
  6373        #DPUSH |CI0 // no flags
  6374      #ENDIF
  6375    #ELSE
  6376      #DPUSH |CI0   // all messages
  6377      #DPUSH |CI0   // overwrite and superclasses
  6378    #ENDIF
  6379    !A [] $0465 |CI0 |VL
  6380  #ENDIF
  6381#ENDCOMMAND
  6382
  6383
  6384// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6385//
  6386//  Command:
  6387//      LOGOUT {Driver Name {Server Name}}
  6388//
  6389//  Description:
  6390//
  6391// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6392
  6393#COMMAND LOGOUT
  6394  !A [] $4c6 !1 !2
  6395#ENDCOMMAND
  6396
  6397// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6398//
  6399//  Command:
  6400//      SET_TRANSACTION_RETRY
  6401//
  6402//  Description:
  6403//
  6404// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6405
  6406#COMMAND SET_TRANSACTION_RETRY "TO" &#LGRBOUSD .
  6407  !A [] $4c8 !2
  6408#ENDCOMMAND
  6409
  6410
  6411// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6412//
  6413//  Command:
  6414//      GET_TRANSACTION_RETRY
  6415//
  6416//  Description:
  6417//
  6418// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6419
  6420#COMMAND GET_TRANSACTION_RETRY "TO" R .
  6421  !A [] $4c9 !2
  6422#ENDCOMMAND
  6423
  6424
  6425// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6426//
  6427//  Command:
  6428//      COPY_DB
  6429//
  6430//  Description:
  6431//
  6432// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6433
  6434#COMMAND COPY_DB RNDI#G_ "TO" RN_DI#G
  6435  COPY$DB$CALLBACK 0
  6436  COPY$DB$COMPRESSION DF_FILE_COMPRESS_NONE DFFALSE
  6437  #IF ( !0 > 3 )
  6438    #IF ( !0 > 5 )
  6439      #IFSAME !4 !6
  6440        #ERROR 105 PARAMETER DUPLICATION !4 !6
  6441      #ELSE
  6442        #IFSAME !6 COMPRESSION
  6443          COPY$DB$COMPRESSION !7 DFTRUE
  6444        #ELSE
  6445          #IFSAME !6 CALLBACK
  6446            COPY$DB$CALLBACK !7
  6447          #ELSE
  6448            #ERROR 105 INVALID PARAMETER !6
  6449          #ENDIF
  6450        #ENDIF
  6451      #ENDIF
  6452    #ENDIF
  6453    #IFSAME !4 COMPRESSION
  6454      COPY$DB$COMPRESSION !5 DFTRUE
  6455    #ELSE
  6456      #IFSAME !4 CALLBACK
  6457        COPY$DB$CALLBACK !5
  6458      #ELSE
  6459        #ERROR 105 INVALID PARAMETER !4
  6460      #ENDIF
  6461    #ENDIF
  6462  #ENDIF
  6463  !A [] $0e3 !1 !3
  6464#ENDCOMMAND
  6465
  6466#COMMAND COPY$DB$CALLBACK R .
  6467  !A [] $0e4 !1
  6468#ENDCOMMAND
  6469
  6470#COMMAND COPY$DB$COMPRESSION R R .
  6471  !A [] $0e5 !1 !2
  6472#ENDCOMMAND
  6473
  6474
  6475// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6476//
  6477//  Command:
  6478//      DECLARE_DATAFILE logicalFileName*n
  6479//
  6480//  Description:
  6481//      Include the .FD for the named file and define any related symbols,
  6482//      e.g., FILE.FILE_NUMBER
  6483//
  6484//  Parameter
  6485//      logicalFileName
  6486//          Base name of the .FD file, e.g., for PERSON.FD, it would be
  6487//          PERSON.
  6488//
  6489// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6490
  6491#COMMAND DECLARE_DATAFILE L#GT
  6492  #IF (!0>0)
  6493    #IFDEF !1.RECNUM
  6494      #IFDEF !1.FILE_NUMBER
  6495      #ELSE
  6496        #SET Q$ !1.RECNUM
  6497        #REPLACE !1.FILE_NUMBER |CI!q
  6498      #ENDIF
  6499    #ELSE
  6500      #INCLUDE !1.FD
  6501      #SET Q$ !1.RECNUM
  6502      #REPLACE !1.FILE_NUMBER |CI!q
  6503    #ENDIF
  6504    DECLARE_DATAFILE !2 !3 !4 !5 !6 !7 !8 !9
  6505  #ENDIF
  6506#ENDCOMMAND
  6507
  6508
  6509// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6510//
  6511//  Command:
  6512//      SET_FILE_FIELD fileNum fieldNum
  6513//      SET_FILE_INDEX fileNum indexNum
  6514//
  6515//  Description:
  6516//      Used by API commands requiring more than 2 parameters. Assigns
  6517//      the fileNum and field or index number. Two commands were provided
  6518//      to allow improve readability of code.
  6519//
  6520//  Parameters:
  6521//      fileNum:
  6522//          The number of the file.
  6523//      fieldNum:
  6524//      indexNum:
  6525//          The number of the field or index ( depending on the command.
  6526//
  6527// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6528
  6529#COMMAND SET_FILE_FIELD ULG# ULG# .
  6530    !A [] $502 !1 !2
  6531#ENDCOMMAND
  6532
  6533#COMMAND SET_FILE_INDEX ULG# ULG# .
  6534    !A [] $502 !1 !2
  6535#ENDCOMMAND
  6536
  6537
  6538// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6539//
  6540//  Command:
  6541//      SET_SEGMENT_MISC segmentNum miscNum
  6542//
  6543//  Description:
  6544//      Used by API commands requiring more than 2 parameters. Assigns
  6545//      the segmentNum and miscNum.
  6546//
  6547//  Parameters:
  6548//      segmentNum:
  6549//          The number of the segment of an index
  6550//      miscNum:
  6551//          A command dependent numeric value.
  6552//
  6553// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6554
  6555#COMMAND SET_SEGMENT_MISC ULG# ULG# .
  6556    !A [] $503 !1 !2
  6557#ENDCOMMAND
  6558
  6559
  6560// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6561//
  6562//  Command:
  6563//      SET_LENGTH_OFFSET length offset
  6564//
  6565//  Description:
  6566//      Used by API commands requiring additional length and offset
  6567//      parameters.
  6568//
  6569//  Parameters:
  6570//      length:
  6571//          Typically in bytes.
  6572//      offset:
  6573//          Typically in bytes.
  6574//
  6575// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6576
  6577#COMMAND SET_LENGTH_OFFSET ULG# ULG# .
  6578    !A [] $52E !1 !2
  6579#ENDCOMMAND
  6580
  6581
  6582// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6583//
  6584//  Command:
  6585//     GET_ATTRIBUTE attribute;
  6586//         {OF fileNum {fieldNum|(indexNum {segmentNum})} "TO" VARIABLE
  6587//
  6588//  Description:
  6589//     Get a global, file, field, or index attribute.
  6590//
  6591//  Parameters
  6592//      attribute
  6593//          Attribute id (as defined by API) to be set
  6594//      fileNum
  6595//          Optional handle for either a file or a structure
  6596//      fieldNum
  6597//          Optional field to be interrogated
  6598//      indexNum
  6599//          Optional index to be interrogated
  6600//      segmentNum
  6601//          Num of segment in index to be interrogated
  6602//
  6603// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6604
  6605#COMMAND GET_ATTRIBUTE RLGU#
  6606  #IFSAME !2 TO
  6607    #CHECK !3 RLGUC#
  6608    SET_FILE_FIELD |CI0 |CI0
  6609    SET_SEGMENT_MISC |CI0 |CI0
  6610    !A [] $501 !1 !3
  6611  #ELSE
  6612    #IFSAME !2 OF
  6613    #ELSE
  6614      #ERROR 779 Missing keyword "OF"
  6615    #ENDIF
  6616    #IFSAME !4 TO
  6617      #CHECK !3 RLGU#
  6618      #CHECK !5 RLGU#
  6619      SET_FILE_FIELD !3 |CI0
  6620      SET_SEGMENT_MISC |CI0 |CI0
  6621      !A [] $501 !1 !5
  6622    #ELSE
  6623      #IFSAME !5 TO
  6624        #CHECK !3 RLGU#
  6625        #CHECK !4 RLGU#
  6626        #CHECK !6 RCLGU#
  6627        SET_FILE_FIELD !3 !4
  6628        SET_SEGMENT_MISC |CI0 |CI0
  6629        !A [] $501 !1 !6
  6630      #ELSE
  6631        #IFSAME !6 TO
  6632          #CHECK !3 RLGU#
  6633          #CHECK !4 RLGU#
  6634          #CHECK !5 RLGU#
  6635          #CHECK !7 RCLGU#
  6636          SET_FILE_FIELD !3 !4
  6637          SET_SEGMENT_MISC !5 |CI0
  6638          !A [] $501 !1 !7
  6639        #ELSE
  6640          #ERROR 779 Missing keyword "TO"
  6641        #ENDIF
  6642      #ENDIF
  6643    #ENDIF
  6644  #ENDIF
  6645#ENDCOMMAND
  6646
  6647
  6648//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6649//
  6650//  Command:
  6651//     SET_ATTRIBUTE attribute;
  6652//         {OF fileNum {fieldNum|(indexNum {segmentNum})} "TO" VARIABLE
  6653//
  6654//  Description:
  6655//     Get a global, file, field, or index attribute.
  6656//
  6657//  Parameters
  6658//      attribute
  6659//          Attribute id (as defined by API) to be set
  6660//      fileNum
  6661//          Optional handle for either a file or a structure
  6662//      fieldNum
  6663//          Optional field to be modified
  6664//      indexNum
  6665//          Optional index to be modified
  6666//      segmentNum
  6667//          Num of segment in index to be modified
  6668//
  6669//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6670
  6671#COMMAND SET_ATTRIBUTE RLG#
  6672  #IFSAME !2 TO
  6673    #CHECK !3 RLGU#
  6674    SET_FILE_FIELD |CI0 |CI0
  6675    SET_SEGMENT_MISC |CI0 |CI0
  6676    !A [] $504 !1 !3
  6677  #ELSE
  6678    #IFSAME !2 OF
  6679    #ELSE
  6680      #ERROR 779 Missing keyword "OF"
  6681    #ENDIF
  6682    #IFSAME !4 TO
  6683      #CHECK !3 RLGU#
  6684      #CHECK !5 RLGU#
  6685      SET_FILE_FIELD !3 |CI0
  6686      SET_SEGMENT_MISC |CI0 |CI0
  6687      !A [] $504 !1 !5
  6688    #ELSE
  6689      #IFSAME !5 TO
  6690        #CHECK !3 RLGU#
  6691        #CHECK !4 RLGU#
  6692        #CHECK !6 RLGU#
  6693        SET_FILE_FIELD !3 !4
  6694        SET_SEGMENT_MISC |CI0 |CI0
  6695        !A [] $504 !1 !6
  6696      #ELSE
  6697        #IFSAME !6 TO
  6698          #CHECK !3 RLGU#
  6699          #CHECK !4 RLGU#
  6700          #CHECK !5 RLGU#
  6701          #CHECK !7 RLGU#
  6702          SET_FILE_FIELD !3 !4
  6703          SET_SEGMENT_MISC !5 |CI0
  6704          !A [] $504 !1 !7
  6705        #ELSE
  6706          #ERROR 779 Missing keyword "TO"
  6707        #ENDIF
  6708      #ENDIF
  6709    #ENDIF
  6710  #ENDIF
  6711#ENDCOMMAND
  6712
  6713
  6714// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6715//
  6716//  Command:
  6717//     STRUCTURE_START fileNum driverName
  6718//
  6719//  Description:
  6720//     This function begins creation of a new file or modification of
  6721//     an existing file.
  6722//
  6723//  Parameters:
  6724//     fileNum:
  6725//         The number for an existing file. It must be 0 if starting a
  6726//         new file or the number of a file being modified. In either
  6727//         case, a handle to the structure is written back into fileNum
  6728//         so that attributes of the new structure can be queried.
  6729//
  6730//     driverName:
  6731//         Name of the driver to use when creating a new file.
  6732//
  6733// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6734
  6735#COMMAND STRUCTURE_START RLG#U INDLG#U .
  6736    !A [] $505 !1 !2
  6737#ENDCOMMAND
  6738
  6739
  6740// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6741//
  6742//  Command:
  6743//      STRUCTURE_ABORT structureHandle
  6744//
  6745//  Description:
  6746//      Terminates a file structure operation without completing it.
  6747//
  6748//  Parameters:
  6749//      structureHandle
  6750//          Handle from the structure_start.
  6751//
  6752// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6753
  6754#COMMAND STRUCTURE_ABORT RLG#U .
  6755    !A [] $508 !1
  6756#ENDCOMMAND
  6757
  6758
  6759// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6760//
  6761//  Command:
  6762//      STRUCTURE_END fileNum {restructureOptions {tempDir {callBackObject}}}
  6763//
  6764//  Description:
  6765//      This function commits a structure operation, performing restructure
  6766//      on the file if necessary.
  6767//
  6768//  Parameters:
  6769//      fileNum:
  6770//          The number of the file ( or handle returned by STRUCTURE_START
  6771//          for a new file ) which a STRUCTURE_START has been done on.
  6772//
  6773//      restructureOptions:
  6774//          The IAND'ing of the following API attributes:
  6775//              DF_STRUCTEND_OPT_NONE
  6776//              DF_STRUCTEND_OPT_FORCE
  6777//              DF_STRUCTEND_OPT_RECOMPRESS
  6778//              DF_STRUCTEND_OPT_INPLACE
  6779//              DF_STRUCTEND_OPT_NO_SORT
  6780//
  6781//      tempDir:
  6782//          A temporary directory to be used in not restructuring in place.
  6783//
  6784//      callBackObject:
  6785//          An object id which will receive MSG_CALLBACK during the restructure
  6786//          operation. This the first parameter of this message is a string
  6787//          containing progress information.
  6788//
  6789// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6790
  6791#COMMAND STRUCTURE_END RLUG# LUG# NDILUG# LUG# .
  6792    !A [] $506 !1 !2
  6793    !A [] $507 !3 !4
  6794#ENDCOMMAND
  6795
  6796
  6797// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6798//
  6799//  Command:
  6800//        STRUCTURE_COPY fromFileNumber TO toFileNumber
  6801//
  6802//  Descriptiion:
  6803//        Copies structure of one file to another
  6804//
  6805//  Parameters:
  6806//        fromFileNumber:
  6807//            File Number of the file from where the structure is to be copied
  6808//
  6809//        toFileNumber:
  6810//            Number of the file to which the structure is to be copied
  6811//
  6812//
  6813// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6814
  6815
  6816#COMMAND STRUCTURE_COPY RLUG# "TO" RLUG# .
  6817    !A [] $51C !1 !3
  6818#ENDCOMMAND
  6819
  6820// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6821//
  6822//  Command:
  6823//        FILL_FIELD FileNumber fieldNumber { "WITH" <Fill_Type> }
  6824//
  6825//  Description:
  6826//        Fill a field with the highest or lowest value ot the type.
  6827//  Fill_type:
  6828//         DF_HIGH or DF_LOW. For example for a numeric field, DF_HIGH is
  6829//         all 9's and lowest being all 0's
  6830//
  6831//  Parameters:
  6832//         FileNumber:
  6833//            Number of the file
  6834//
  6835//         Field Number:
  6836//            Number of the field which is to be filled
  6837//
  6838// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6839
  6840#COMMAND FILL_FIELD RLUG# RLUG#  "WITH" RLUG# .
  6841    !A [] $51D !1
  6842    !A [] $51E !2 !4
  6843#ENDCOMMAND
  6844
  6845
  6846// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6847//
  6848//  Command:
  6849//      CREATE_FIELD fileNum {"AT" fieldNum}
  6850//
  6851//  Description:
  6852//      Creates a new field. If fieldNum is ommitted or 0,
  6853//      field is appended to record. Actual fieldNum assigned
  6854//      to new field is returned in fieldNum. fileNum must
  6855//      be the number of a file currently being restructured or
  6856//      created.
  6857//
  6858//  Parameter:
  6859//      fileNum
  6860//          Handle for either a file or a structure
  6861//      fieldNum
  6862//          Field to be modified
  6863//
  6864// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6865
  6866#COMMAND CREATE_FIELD RLUG# "AT""" LUG# .
  6867    !A [] $509 !1 !3
  6868#ENDCOMMAND
  6869
  6870
  6871// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6872//
  6873//  Command:
  6874//      DELETE_FIELD fileNum fieldNum
  6875//
  6876//  Description:
  6877//      Delete the field described by fieldNum and fileNum. NOTE:
  6878//      the fileNum handle must be for a file that has had a STRUCTURE_START
  6879//      done on it.
  6880//
  6881//  Parameter:
  6882//      fileNum
  6883//          Handle for either a file or a structure
  6884//      fieldNum
  6885//          Field to be modified
  6886//
  6887// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6888
  6889#COMMAND DELETE_FIELD R R .
  6890    !A [] $50b !1 !2
  6891#ENDCOMMAND
  6892
  6893
  6894// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6895//
  6896//  Command:
  6897//      CREATE_INDEX fileNum {"AT" indexNum}
  6898//
  6899//  Description:
  6900//      Creates a new index for file fileNum. STRUCTURE_START must have
  6901//      been called for fileNum. IndexNum will contain the number of
  6902//      the index created; any value in it prior to the call is ignored.
  6903//
  6904//  Parameter:
  6905//      indexNum
  6906//          Handle for either a file or a structure
  6907//      fieldNum
  6908//          Field to be modified
  6909//
  6910// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6911
  6912#COMMAND CREATE_INDEX RLUG# "AT" RLUG#C .
  6913    !A [] $50a !1 !3
  6914#ENDCOMMAND
  6915
  6916
  6917// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6918//
  6919//  Command:
  6920//      DELETE_INDEX fileNum indexNum
  6921//
  6922//  Description:
  6923//      Delete the index described by indexNum and fileNum. NOTE:
  6924//      the fileNum handle must be for a file that has had a
  6925//      STRUCTURE_START done on it.
  6926//
  6927// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6928
  6929#COMMAND DELETE_INDEX RLUG# RLUG# .
  6930    !A [] $50c !1 !2
  6931#ENDCOMMAND
  6932
  6933
  6934// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6935//
  6936//  Command:
  6937//      VARIABLE_FILE_COMMAND command [fileSymbol|fileNum]
  6938//
  6939//  Description:
  6940//      This command allows the execution of any other command,
  6941//      handling both file numbers ( 102 ) and file symbols
  6942//      ( PERSON )
  6943//
  6944//  Parameters:
  6945//      command:
  6946//          The DataFlex command number
  6947//      fileSymbol:
  6948//          The symbol used to load the .FD file; the logical name of the file.
  6949//      fileNum:
  6950//          The number of the file ( obviously ).
  6951//
  6952// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6953
  6954#COMMAND VARIABLE_FILE_COMMAND
  6955  //#IFSAME !2 |FS0,0& |FN0,0& |FD0,0&
  6956  // This supports both Indirect_file and Indirect_file.Recnum (JJT)
  6957  #IFSAME !2.RECNUM |FS0,0& |FN0,0& |FD0,0& |FS0,0&.RECNUM
  6958    !A [] !1 |CI0 !3
  6959  #ELSE
  6960    #IFCLASS !2 SNDIECWVF
  6961        !A [] !1 !2 !3
  6962    #ELSE
  6963        DECLARE_DATAFILE !2
  6964        !A [] !1 !2.FILE_NUMBER !3
  6965    #ENDIF
  6966  #ENDIF
  6967#ENDCOMMAND
  6968
  6969
  6970// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6971//
  6972//  Command:
  6973//      OPEN {fileName AS} [logicalName|fileNum|] {MODE fileMode} index
  6974//
  6975//  Description:
  6976//      Open a DataFile using the specified filename of filenumber.
  6977//
  6978//  Parameters:
  6979//      fileName:
  6980//          A string containing the physical name of the file
  6981//      logicalName:
  6982//          The symbolic name used to find the .FD file.
  6983//      fileNum:
  6984//          A number which will be used to open the file. If using the "AS"
  6985//          form, fileNum may be a variable containing a 0. In that case,
  6986//          filelist will be searched for an entry with a logical name
  6987//          matching fileName; the number of the first entry matching will
  6988//          be used as the number to open the file and will be written
  6989//          back to the variable used for fileNum.
  6990//      fileMode:
  6991//          The mode to open the file in ( e.g., DF_EXCLUSIVE ).
  6992//      index:
  6993//          Index to buffer, may be either a number or an index symbol (INDEX.1)
  6994//
  6995// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  6996
  6997#COMMAND API_OPEN RLG#
  6998  #IFSAME !2 AS
  6999    //#IFSAME !3 |FS0,0& |FN0,0& |FD0,0&
  7000    // This supports both Indirect_file and Indirect_file.Recnum (JJT)
  7001    #IFSAME !3.RECNUM |FS0,0& |FN0,0& |FD0,0& |FS0,0&.RECNUM
  7002        #SET Q$ $516 // Open indirect
  7003    #ELSE
  7004        #SET Q$ $50d // Open normally
  7005    #ENDIF
  7006    #IFSAME !4 MODE
  7007      #CHECK !5 RLUG#
  7008      !A [] $517 !5 !6
  7009      VARIABLE_FILE_COMMAND !q !3 !1
  7010    #ELSE
  7011      !A [] $517 DF_SHARE !4
  7012      VARIABLE_FILE_COMMAND !q !3 !1
  7013    #ENDIF
  7014  #ELSE
  7015    //#IFSAME !1 |FS0,0& |FN0,0& |FD0,0&
  7016    // This supports both Indirect_file and Indirect_file.Recnum (JJT)
  7017    #IFSAME !1.RECNUM |FS0,0& |FN0,0& |FD0,0& |FS0,0&.RECNUM
  7018        #SET Q$ $516 // Open indirect
  7019    #ELSE
  7020        #SET Q$ $50d // Open normally
  7021    #ENDIF
  7022    #IFSAME !2 MODE
  7023      #CHECK !3 RLUG#
  7024      !A [] $517 !3 !4
  7025      VARIABLE_FILE_COMMAND !q !1 |CS""
  7026    #ELSE
  7027      !A [] $517 DF_SHARE !2
  7028      VARIABLE_FILE_COMMAND !q !1  |CS""
  7029    #ENDIF
  7030  #ENDIF
  7031#ENDCOMMAND
  7032
  7033#COMMAND OLD_OPEN
  7034  #IFSAME !2 AS
  7035    DECLARE_DATAFILE !3
  7036    #CHECK !3 _TR
  7037    #CHECK !1 _#LG
  7038    #CHECK !5 .
  7039    #CHECK !3.RECNUM _URW#LG
  7040    #IF (!0>3)
  7041      #CHECK !4 _DGLOBU#
  7042      MOVEINT !4 TO FIELDNUMBER
  7043      !A [] $182 !3.RECNUM !1
  7044    #ELSE
  7045      MOVEINT |CI0 TO FIELDNUMBER
  7046      !A [] $182 !3.RECNUM !1
  7047    #ENDIF
  7048  #ELSE
  7049    #CHECK !3 .
  7050    DECLARE_DATAFILE !1
  7051    #CHECK !1.RECNUM _URW#LG
  7052    #IF (!0>1)
  7053      #CHECK !2 FWSNDELG#U
  7054      !A [] $180 !1.RECNUM !2
  7055    #ELSE
  7056      !A [] $180 !1.RECNUM |CI0
  7057    #ENDIF
  7058  #ENDIF
  7059#ENDCOMMAND
  7060
  7061#COMMAND OPEN
  7062    API_OPEN !1 !2 !3 !4 !5 !6 !7 !8 !9
  7063#ENDCOMMAND
  7064
  7065
  7066// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7067//
  7068//  Command:
  7069//      CLEAR {logicalName|fileNum}*n
  7070//
  7071//  Description:
  7072//      Clear the current record in the file.
  7073//
  7074//  Parameters:
  7075//      logicalName:
  7076//          The name used to identify the file in a DataFlex program.
  7077//      fileNum:
  7078//          The number used to open the file.
  7079//
  7080// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7081
  7082#COMMAND API_CLEAR RLG#
  7083  VARIABLE_FILE_COMMAND $50e !1
  7084  #IF (!0>1)
  7085    API_CLEAR !2 !3 !4 !5 !6 !7 !8 !9
  7086  #ENDIF
  7087#ENDCOMMAND
  7088
  7089#COMMAND OLD_CLEAR CVWR#LGE
  7090  #IFDEF !1
  7091    !A [] $C1 !1
  7092  #ELSE
  7093    #CHECK !1.RECNUM _CVWLR#GU
  7094    !A [] $C1 !1.RECNUM
  7095  #ENDIF
  7096  #IF !0>1
  7097    OLD_CLEAR !2 !3 !4 !5 !6 !7 !8 !9
  7098  #ENDIF
  7099#ENDCOMMAND
  7100
  7101#COMMAND CLEAR
  7102    #IFSAME !1 DF_ALL
  7103        !A [] $52C
  7104    #ELSE
  7105        API_CLEAR !1 !2 !3 !4 !5 !6 !7 !8 !9
  7106    #ENDIF
  7107#ENDCOMMAND
  7108
  7109
  7110// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7111//
  7112//  Command:
  7113//      CLOSE {logicalName|fileNum}*n
  7114//
  7115//  Description:
  7116//      Closes the file.
  7117//
  7118//  Parameters:
  7119//      logicalName:
  7120//          The name used to identify the file in a DataFlex program.
  7121//      fileNum:
  7122//          The number used to open the file.
  7123//
  7124// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7125
  7126#COMMAND API_CLOSE RLG#
  7127  VARIABLE_FILE_COMMAND $50f !1
  7128  #IF (!0>1)
  7129    API_CLOSE !2 !3 !4 !5 !6 !7 !8 !9
  7130  #ENDIF
  7131#ENDCOMMAND
  7132
  7133#COMMAND OLD_CLOSE RTE
  7134  #CHECK !1.RECNUM _CVWLR#GU
  7135  !A [] $181 !1.RECNUM
  7136  #IF (!0>1)
  7137    OLD_CLOSE !2 !3 !4 !5 !6 !7 !8 !9
  7138  #ENDIF
  7139#ENDCOMMAND
  7140
  7141#COMMAND CLOSE
  7142    #IFSAME !1 DF_ALL
  7143       !A [] $52D !2
  7144    #ELSE
  7145       API_CLOSE !1 !2 !3 !4 !5 !6 !7 !8 !9
  7146    #ENDIF
  7147#ENDCOMMAND
  7148
  7149
  7150// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7151//
  7152//  Command:
  7153//      GET_FIELD_VALUE fileNum fieldNum "TO" destVariable;
  7154//          {"LENGTH" iLength {"OFFSET" iOffset}}
  7155//
  7156//  Description:
  7157//      Gets the value of a field into the destVariable doing any
  7158//      type conversion necessary.
  7159//
  7160//  Parameters:
  7161//      fileNum:
  7162//          The number used to open the file.
  7163//      fieldNum:
  7164//          The number of the field.
  7165//      destVariable:
  7166//          Where the fields value will be put.
  7167//      iLength:
  7168//          The length of the data to be used. By default, all
  7169//          data (or as much as can be) is written into the field.
  7170//          A length of 0 causes all data to be written.
  7171//      iOffset:
  7172//          The first byte in the field where data will be written, from 0.
  7173//          Default is that data will be written into the field starting at
  7174//          byte 0.
  7175//
  7176// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7177
  7178#COMMAND GET$FIELD$VALUE$HELP RLGU# RLGU# "TO" CRLGU# "LENGTH" RLGU# "OFFSET" RLGU# .
  7179  SET_FILE_FIELD !1 !2
  7180  SET_LENGTH_OFFSET !6 !8
  7181  !A [] $510 !4
  7182#ENDCOMMAND
  7183
  7184#COMMAND GET_FIELD_VALUE RLGU# RLGU# "TO" CRLGU#
  7185  #IF (!0=4)
  7186    GET$FIELD$VALUE$HELP !1 !2 !3 !4 LENGTH 0 OFFSET 0
  7187  #ELSE
  7188    #IF (!0=6)
  7189      GET$FIELD$VALUE$HELP !1 !2 !3 !4 !5 !6 OFFSET 0
  7190    #ELSE
  7191      GET$FIELD$VALUE$HELP !1 !2 !3 !4 !5 !6 !7 !8 !9
  7192    #ENDIF
  7193  #ENDIF
  7194#ENDCOMMAND
  7195
  7196
  7197// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7198//
  7199//  Command:
  7200//      SET_FIELD_VALUE fileNum fieldNum "TO" newValue;
  7201//          {"LENGTH" iLength {"OFFSET" iOffset {noTruncateFlag}}}
  7202//
  7203//  Description:
  7204//      Sets the value of a field to newValue doing any type conversion
  7205//      necessary.
  7206//
  7207//  Parameters:
  7208//      fileNum:
  7209//          The number used to open the file.
  7210//      fieldNum:
  7211//          The number of the field.
  7212//      newValue:
  7213//          The value to be put into the field.
  7214//      iLength:
  7215//          The length of the data to be used. By default, all
  7216//          data (or as much as can be) is written into the field.
  7217//          A length of 0 causes all data to be written.
  7218//      iOffset:
  7219//          The first byte in the field where data will be written, from 0.
  7220//          Default is that data will be written into the field starting at
  7221//          byte 0.
  7222//      noTruncateFlag:
  7223//          Flag which signifies whether existing data in the field
  7224//          following data that is edited will be truncated or not. By
  7225//          default, all old data following new data written is truncated.
  7226//
  7227// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7228
  7229#COMMAND SET$FIELD$VALUE$HELP$2 "LENGTH" RLGU# "OFFSET" RLGU# .
  7230    SET_LENGTH_OFFSET !2 !4
  7231#ENDCOMMAND
  7232
  7233#COMMAND SET$FIELD$VALUE$HELP RLGU# RLGU# "TO" RLGU# RLGU# .
  7234  SET_FILE_FIELD !1 !2
  7235  !A [] $511 !4 !5
  7236#ENDCOMMAND
  7237
  7238#COMMAND SET_FIELD_VALUE RLGU# RLGU# "TO" RLGU#
  7239  #IF (!0=4)
  7240    SET$FIELD$VALUE$HELP$2 LENGTH 0 OFFSET 0
  7241    SET$FIELD$VALUE$HELP !1 !2 !3 !4 DFFALSE
  7242  #ELSE
  7243    #IF (!0=6)
  7244      SET$FIELD$VALUE$HELP$2 !5 !6 OFFSET 0
  7245      SET$FIELD$VALUE$HELP !1 !2 !3 !4 DFFALSE
  7246    #ELSE
  7247      #IF (!0=8)
  7248        SET$FIELD$VALUE$HELP$2 !5 !6 !7 !8
  7249        SET$FIELD$VALUE$HELP !1 !2 !3 !4 DFFALSE
  7250      #ELSE
  7251        SET$FIELD$VALUE$HELP$2 !5 !6 !7 !8
  7252        SET$FIELD$VALUE$HELP !1 !2 !3 !4 !9
  7253      #ENDIF
  7254    #ENDIF
  7255  #ENDIF
  7256#ENDCOMMAND
  7257
  7258
  7259// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7260//
  7261//  Command:
  7262//      SAVERECORD {logicalName|fileNum}*n
  7263//
  7264//  Description:
  7265//      Saves the current record in the specified files.
  7266//
  7267//  Parameters:
  7268//      logicalName:
  7269//          The name used to identify the file in a DataFlex program.
  7270//      fileNum:
  7271//          The number used to open the file.
  7272//
  7273// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7274
  7275#COMMAND API_SAVERECORD RLG#
  7276  VARIABLE_FILE_COMMAND $512 !1
  7277  #IF !0>1
  7278    API_SAVERECORD !2 !3 !4 !5 !6 !7 !8 !9
  7279  #ENDIF
  7280#ENDCOMMAND
  7281
  7282#COMMAND OLD_SAVERECORD CVWR#LGE
  7283  #IFDEF !1
  7284    !A [] $C2 !1
  7285  #ELSE
  7286    #CHECK !1.RECNUM _CVWLR#GU
  7287    !A [] $C2 !1.RECNUM
  7288  #ENDIF
  7289  #IF !0>1
  7290    OLD_SAVERECORD !2 !3 !4 !5 !6 !7 !8 !9
  7291  #ENDIF
  7292#ENDCOMMAND
  7293
  7294#COMMAND SAVERECORD
  7295    API_SAVERECORD !1 !2 !3 !4 !5 !6 !7 !8 !9
  7296#ENDCOMMAND
  7297
  7298
  7299// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7300//
  7301//  Command:
  7302//      ATTACH {logicalName|fileNum}*n
  7303//
  7304//  Description:
  7305//      Updates all fields in the current record which relate to another file
  7306//      with the values of those fields in the parent ( or related-to) files.
  7307//
  7308//  Parameters:
  7309//      logicalName:
  7310//          The name used to identify the file in a DataFlex program.
  7311//      fileNum:
  7312//          The number used to open the file.
  7313//
  7314// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7315
  7316#COMMAND API_ATTACH RLG#
  7317    VARIABLE_FILE_COMMAND $513 !1
  7318    #IF !0>1
  7319       API_ATTACH !2 !3 !4 !5 !6 !7 !8 !9
  7320    #ENDIF
  7321#ENDCOMMAND
  7322
  7323#COMMAND OLD_ATTACH CVWR#LGE
  7324  #IFDEF !1
  7325    !A [] $C5 !1
  7326  #ELSE
  7327    #CHECK !1.RECNUM _CVWLR#GU
  7328    !A [] $C5 !1.RECNUM
  7329  #ENDIF
  7330  #IF !0>1
  7331    OLD_ATTACH !2 !3 !4 !5 !6 !7 !8 !9
  7332  #ENDIF
  7333#ENDCOMMAND
  7334
  7335#COMMAND ATTACH
  7336    API_ATTACH !1 !2 !3 !4 !5 !6 !7 !8 !9
  7337#ENDCOMMAND
  7338
  7339
  7340// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7341//
  7342//  Command:
  7343//      SAVE {logicalName|fileNum}*n
  7344//
  7345//  Description:
  7346//      Save the contents of the currently active record, updating the
  7347//      records with any data in parent files from related fields (as per
  7348//      attach).
  7349//
  7350//  Parameters:
  7351//      logicalName:
  7352//          The name used to identify the file in a DataFlex program.
  7353//      fileNum:
  7354//          The number used to open the file.
  7355//
  7356// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7357
  7358#COMMAND API_SAVE RLG#
  7359  ATTACH !1
  7360  SAVERECORD !1
  7361  #IF (!0>1)
  7362    API_SAVE !2 !3 !4 !5 !6 !7 !8 !9
  7363  #ENDIF
  7364#ENDCOMMAND
  7365
  7366#COMMAND OLD_SAVE CVWR#LGE
  7367  #IFDEF !1
  7368    !A [] $C5 !1
  7369    !A [] $C2 !1
  7370  #ELSE
  7371    #CHECK !1.RECNUM _CLVWLR#GU
  7372    !A [] $C5 !1.RECNUM
  7373    !A [] $C2 !1.RECNUM
  7374  #ENDIF
  7375  #IF !0>1
  7376    OLD_SAVE !2 !3 !4 !5 !6 !7 !8 !9
  7377  #ENDIF
  7378#ENDCOMMAND
  7379
  7380#COMMAND SAVE
  7381    API_SAVE !1 !2 !3 !4 !5 !6 !7 !8 !9
  7382#ENDCOMMAND
  7383
  7384
  7385// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7386//
  7387//  Command:
  7388//      DELETE {fileNum|logicalName}*n
  7389//
  7390//  Description:
  7391//      Delete the currently active record from the datafile
  7392//
  7393//  Parameters:
  7394//      logicalName:
  7395//          The name used to identify the file in a DataFlex program.
  7396//      fileNum:
  7397//          The number used to open the file.
  7398//
  7399// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7400
  7401#COMMAND OLD_DELETE CVWR#LGE
  7402  #IFDEF !1
  7403    !A [] $C3 !1
  7404  #ELSE
  7405    #CHECK !1.RECNUM _CVWLR#GU
  7406    !A [] $C3 !1.RECNUM
  7407  #ENDIF
  7408  #IF !0>1
  7409    OLD_DELETE !2 !3 !4 !5 !6 !7 !8 !9
  7410  #ENDIF
  7411#ENDCOMMAND
  7412
  7413#COMMAND API_DELETE RLG#
  7414  VARIABLE_FILE_COMMAND $514 !1
  7415  #IF !0>1
  7416    API_DELETE !2 !3 !4 !5 !6 !7 !8 !9
  7417  #ENDIF
  7418#ENDCOMMAND
  7419
  7420#COMMAND DELETE
  7421    API_DELETE !1 !2 !3 !4 !5 !6 !7 !8 !9
  7422#ENDCOMMAND
  7423
  7424
  7425// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7426//
  7427//  Command:
  7428//      RELATE {fileNum|logicalName}*n
  7429//
  7430//  Description:
  7431//      Moves all related fields into the parent files and then performs a
  7432//      find in the parents using the main index of the first (or primary)
  7433//      related field for each parent.
  7434//
  7435//  Parameters:
  7436//      logicalName:
  7437//          The name used to identify the file in a DataFlex program.
  7438//      fileNum:
  7439//          The number used to open the file.
  7440//
  7441// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7442
  7443#COMMAND OLD_RELATE CVWR#LGR
  7444  #IFDEF !1
  7445    !A [] $C4 !1
  7446  #ELSE
  7447    #CHECK !1.RECNUM _CVWLR#GU
  7448    !A [] $C4 !1.RECNUM
  7449  #ENDIF
  7450  #IF !0>1
  7451    OLD_RELATE !2 !3 !4 !5 !6 !7 !8 !9
  7452  #ENDIF
  7453#ENDCOMMAND
  7454
  7455#COMMAND API_RELATE RLG#
  7456  VARIABLE_FILE_COMMAND $515 !1
  7457  #IF !0>1
  7458    API_RELATE !2 !3 !4 !5 !6 !7 !8 !9
  7459  #ENDIF
  7460#ENDCOMMAND
  7461
  7462#COMMAND RELATE
  7463    API_RELATE !1 !2 !3 !4 !5 !6 !7 !8 !9
  7464#ENDCOMMAND
  7465
  7466
  7467// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7468//
  7469//  Command:
  7470//      REREAD {fileNum|logicalName}*n
  7471//
  7472//  Description:
  7473//      Locks all files and then re-finds the current record in each file
  7474//      specified as an argument to the command. If no files are specified,
  7475//      then all files are reread.
  7476//
  7477//  Parameters:
  7478//      logicalName:
  7479//          The name used to identify the file in a DataFlex program.
  7480//      fileNum:
  7481//          The number used to open the file.
  7482//
  7483// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7484
  7485#COMMAND OLD_REFRESH T  // Re-find all files listed by record identity
  7486  #CHECK !1.RECNUM _RUWG
  7487  !A [] $C0 !1.RECNUM |CI2         // FIND command
  7488  !A [FINDERR] $047 |CI25 |CS"!1" // ERROR command
  7489  #IF !0>1
  7490    OLD_REFRESH !2 !3 !4 !5 !6 !7 !8 !9
  7491  #ENDIF
  7492#ENDCOMMAND
  7493
  7494#COMMAND OLD_REREAD
  7495  #IF !0=0
  7496    !A [] $0C9 // REREAD command
  7497  #ELSE
  7498    !A [] $0C7 // LOCK command
  7499    [MULTIUSER] OLD_REFRESH !1 !2 !3 !4 !5 !6 !7 !8 !9
  7500  #ENDIF
  7501#ENDCOMMAND
  7502
  7503#COMMAND API_REFRESH
  7504  #IF (!0>0)
  7505    #CHECK !1 LG#
  7506    MOVE 0 to INDEX_NUMBER
  7507    VARIABLE_FILE_COMMAND $CC !1 |CI2
  7508    #IFCLASS !1 SNDIECWV
  7509      [FINDERR] ERROR 25 !1
  7510    #ELSE
  7511      [FINDERR] ERROR 25 |CS"!1"
  7512    #ENDIF
  7513    API_REFRESH !2 !3 !4 !5 !6 !7 !8 !9
  7514  #ENDIF
  7515#ENDCOMMAND
  7516
  7517#COMMAND API_REREAD
  7518  #IF (!0=0)
  7519    !A [] $0C9 // REREAD ALL
  7520  #ELSE
  7521    !A [] $0C7 // LOCK
  7522    [MULTIUSER] API_REFRESH !1 !2 !3 !4 !5 !6 !7 !8 !9
  7523  #ENDIF
  7524#ENDCOMMAND
  7525
  7526#COMMAND REREAD
  7527    API_REREAD !1 !2 !3 !4 !5 !6 !7 !8 !9
  7528#ENDCOMMAND
  7529
  7530
  7531// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7532//
  7533//  Command:
  7534//      ZEROFILE {fileNum|logicalName}
  7535//
  7536//  Description:
  7537//      Erases all data within the file.
  7538//
  7539//  Parameters:
  7540//      logicalName:
  7541//          The name used to identify the file in a DataFlex program.
  7542//      fileNum:
  7543//          The number used to open the file.
  7544//
  7545// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7546
  7547#COMMAND OLD_ZEROFILE $RT .
  7548  #IFDEF !1.RECNUM
  7549    #SET Q$ !1.RECNUM
  7550    !A [] $308 |CI!q
  7551  #ELSE
  7552    #CHECK !1 _SG#L
  7553    !A [] $308 !1
  7554  #ENDIF
  7555#ENDCOMMAND
  7556
  7557#COMMAND API_ZEROFILE RLG# .
  7558  VARIABLE_FILE_COMMAND $308 !1
  7559#ENDCOMMAND
  7560
  7561#COMMAND ZEROFILE
  7562  API_ZEROFILE !1 !2 !3 !4 !5 !6 !7 !8 !9
  7563#ENDCOMMAND
  7564
  7565
  7566// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7567//
  7568//  Command:
  7569//      VCONSTRAIN fileNum RELATES fileNum2
  7570//      VCONSTRAIN fileNum AS boolExpression
  7571//      VCONSTRAIN fileNum fieldNum mode expression
  7572//      VCONSTRAIN fileNum fieldNum mode fileNum2 fieldNum2
  7573//
  7574//  Description:
  7575//      This command allows a variable constraint to be created.
  7576//
  7577//  Parameters:
  7578//      fileNum
  7579//          Num of the file to be constrained
  7580//      fieldNum
  7581//          Num of the field to be constrained
  7582//      boolExpression
  7583//          An expression which is treated as FALSE if it evaluates to zero,
  7584//          TRUE if non-zero
  7585//      expression
  7586//          Any DataFlex expression
  7587//      fileNum2
  7588//          Num of the file to be constrained to
  7589//      fieldNum2
  7590//          Num of the field to be constrained to
  7591//      mode
  7592//          Either the symbols LT, LE, EQ, NE, GT, GE, CONTAINS, and MATCHES,
  7593//          or an expression that corresponds to their symbolic value.
  7594//          MATCHES = 6, CONTAINS = 7.
  7595//
  7596// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7597
  7598#COMMAND CONSTRAIN R
  7599  #IFSAME !2 AS
  7600    #CHECK !3 CFLVNSWG#
  7601    #CHECK !1.RECNUM R#ULWVC
  7602    #SET Q$ !1.RECNUM
  7603    !A [] $DB |CI!q !3        // FILE AS (BOOL-EXP)
  7604  #ELSE
  7605    #IFSAME !2 BETWEEN      // FIELD BETWEEN A AND B
  7606      #CHECK !4 "AND"
  7607      CONSTRAIN !1 GE !3
  7608      CONSTRAIN !1 LE !5
  7609    #ELSE
  7610      #IFSAME !2 RELATES
  7611        #CHECK !3 "TO"
  7612        #IFDEF !1
  7613          #IFDEF !4
  7614            !A [] $D9 !1 !4        // FILE RELATES TO FILE
  7615          #ELSE
  7616            !A [] $D9 !1 !4.FILE_NUMBER // FILE RELATES TO FILE
  7617          #ENDIF
  7618        #ELSE
  7619          #IFDEF !4
  7620            !A [] $D9 !1.FILE_NUMBER !4
  7621          #ELSE
  7622            !A [] $D9 !1.FILE_NUMBER !4.FILE_NUMBER
  7623          #ENDIF
  7624        #ENDIF
  7625      #ELSE
  7626        #CHECK !1 R#LWVCEBG
  7627        #IF !0>1
  7628          #IFSAME !2 MATCHES
  7629            #SET Q$ 6
  7630          #ELSE
  7631            #IFSAME !2 CONTAINS
  7632              #SET Q$ 7
  7633            #ELSE
  7634              #CHECK !2 _U
  7635              #SET Q$ !2
  7636            #ENDIF
  7637          #ENDIF
  7638          MOVE |CI!q TO INDEX_NUMBER
  7639          #IFCLASS !3 "F"
  7640            !A [] $D2 !1 !3 // FILE MODE FILE
  7641          #ELSE
  7642            !A [] $D1 !1 !3 // FILE MODE VALUE
  7643          #ENDIF
  7644        #ELSE
  7645          #CHECK !1 CVW#GRE
  7646          !A [] $D3 !1 // FIELD ONLY
  7647        #ENDIF
  7648      #ENDIF
  7649    #ENDIF
  7650  #ENDIF
  7651#ENDCOMMAND
  7652
  7653// Handles comparing file.field to expression|file.field.
  7654#COMMAND VCONSTRAIN_COMPARE #LGUR #LGUR LR #LGUR #LGU .
  7655  !A [] $E7 !1 !2 // Store fileNum fieldNum
  7656  #IFSAME !3 MATCHES CONTAINS $0 $1 $2 $3 $4 $5 $6 $7
  7657    #IFSAME !3 MATCHES
  7658      #SET Q$ 6
  7659    #ELSE
  7660      #IFSAME !3 CONTAINS
  7661        #SET Q$ 7
  7662      #ELSE
  7663        #CHECK !3 _U
  7664        #SET Q$ !3
  7665      #ENDIF
  7666    #ENDIF
  7667    !A [] $E8 |CI!q    // Store comparison mode
  7668  #ELSE
  7669    !A [] $E8 !3    // Store comparison mode
  7670  #ENDIF
  7671  #IF (!0>4)
  7672    !A [] $E9 !4 !5 // fileNum2 fieldNum2
  7673  #ELSE
  7674    !A [] $EA !4    // Expression
  7675  #ENDIF
  7676#ENDCOMMAND
  7677
  7678#COMMAND VCONSTRAIN_AS #LGUR "AS" #LGUR .
  7679  !A [] $DB !1 !3
  7680#ENDCOMMAND
  7681
  7682#COMMAND VCONSTRAIN_RELATE #LGUR "RELATES" #LGUR .
  7683  !A [] $D9 !1 !3
  7684#ENDCOMMAND
  7685
  7686#COMMAND VCONSTRAIN
  7687  #IFSAME !2 RELATES
  7688    VCONSTRAIN_RELATE !1 !2 !3 !4 !5 !6 !7 !8 !9
  7689  #ELSE
  7690    #IFSAME !2 AS
  7691      VCONSTRAIN_AS !1 !2 !3 !4 !5 !6 !7 !8 !9
  7692    #ELSE
  7693      VCONSTRAIN_COMPARE !1 !2 !3 !4 !5 !6 !7 !8 !9
  7694    #ENDIF
  7695  #ENDIF
  7696#ENDCOMMAND
  7697
  7698// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7699//
  7700//  Command:
  7701//      SORT fileNum {indexNumbers {options {callBackObject}}}
  7702//
  7703//  Description:
  7704//
  7705//  Parameters:
  7706//      logicalName:
  7707//          The name used to identify the file in a DataFlex program.
  7708//      fileNum:
  7709//          The number used to open the file.
  7710//      indexNumbers:
  7711//          Optional string listing all index numbers to sort.
  7712//      callBackObject:
  7713//          An object id which will receive MSG_CALLBACK during the restructure
  7714//          operation. This the first parameter of this message is a string
  7715//          containing progress information.
  7716//
  7717// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7718#COMMAND SORT R#LGU #LGU #LUG #LGU .
  7719    !A [] $519 !3 !4
  7720    !A [] $518 !1 !2
  7721#ENDCOMMAND
  7722
  7723
  7724// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7725//
  7726//  Command:
  7727//      OUTPUT_AUX_FILE fileType FOR fileNum {NUMBER logicalNum} {TO optPath}
  7728//
  7729//  Description:
  7730//      Output a database related file.
  7731//
  7732//  Parameters:
  7733//      fileNum:
  7734//          The number used to open the file.
  7735//      logicalNum:
  7736//          The logical number to be used to create the file. Only used if the
  7737//          file to be created is a new file (thus has no set file number).
  7738//      fileType:
  7739//          The type of file to be created, e.g., DF_AUX_FILE_FD or
  7740//          DF_AUX_FILE_DEF.
  7741//      optPath:
  7742//          Optional filename/sequential device where output will be written.
  7743//
  7744// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7745
  7746#COMMAND OUTPUT_AUX_FILE_HELP "NUMBER" L#GU "TO" L#GUIND .
  7747  !A [] $51A !2 !4
  7748#ENDCOMMAND
  7749
  7750#COMMAND OUTPUT_AUX_FILE R#LGU "FOR" R#LGU
  7751  #IF (!0>5)
  7752    #IFSAME !6 NUMBER
  7753      OUTPUT_AUX_FILE_HELP !6 !7 !4 !5 !8 !9
  7754    #ELSE
  7755      OUTPUT_AUX_FILE_HELP !4 !5 !6 !7 !8 !9
  7756    #ENDIF
  7757  #ELSE
  7758    #IF (!0>3)
  7759      #IFSAME !4 NUMBER
  7760        OUTPUT_AUX_FILE_HELP !4 !5 TO |CS"" !6 !7 !8 !9
  7761      #ELSE
  7762        #IFSAME !4 TO
  7763           OUTPUT_AUX_FILE_HELP NUMBER |CI0 !4 !5 !6 !7 !8 !9
  7764        #ELSE // Something is wrong, compiler will say what
  7765           OUTPUT_AUX_FILE_HELP !4 !5 !6 !7 !8 !9
  7766        #ENDIF
  7767      #ENDIF
  7768    #ELSE
  7769      OUTPUT_AUX_FILE_HELP NUMBER |CI0 TO |CS""
  7770    #ENDIF
  7771  #ENDIF
  7772  !A [] $51B !1 !3
  7773#ENDCOMMAND
  7774
  7775
  7776// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7777//
  7778//  Command:
  7779//      OUTPUT_DEF_FILE fileNum {NUMBER logicalNum} {TO optPath}
  7780//
  7781//  Description:
  7782//      Output a .DEF file.
  7783//
  7784//  Parameters:
  7785//      fileNum:
  7786//          The number used to open the file.
  7787//      logicalNum:
  7788//          The logical number to be used to create the file. Only used if the
  7789//          file to be created is a new file (thus has no set file number).
  7790//      optPath:
  7791//          Optional filename/sequential device where output will be written.
  7792//
  7793// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7794
  7795#COMMAND OUTPUT_DEF_FILE
  7796    OUTPUT_AUX_FILE DF_AUX_FILE_DEF FOR !1 !2 !3 !4 !5 !6 !7 !8 !9
  7797#ENDCOMMAND
  7798
  7799
  7800// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7801//
  7802//  Command:
  7803//      OUTPUT_FD_FILE fileNum {NUMBER logicalNum} {TO optPath}
  7804//
  7805//  Description:
  7806//      Output an FD file.
  7807//
  7808//  Parameters:
  7809//      fileNum:
  7810//          The number used to open the file.
  7811//      logicalNum:
  7812//          The logical number to be used to create the file. Only used if the
  7813//          file to be created is a new file (thus has no set file number).
  7814//      optPath:
  7815//          Optional filename/sequential device where output will be written.
  7816//
  7817// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7818
  7819#COMMAND OUTPUT_FD_FILE
  7820    OUTPUT_AUX_FILE DF_AUX_FILE_FD FOR !1 !2 !3 !4 !5 !6 !7 !8 !9
  7821#ENDCOMMAND
  7822
  7823
  7824// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7825//
  7826//  Command:
  7827//      DELETE_DB fileNumber | logicalNameString {IGNORE_ERRORS}
  7828//
  7829//  Description:
  7830//      Deletes a dGatafile. If IGNORE_ERRORS is passed, all errors
  7831//      are suppressed. This should be used when deleting a file that
  7832//      may or may not exist.
  7833//
  7834//  Parameters:
  7835//      fileNumber:
  7836//          Number of file to delete. File can be open but does not have
  7837//          to be
  7838//      logicalNameString:
  7839//          String containing the logical name of the file to delete.
  7840//
  7841// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7842
  7843#COMMAND DELETE_DB RL#G """IGNORE_ERRORS" .
  7844  #IFSAME !2 IGNORE_ERRORS
  7845    !A [] $0e2 !1 |CI1
  7846  #ELSE
  7847    !A [] $0e2 !1 |CI0
  7848  #ENDIF
  7849#ENDCOMMAND
  7850
  7851//-=-=-=-==-==--=-=-=-=-=--=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7852//
  7853// Command:
  7854//      COPY_RECORDS FileNumber1 TO fileNumber2 {NoOfRecords};
  7855//          {USING indexNum} {CALLBACK callback_id}
  7856//
  7857// Description:
  7858//      Copies NoOfRecords from fileNumber1 to fileNumber2. If USING is not
  7859//      specified, recnum is used otherwise records are copied using the
  7860//      specified indexNum. If CALLBACK is specified, the callback function
  7861//      in the object callback_id is called. FileNumber1 AND FileNumber2
  7862//      should have identical fields.
  7863//
  7864// Parameters:
  7865//      FileNumber1:
  7866//            Number of file FROM where  records are to be copied.
  7867//      FileNumber2:
  7868//            Number of fiel TO which recordsare to be copied.
  7869//      NoOfRecords:
  7870//            Number of records to be copied.
  7871//      indexNum:
  7872//            Index Number. If not specified, files are copied in the order of recnum.
  7873//      callback_id:
  7874//            Object id of the object containing the callback function.
  7875//
  7876//-=-=-=-==-==--=-=-=-=-=--=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7877
  7878#COMMAND COPY$RECORD$HELP "USING" #RLUG "CALLBACK" #RLUG .
  7879     !A [] $521 !2 !4
  7880#ENDCOMMAND
  7881
  7882#COMMAND COPY_RECORDS #RLUG "TO" #RLUG
  7883  #IF (!0 > 3)
  7884    #IFSAME !4 USING CALLBACK
  7885        !A [] $522 |CI0
  7886        #IFSAME !4 USING
  7887            #IF (!0>5)
  7888                COPY$RECORD$HELP !4 !5 !6 !7 !8 !9
  7889            #ELSE
  7890                COPY$RECORD$HELP !4 !5 CALLBACK |CI0 !7 !8 !9
  7891            #ENDIF
  7892        #ELSE
  7893            #IFSAME !4 CALLBACK
  7894                COPY$RECORD$HELP USING |CI0 !4 !5 !6 !7 !8 !9
  7895            #ELSE
  7896                COPY$RECORD$HELP !4 !5 !6 !7 !8 !9
  7897            #ENDIF
  7898        #ENDIF
  7899    #ELSE
  7900        !A [] $522 !4
  7901        #IF (!0>4)
  7902            #IFSAME !5 USING
  7903                #IF (!0>6)
  7904                    COPY$RECORD$HELP !5 !6 !7 !8 !9
  7905                #ELSE
  7906                    COPY$RECORD$HELP !5 !6 CALLBACK |CI0 !7 !8 !9
  7907                #ENDIF
  7908            #ELSE
  7909                #IFSAME !5 CALLBACK
  7910                    COPY$RECORD$HELP USING |CI0 !5 !6 !7 !8 !9
  7911                #ELSE
  7912                    COPY$RECORD$HELP !5 !6 !7 !8 !9
  7913                #ENDIF
  7914            #ENDIF
  7915        #ELSE
  7916            COPY$RECORD$HELP USING |CI0 CALLBACK |CI0
  7917        #ENDIF
  7918    #ENDIF
  7919 #ELSE
  7920    !A [] $522 |CI0
  7921    COPY$RECORD$HELP USING |CI0 CALLBACK |CI0
  7922 #ENDIF
  7923 !A [] $524 !1 !3
  7924#ENDCOMMAND
  7925
  7926//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7927//
  7928// Command:
  7929//     FIELD_MAP FileNumber <field_name> "TO" FieldNumber
  7930//
  7931// Description:
  7932//     converts <field_name> into field number and puts it in FieldNumber
  7933// Parameters:
  7934//      FileNumber:
  7935//            No of the file containing the fields.
  7936//      field_name:
  7937//            name of the field to be converted into number.
  7938//      FieldNumber:
  7939//            Value returned by FIELD_MAP
  7940//
  7941//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=---=-=-=-=-=-=--=-=-=-=-
  7942
  7943#COMMAND FIELD_MAP #RLUG #RLI "TO" #RLUG .
  7944   !A [] $525 !1 !2
  7945   !A [] $526 !4
  7946#ENDCOMMAND
  7947
  7948
  7949//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7950//
  7951// Command:
  7952//      LOAD_DRIVER driver_name
  7953//
  7954// Description:
  7955//      Loads a database driver
  7956//
  7957// Parameter:
  7958//      driver_name:
  7959//          Name of the database driver.
  7960//
  7961//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7962
  7963#COMMAND LOAD_DRIVER #RLI .
  7964   !A [] $527  !1
  7965#ENDCOMMAND
  7966
  7967//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7968//
  7969// Command:
  7970//      UNLOAD_DRIVER driver_name
  7971//
  7972// Description:
  7973//      Loads a database driver
  7974//
  7975// Parameter:
  7976//      driver_name:
  7977//          Name of the database driver.
  7978//
  7979//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7980
  7981#COMMAND UNLOAD_DRIVER #RlI .
  7982   !A [] $528  !1
  7983#ENDCOMMAND
  7984
  7985
  7986// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7987//
  7988//  Command:
  7989//      READ_HEX {CHANNEL channelNum} varName {numHexBytes}
  7990//
  7991//  Description:
  7992//      Read a stream of hex bytes from the sequential channel chosen. The
  7993//      stream must be in the form of a string containing two byte printable
  7994//      hex numbers, e.g., "616263" would correspond the the string "abc".
  7995//      The value is converted into ASCII before it is store in varName.
  7996//
  7997//  Parameters:
  7998//      channelNum:
  7999//          The number of the sequential device channel to be read from. If
  8000//          not specified, the currently active input channel is read from.
  8001//      varName:
  8002//          The variable to read the bytes into.
  8003//      numHexBytes:
  8004//          The number of two digit hex codes to read in, e.g., "616263" is
  8005//          3 hex codes (even though it is actually 6 bytes). If ommitted or
  8006//          zero, READ_HEX will read until it encounters the end of the line.
  8007//          If data is read which cannot be converted from hex to ascii,
  8008//          READ_HEX stops at that point.
  8009//
  8010// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8011
  8012#COMMAND READ_HEX
  8013  #IFSAME !1 CHANNEL
  8014    !A [] $10A |CI0 !2
  8015    #IF !0>2
  8016      #CHECK !3 _ULE
  8017      #CHECK !4 _RU
  8018      !A [] $110 !3 !4
  8019    #ENDIF
  8020  #ELSE
  8021    #CHECK !1 _ULEC
  8022    #CHECK !2 _RU
  8023    !A [] $110 !1 !2
  8024  #ENDIF
  8025#ENDCOMMAND
  8026
  8027
  8028// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8029//
  8030//  Command:
  8031//      WRITE_HEX {CHANNEL channelNum} {value}*n
  8032//
  8033//  Description:
  8034//      Writes any set of values (expressions, variables, etc.) to the chosen
  8035//      sequential channel in the form of a stream of two digit hex codes,
  8036//      e.g., the string "abc" would be written as "616263".
  8037//
  8038//  Parameters:
  8039//      channelNum:
  8040//          The number of the sequential device channel to be read from. If
  8041//          not specified, the currently active input channel is read from.
  8042//      value:
  8043//          Any variable, expression, etc. to be written out. The value is
  8044//          evaluated and converted to a string before being written, e.g.,
  8045//          a value of (1 + 1) would be converted to the string "2" and
  8046//          then written out as "50" which is the hex code corresponding to
  8047//          the character '2'.
  8048//
  8049// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8050
  8051#COMMAND WRITE$HEX$HELP
  8052  #IF (!0>0)
  8053    !A [] $10F !1
  8054    WRITE$HEX$HELP !2 !3 !4 !5 !6 !7 !8 !9
  8055  #ENDIF
  8056#ENDCOMMAND
  8057
  8058#COMMAND WRITE_HEX
  8059  #IFSAME !1 CHANNEL
  8060    !A [] $10A |CI1 !2
  8061    #IF !0>2
  8062      WRITE$HEX$HELP !3 !4 !5 !6 !7 !8 !9
  8063    #ENDIF
  8064  #ELSE
  8065    WRITE$HEX$HELP  !1 !2 !3 !4 !5 !6 !7 !8 !9
  8066  #ENDIF
  8067#ENDCOMMAND
  8068
  8069
  8070// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8071//
  8072//  Command:
  8073//      GET_CURSOR_VISIBLE
  8074//
  8075//  Description:
  8076//      Returns 0 if the cursor is hidden, non-zero if it is visible. NOTE:
  8077//      this only reflects whether the cursor will be shown during the next
  8078//      user input action, not whether it is currently shown.
  8079//
  8080// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8081
  8082#COMMAND GET_CURSOR_VISIBLE R#LGUC .
  8083    !A [] $154 !1
  8084#ENDCOMMAND
  8085
  8086
  8087// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8088//
  8089//  Command:
  8090//      SET_CURSOR_VISIBLE visibleFlag
  8091//
  8092//  Description:
  8093//      Sets the cursor hidden or displayable. NOTE: this only affects
  8094//      whether the cursor will be shown during the next user input action,
  8095//      not whether it is currently shown.
  8096//
  8097//  Parameters:
  8098//      visibleFlag
  8099//          If this value is non-zero, the cursor will be displayed. If zero,
  8100//          the cursor will be hidden.
  8101//
  8102// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8103
  8104#COMMAND SET_CURSOR_VISIBLE R#LGU .
  8105    !A [] $155 !1
  8106#ENDCOMMAND
  8107
  8108
  8109// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8110 //
  8111//  Command:
  8112//      COMPUTE_SCREEN_CRC {startX startY endX endY "TO"} crcVariable
  8113//
  8114//  Description:
  8115//      Returns a CRC for a region of the screen. This can be used by
  8116//      automated testing programs to verify that the screen has the
  8117//      expected display.
  8118//
  8119//  Parameters:
  8120//      startX, startY, endX, endY
  8121//          Starting and ending coordinates of the region to be CRC'd. If
  8122//          not given, the whole screen is checked.
  8123//      crcVariable
  8124//          A variable which will contain the CRC.
  8125//
  8126// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8127
  8128#COMMAND COMPUTE$CRC$HELP R#LGU R#LGU R#LGU R#LGU "TO" R#LGUC
  8129  !A [] $151 !1 !2
  8130  !A [] $152 !3 !4
  8131  !A [] $153 !6
  8132#ENDCOMMAND
  8133
  8134#COMMAND COMPUTE_SCREEN_CRC
  8135  #IFSAME !1 TO
  8136    COMPUTE$CRC$HELP |CI-1 |CI-1 |CI-1 |CI-1 !1 !2 !3 !4 !5 !6 !7 !8 !9
  8137  #ELSE
  8138    COMPUTE$CRC$HELP !1 !2 !3 !4 !5 !6 !7 !8 !9
  8139  #ENDIF
  8140#ENDCOMMAND
  8141
  8142
  8143//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8144//
  8145//  Command:
  8146//      CALL_DRIVER fileNumber driverName;
  8147//          FUNCTION driverFunction CALLBACK objectID;
  8148//          PASSING aString aString2 aLong RESULT returnValue
  8149//
  8150//   Descrtiption:
  8151//      A function call used directly access driver specific functions.
  8152//
  8153//   Parmeters:
  8154//       fileNumber
  8155//           Number of the file
  8156//       driverName
  8157//           Name of the driver
  8158//       driverFunction
  8159//           Numeric value corresponding to a driver specific function
  8160//       returnValue
  8161//           Value returned by CALL_DRIVER
  8162//       aString
  8163//           A string
  8164//       aString2
  8165//           Another string
  8166//       aLoing
  8167//           A long
  8168//       objectID
  8169//           Object id for an object that will be sent the GET_CALLBACK
  8170//           message
  8171//
  8172//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8173
  8174#COMMAND CALL$DRIVER$1 #RLUG #RLDNIGU "FUNCTION" #RGUL "CALLBACK" #RGUL .
  8175    !A [] $529 !1 !2
  8176    !A [] $52A !4 !6
  8177#ENDCOMMAND
  8178
  8179#COMMAND CALL$DRIVER$2 "PASSING" #CRUG #CRUG #RLUG "RESULT" #RLUG .
  8180    !A [] $530 !4
  8181    !A [] $52B !2 !3
  8182    !A [] $082 STRMARK !6
  8183#ENDCOMMAND
  8184
  8185#COMMAND CALL_DRIVER
  8186    CALL$DRIVER$1 !1 !2 !3 !4 !5 !6
  8187    CALL$DRIVER$2 !7 !8 !9
  8188#ENDCOMMAND
  8189
  8190
  8191//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8192//
  8193//   Command:
  8194//       LOAD_DEF defName ONTO structureHandle
  8195//
  8196//   Descrtiption:
  8197//       Will load the file definition from defName on top of the structure
  8198//       defined by structureHandle. While the structure may be for an
  8199//       existing file, no structure operations (other than STRUCTURE_START)
  8200//       should be performed on structureHandle prior to calling LOAD_DEF.
  8201//
  8202//   Parmeters:
  8203//       structureHandle
  8204//           Handle to an new or modified structure.
  8205//       defName
  8206//           Name of the sequential device which contains the .DEF
  8207//           specification.
  8208//
  8209//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8210
  8211#COMMAND LOAD_DEF #RLUG "ONTO" #RLUG .
  8212    !A [] $52F !1 !3
  8213#ENDCOMMAND
  8214
  8215
  8216//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8217//
  8218//   Command:
  8219//       SET_FILELIST newName
  8220//
  8221//   Descrtiption:
  8222//       Sets the filelist.cfg file to the name specified. If the specified
  8223//       file cannot be opened, the current filelist file remains unchanged.
  8224//
  8225//   Parmeters:
  8226//       newName
  8227//           The name of the file to use as filelist.cfg
  8228//
  8229//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8230
  8231#COMMAND SET_FILELIST RL#UGDNI .
  8232    SET_ATTRIBUTE DF_FILELIST_NAME TO !1
  8233#ENDCOMMAND
  8234
  8235
  8236//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8237//
  8238//   Command:
  8239//       GET_FILELIST Name
  8240//
  8241//   Descrtiption:
  8242//       Gets the name of the current filelist file.
  8243//
  8244//   Parmeters:
  8245//       Name
  8246//           The name of the file being used as filelist.
  8247//
  8248//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8249
  8250#COMMAND GET_FILELIST RL#UGDNI .
  8251    GET_ATTRIBUTE DF_FILELIST_NAME TO !1
  8252#ENDCOMMAND
  8253
  8254
  8255// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8256//
  8257//  Command:
  8258//      LOGIN ServerName UserName Password {DriverName}
  8259//
  8260//  Description:
  8261//      Login to the specified server using the passed user and password.
  8262//
  8263//  Parameters
  8264//      ServerName
  8265//          Name of the server (driver specific) to be logged into
  8266//
  8267//      UserName
  8268//          Name of the user to be used for the login
  8269//
  8270//      Password
  8271//          Password to use for the login
  8272//
  8273//      DriverName
  8274//          Optional database driver to use for the login. API defaults
  8275//          to attempting a login with all drivers.
  8276//
  8277// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8278
  8279#COMMAND LOGIN #ULGR$ #ULGR$ #ULGR$ #ULG$ .
  8280  !A [] $4c4 !1 !4
  8281  !A [] $4c5 !2 !3
  8282#ENDCOMMAND
  8283
  8284
  8285//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8286//
  8287//   Commands:
  8288//       ENUM_LIST, DEFINE, and END_ENUM_LIST
  8289//
  8290//   Descrtiption:
  8291//       Altogether, these commands can be used to enumerate symbol
  8292//       replacements for lists of symbols.
  8293//
  8294//       DEFINE outside of an ENUM/ENUM_LIST block can be used to define
  8295//       individual symbolic replacements, and to define "flags". (However,
  8296//       there is no UNDEFINE. Sorry.)
  8297//
  8298//   Parmeters:
  8299//       ENUM_LIST and END_ENUM_LIST take no parameters.
  8300//       DEFINE supports several syntaxes:
  8301//
  8302//       DEFINE symbol
  8303//          If outside an enum list, defines a symbolic replacement named
  8304//          symbol as |CI1 (to be used with #IFDEF compiler directive).
  8305//
  8306//       DEFINE symbol1 symbol2 ...
  8307//          If within an enum list, defines a symbolic replacement named
  8308//          symbol1 as a constant integer one greater than the previous
  8309//          symbolic replacement in the enum list (and symbol2 and each
  8310//          additional parameter are defined one greater than the symbol
  8311//          before it).
  8312//
  8313//       DEFINE symbol FOR originalSymbol
  8314//          If outside an enum list, defines a symbolic replacement named
  8315//          symbol for originalSymbol. In this instance, originalSymbol may
  8316//          be any valid symbol name or constant value.
  8317//
  8318//       DEFINE symbol FOR constInt
  8319//          If within an enum list, defines a symbolic replacement named
  8320//          symbol for the constant integer constInt. Only constant integers
  8321//          can be used for constInt with the AS syntax option within enum
  8322//          lists.
  8323//
  8324//  Examples:
  8325//
  8326//  enumeration_list
  8327//      define ddd          // starts at 0 by default
  8328//      define eee          // 1
  8329//      define fff ggg hhh  // 2 3 4
  8330//  end_enumeration_list
  8331//
  8332//  enum_list
  8333//      define rrr for 5     // start at 5
  8334//      define sss          // 6
  8335//      define ttt for 21    // jump to 21
  8336//      define uuu          // 22
  8337//  end_enum_list
  8338//
  8339//  define aaa for ttt       // generic symbolic replacements
  8340//  define aaa for "Hello"
  8341//
  8342//  define zzz              // defines zzz as |CI1 (to be used with #IFDEF)
  8343//
  8344// Note: Defining multiple "flags" (define sss ttt) is not allowed in order
  8345// to allow proper type-checking. (The compiler's preprocessor substitutes
  8346// the symbols too early; therefore, it becomes impossible to differentiate
  8347// the allowable syntaxes if multiple arguments are allowed.)
  8348//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8349
  8350#COMMAND ENUMERATION_LIST .
  8351  #IF (!Zs=1)
  8352    #ERROR 1001 ENUMERATION LISTS CANNOT BE BE NESTED
  8353  #ENDIF
  8354  #SET ZS$ 1 // enum_flag
  8355  #SET ZT$ 0 // initial enum_value
  8356#ENDCOMMAND
  8357
  8358#COMMAND DEFINE R
  8359  #IFSAME !2 FOR
  8360    #IF (!Zs=0)     // if not enum
  8361      #IFDEF !1     // ignore redefinition of symbols (only if not enum)
  8362      #ELSE
  8363        #IFSAME !1 $0     // ignore redefinition if already defined as FALSE
  8364        #ELSE
  8365          #IFSAME !1 $1   // ignore redefinition if already defined as TRUE
  8366          #ELSE
  8367            #CHECK !4 .
  8368            #REPLACE !1 !3
  8369          #ENDIF
  8370        #ENDIF
  8371      #ENDIF
  8372    #ELSE           // else enum
  8373      #IFTYPE !3 "I"
  8374        #IFCLASS !3 "C"
  8375          #CHECK !4 .
  8376          #REPLACE !1 !3
  8377          #SET ZT$ (!3+1)
  8378        #ELSE
  8379          #ERROR 1001 ENUMERATION VALUE MUST BE A CONSTANT
  8380        #ENDIF
  8381      #ELSE
  8382        #ERROR 1001 ENUMERATION VALUE MUST BE A CONSTANT
  8383      #ENDIF
  8384    #ENDIF
  8385  #ELSE             // not "FOR"
  8386    #IF (!Zs=0)     // if not enum
  8387      #CHECK !2 .
  8388      #IFDEF !1     // define for |CI1 if they were previously undefined
  8389        #IFSAME !1 |CI1
  8390        #ELSE
  8391          #ERROR 1001 "ATTEMPT TO REDEFINE SYMBOL FOR DIFFERENT VALUE"
  8392        #ENDIF
  8393      #ELSE
  8394        #IFSUB '!1'
  8395          #ERROR 1001 "ATTEMPT TO REDEFINE SYMBOL FOR DIFFERENT VALUE"
  8396        #ELSE
  8397          #REPLACE !1 |CI1
  8398        #ENDIF
  8399      #ENDIF
  8400    #ELSE
  8401      #REPLACE !1 |CI!Zt
  8402      #SET ZT$ !ZT
  8403      #IF (!0>1)
  8404        DEFINE !2 !3 !4 !5 !6 !7 !8 !9
  8405      #ENDIF
  8406    #ENDIF
  8407  #ENDIF
  8408#ENDCOMMAND
  8409
  8410#COMMAND END_ENUMERATION_LIST .
  8411  #IF (!Zs=0)     // if not enum
  8412    #ERROR 1001 END_ENUMERATION_LIST WITHOUT ENUMERATION_LIST COMMAND
  8413  #ELSE
  8414    #SET ZS$ 0 // reset enum_flag
  8415  #ENDIF
  8416#ENDCOMMAND
  8417
  8418
  8419//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8420//
  8421//   Command:
  8422//       ENTRY_NAME_ITEM itemName file.field ...
  8423//
  8424//   Description:
  8425//      Just like Entry_Item except the first parameter is a (global) Item
  8426//      Name.
  8427//
  8428//   Parameters:
  8429//       itemName
  8430//           The (global) name of the item being defined/created.
  8431//
  8432//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8433
  8434#COMMAND ENTRY_NAME_ITEM R R
  8435  #IFDEF !1            // Already exists?
  8436    #IFTYPE !1 "CI"    // If a constant integer
  8437      #IF (!1=!Zg)     // of the correct value...all is well.
  8438      #ELSE            // Else, It is a duplicate item.
  8439        #ERROR 1000 DUPLICATE ITEM NAME
  8440      #ENDIF
  8441    #ELSE              // else defined as something else.
  8442      #ERROR 1000 NAME ALREADY DEFINED
  8443    #ENDIF
  8444  #ELSE                // this names the item (!Zg is the trick)
  8445    #REPLACE !1 !Zg
  8446  #ENDIF               // now a regular entry_Item
  8447  ENTRY_ITEM !2 !3 !4 !5 !6 !7 !8  !9
  8448#ENDCOMMAND
  8449
  8450
  8451//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8452//
  8453//   Command:
  8454//       ON_NAME_ITEM itemName itemValue ...
  8455//
  8456//   Description:
  8457//      Just like On_Item except the first parameter is a (global) Item
  8458//      Name.
  8459//
  8460//   Parameters:
  8461//       itemName
  8462//           The (global) name of the item being defined/created.
  8463//
  8464//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8465
  8466#COMMAND ON_NAME_ITEM R
  8467  #IFDEF !1            // Already exists?
  8468    #IFTYPE !1 "CI"    // If a constant integer
  8469      #IF (!1=!Zg)     // of the correct value...all is well.
  8470      #ELSE            // Else, It is a duplicate item.
  8471        #ERROR 1000 DUPLICATE ITEM NAME
  8472      #ENDIF
  8473    #ELSE              // else defined as something else.
  8474      #ERROR 1000 NAME ALREADY DEFINED
  8475    #ENDIF
  8476  #ELSE                // this names the item (!Zg is the trick)
  8477    #REPLACE !1 !Zg
  8478  #ENDIF               // now a regular entry_Item
  8479  ON_ITEM !2 !3 !4 !5 !6 !7 !8  !9
  8480#ENDCOMMAND
  8481
  8482
  8483// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8484//
  8485//  Command:
  8486//      BEGIN_TRANSACTION
  8487//
  8488//  Description:
  8489//      Starts a transaction on any open files.
  8490//
  8491// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8492
  8493#COMMAND BEGIN_TRANSACTION .
  8494  #SET N$ !N
  8495  #PUSH !R
  8496  #XPUSH !n $INIT  // Init IF/ELSE stack at this nesting level.
  8497  #IFIND //INCLUDE JUMPS IF INDICATORS ON LINE.
  8498    // GOTO BEGIN$TRAN$!r
  8499    !A [] $041 |CI0
  8500    #FREF BEGIN$TRAN$!r !a
  8501    #$ !A 0 0 0 $041 |CL0
  8502    #FREF END$TRAN$!r !a
  8503  #ENDIF
  8504  #$ BEGIN$TRAN$!r:
  8505  #$ BEGIN$!r:
  8506  #$ !A [0 0 0] $0C7 |CI0
  8507  #FREF END$TRAN$!r !a
  8508#ENDCOMMAND
  8509
  8510
  8511// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8512//
  8513//  Command:
  8514//      END_TRANSACTION
  8515//
  8516//  Description:
  8517//      Attempts to commit all operations in the current transaction.
  8518//
  8519// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8520
  8521#COMMAND END_TRANSACTION .
  8522  #POP S$
  8523  !A [] $0C8
  8524  #IFDEF WHILE$!s
  8525    !A [] $041 WHILE$!s
  8526  #ENDIF
  8527  END$!s:
  8528  END$TRAN$!s:
  8529  #SET N$ !n-1
  8530#ENDCOMMAND
  8531
  8532
  8533// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8534//
  8535//  Command:
  8536//      ABORT_TRANSACTION
  8537//
  8538//  Description:
  8539//      Aborts any currently active transactions, unlocking the files.
  8540//
  8541// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8542
  8543#COMMAND ABORT_TRANSACTION .
  8544  !A [] $0EB
  8545#ENDCOMMAND
  8546
  8547
  8548//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8549//
  8550//   Command:
  8551//       SET_RESOURCE_LIBRARY newName
  8552//
  8553//   Description:
  8554//       Tells the program to look in the specified file when opening
  8555//       resources (with the DIRECT_INPUT command). Specifying "" (the empty
  8556//       string) as the newName resets the resource library to look in the
  8557//       currently executing program for resources. The new library must be a
  8558//       properly compiled DataFlex program; all commands and non-resource
  8559//       data in the program/library are ignored. The filename MUST include
  8560//       the extension, but is not required to be .FLX. If the specified
  8561//       file cannot be opened, an error occurs and the current resource
  8562//       library continues to be used.
  8563//
  8564//       Note: Any resources that are currently open when the resource
  8565//       library is changed remain open; i.e. you may continue to read from
  8566//       them. The setting of the resource library only affects the
  8567//       DIRECT_INPUT command when opening resources.
  8568//
  8569//   Parameters:
  8570//       newName
  8571//           The name of the file to use as the library of resources.
  8572//
  8573//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8574
  8575#COMMAND SET_RESOURCE_LIBRARY #RLUGOB .
  8576  !A [] $113 !1
  8577#ENDCOMMAND
  8578
  8579
  8580//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8581//
  8582//  Command:
  8583//      GET_RESOURCE_NAME resourceName|resourceId TO stringVariable
  8584//
  8585//   Description:
  8586//      A command to retrieve the name of a resource at runtime. For the first
  8587//      parameter, you may pass either the resource name (not in quotes) (I
  8588//      know that sounds strange, and you'd probably never do it, but it WILL
  8589//      work) or the integer value of the resource id.
  8590//
  8591//   Parameters:
  8592//       resourceId
  8593//            Integer value of a resource id.
  8594//       stringVariable
  8595//            Variable to return the resource name to.
  8596//
  8597//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8598
  8599#COMMAND GET_RESOURCE_NAME R#LG "TO" RL#OBUGDNI .
  8600  #IFDEF !1
  8601    !A [] $114 !1 !3
  8602  #ELSE
  8603    !A [] $114 !1.RSC !3
  8604  #ENDIF
  8605#ENDCOMMAND
  8606
  8607
  8608//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8609//
  8610//  Command:
  8611//      ADD value TO variable
  8612//
  8613//   Description:
  8614//      Adds the specified value to the target variable.
  8615//
  8616//   Parameters:
  8617//       value:
  8618//            Any expression
  8619//       variable
  8620//            Any window, variable, etc. that can receive a value
  8621//
  8622//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8623
  8624#COMMAND ADD R#OBLG "TO" UR#OLGC .
  8625  Move (!3 + !1) to !3
  8626#ENDCOMMAND
  8627
  8628
  8629//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8630//
  8631//  Command:
  8632//      SUBTRACT value FROM variable
  8633//
  8634//   Description:
  8635//      Subtracts the specified value to the target variable.
  8636//
  8637//   Parameters:
  8638//       value:
  8639//            Any expression
  8640//       variable
  8641//            Any window, variable, etc. that can receive a value
  8642//
  8643//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8644
  8645#COMMAND SUBTRACT R#OBLG "FROM" UR#OLGC .
  8646  Move (!3 - !1) to !3
  8647#ENDCOMMAND
  8648
  8649
  8650//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8651//
  8652//  Command:
  8653//      BREAK [BEGIN|END]
  8654//
  8655//   Description:
  8656//      Exit or jump to start of a control loop (WHILE, REPEAT, FOR). Default
  8657//      action is to exit if no argument supplied.
  8658//
  8659//   Parameters:
  8660//      BEGIN:
  8661//          Jump to start of loop.
  8662//      END:
  8663//          Jump to end of loop and exit.
  8664//
  8665//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8666
  8667#COMMAND BREAK "BEGIN""END""" .
  8668  #POP S$
  8669  #PUSH !s
  8670  #IFSAME !1 BEGIN
  8671    Goto BEGIN$!s
  8672  #ELSE
  8673    Goto END$!s
  8674  #ENDIF
  8675#ENDCOMMAND
  8676
  8677//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8678//
  8679//  Command:
  8680//      HARD$EXIT <integer>
  8681//
  8682//  THIS COMMAND IS INTENDED FOR INTERNAL DAC TESTING USE ONLY
  8683//  USE WITHIN AN APPLICATION WILL PROBABLY CAUSE SYSTEM INTEGRITY
  8684//  PROBLEMS!
  8685//
  8686//  This command causes the runtime to do an exit(#) without
  8687//  any internal cleanup.  It is intended for testing server
  8688//  transaction support.
  8689//
  8690//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8691
  8692#COMMAND HARD$EXIT R#LG  .
  8693    !A [] $54 !1
  8694#ENDCOMMAND
  8695
  8696//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8697//
  8698//  Command:
  8699//      netware_get_tts_flag <path name> to <integer boolean>
  8700//
  8701//  THIS COMMAND IS INTENDED FOR INTERNAL DAC TESTING USE ONLY!
  8702//
  8703//  This command returns the state of the TTS flag of a file (by path name),
  8704//  returns false (0) if not a tts volume.
  8705//
  8706//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8707
  8708#COMMAND NETWARE_GET_TTS_FLAG R#LG "TO" RL#OBUGD .
  8709    !A [] $30D !1 !3
  8710#ENDCOMMAND
  8711
  8712//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8713//
  8714//  Command:
  8715//      netware_set_tts_flag <path name> to <integer boolean>
  8716//
  8717//  THIS COMMAND IS INTENDED FOR INTERNAL DAC TESTING USE ONLY!
  8718//
  8719//  This command sets the state of the TTS flag of a file (by path name),
  8720//  returns [FOUND] if status could be set.
  8721//
  8722//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8723
  8724#COMMAND NETWARE_SET_TTS_FLAG R#LG "TO" RL#OBUGD .
  8725    !A [] $30E !1 !3
  8726#ENDCOMMAND
  8727
  8728//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8729//
  8730//  Command:
  8731//      netware_get_available <integer boolean>
  8732//
  8733//  THIS COMMAND IS INTENDED FOR INTERNAL DAC TESTING USE ONLY!
  8734//
  8735//  This command returns non-zero if netware is loaded.
  8736//
  8737//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8738
  8739#COMMAND NETWARE_GET_AVAILABLE RL#OBUGD .
  8740    !A [] $30F !1 |CI0
  8741#ENDCOMMAND
  8742
  8743//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8744//
  8745//  Command:
  8746//      VALID_DRIVE driveLetter retVal
  8747//
  8748//  Description:
  8749//      This command returns non-zero if the drive is a valid drive letter
  8750//      This command is only useful under dos/os2/windows
  8751//
  8752//  Parameters:
  8753//      driveLetter
  8754//             Drive letter to check if valid. Must be a letter.
  8755//      retVal
  8756//             Integer results of command
  8757//
  8758//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8759
  8760#COMMAND VALID_DRIVE R R
  8761   !A [] $581 !1 !2
  8762#ENDCOMMAND
  8763
  8764//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8765//
  8766//  Command:
  8767//
  8768//      SET_DIRECTORY directory
  8769//
  8770//  Description:
  8771//      Sets the current directory. The directory argument may contain a drive
  8772//      letter to set the current directory on a particular drive.
  8773//
  8774//  Parameters:
  8775//      directory
  8776//          The new current directory to be set. The directory argument may
  8777//          contain a drive letter to set the current directory on a particular
  8778//          drive.
  8779//
  8780//  NOTE: This command will be removed for final VDF 4.0 release. A new message
  8781//        will be added to provide replacement functionality. KCR
  8782//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8783
  8784#COMMAND SET_DIRECTORY R
  8785   !A [] $58C !1
  8786#ENDCOMMAND
  8787
  8788//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8789//
  8790//  Command:
  8791//
  8792//      FILE_EXIST fileName result
  8793//
  8794//  Description:
  8795//      Returns non-zero if the specified file exists.
  8796//
  8797//  Parameters:
  8798//      fileName
  8799//          The name of the file to check the existance of.
  8800//      result
  8801//          Non-zero if the file exists or zero if does not exist.
  8802//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8803
  8804#COMMAND FILE_EXIST R R
  8805   !A [] $58D !1 !2
  8806#ENDCOMMAND
  8807
  8808//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8809//
  8810//  Command:
  8811//
  8812//      GET_DIRECTORY {drive} currentDirectory
  8813//
  8814//  Description:
  8815//      Returns the current directory.
  8816//
  8817//  Parameters:
  8818//      {drive}
  8819//          The drive letter to get the current directory for. If drive is
  8820//          not specifed then the current drive is assumed.
  8821//      currentDirectory
  8822//          The current directory for the appropriate drive.
  8823//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8824
  8825#COMMAND GET_DIRECTORY R
  8826    #IF (!0 > 1)
  8827        !A [] $58E !1 !2
  8828    #ELSE
  8829        !A [] $58E |CS"" !1
  8830    #ENDIF
  8831#ENDCOMMAND
  8832
  8833//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8834//
  8835//  Command:
  8836//
  8837//      MAKE_DIRECTORY directory {permissions}
  8838//
  8839//  Description:
  8840//      Makes a directory on the current drive. Uses the optional permissions
  8841//      value for the directory if it is specified.
  8842//
  8843//  Parameters:
  8844//      directory
  8845//          The name of the new directory to be made.
  8846//      {permissions}
  8847//          The access permissions of the new directory. If this is not
  8848//          specified then the default is DF_FLEX_ALL_RIGHTS.
  8849//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8850
  8851#COMMAND MAKE_DIRECTORY R
  8852    #IF !0 < 2
  8853        !A [] $58F !1 |CI2047
  8854    #ELSE
  8855        !A [] $58F !1 !2
  8856    #ENDIF
  8857#ENDCOMMAND
  8858
  8859//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8860//
  8861//  Command:
  8862//
  8863//      REMOVE_DIRECTORY directory
  8864//
  8865//  Description:
  8866//      Removes the specified directory.
  8867//
  8868//  Parameters:
  8869//      directory
  8870//          The name of the directory to be removed.
  8871//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8872
  8873#COMMAND REMOVE_DIRECTORY R
  8874   !A [] $590 !1
  8875#ENDCOMMAND
  8876
  8877//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8878//
  8879//  Command:
  8880//
  8881//      MAKE_TEMP_FILE tempExtension tempFile
  8882//
  8883//  Description:
  8884//      Makes a temporary file with a unique name with the specified extension
  8885//      and returns the unique name that was generated.
  8886//
  8887//  Parameters:
  8888//      tempExtension
  8889//          The extension to use when making the temporary file.
  8890//      tempFile
  8891//          The name of the temporary file that is returned.
  8892//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8893
  8894#COMMAND MAKE_TEMP_FILE R R
  8895   !A [] $591 !1 !2
  8896#ENDCOMMAND
  8897
  8898//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8899//
  8900//  Command:
  8901//
  8902//      GET_FILE_MOD_TIME fileName "TO" date {hour} {minute} {second}
  8903//
  8904//  Description:
  8905//      Returns the file modified date/time stamp for the specified file.
  8906//
  8907//  Parameters:
  8908//      fileName
  8909//          The file to get the date/time stamp for.
  8910//      date
  8911//          The date the file was last modifed.
  8912//      {hour}
  8913//          The hour of the day that the file was last modified.
  8914//      {minute}
  8915//          The minute that the file was last modified.
  8916//      {second}
  8917//          The second that the file was last modified.
  8918//
  8919//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8920
  8921#COMMAND GET_FILE_MOD_TIME R "TO" R
  8922    !A [] $592  !1 !3
  8923
  8924    #IF !0 > 3
  8925        !A [] $593 !4
  8926    #ENDIF
  8927
  8928    #IF !0 > 4
  8929        !A [] $594  !5
  8930    #ENDIF
  8931
  8932    #IF !0 > 5
  8933        !A [] $595 !6
  8934    #ENDIF
  8935
  8936#ENDCOMMAND
  8937
  8938//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8939//
  8940//  Command:
  8941//
  8942//      SET_FILE_MOD_TIME fileName "TO" date {hour} {minute} {second}
  8943//
  8944//  Description:
  8945//      Sets the file modified date/time stamp for the specified file.
  8946//
  8947//  Parameters:
  8948//      fileName
  8949//          The file to set the date/time stamp for.
  8950//      date
  8951//          The new date that the file was modified.
  8952//      {hour}
  8953//          The new hour that the file was modified.
  8954//      {minute}
  8955//          The new minute that the file was modified.
  8956//      {second}
  8957//          The new second that the file was modified.
  8958//
  8959//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8960
  8961#COMMAND SET_FILE_MOD_TIME R "TO" R
  8962    !A []   $597 !1 !3  //Date
  8963
  8964    #IF (!0 > 3)
  8965        !A [] $598 !4   //Hour
  8966    #ENDIF
  8967
  8968    #IF (!0 > 4)
  8969        !A [] $599 !5   //Minutes
  8970    #ENDIF
  8971
  8972    #IF (!0 > 5)
  8973        !A [] $59A !6   //Seconds
  8974    #ENDIF
  8975
  8976    !A []   $596 !1
  8977#ENDCOMMAND
  8978
  8979// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8980//
  8981//  Command:
  8982//      SET_VIDEO_MODE
  8983//      GET_VIDEO_MODE
  8984//
  8985//  Description:
  8986//      Video Modes for DOS
  8987//
  8988// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  8989
  8990
  8991#COMMAND SET_VIDEO_MODE "TO" _RUSD#
  8992  !A [] $150 !2
  8993#ENDCOMMAND
  8994
  8995#COMMAND GET_VIDEO_MODE "TO" _RUSD#
  8996  !A [] $14F !2
  8997#ENDCOMMAND
  8998
  8999
  9000// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9001//
  9002//  Command:
  9003//      DEFINE_SYMBOL
  9004//
  9005//  Description:
  9006//      Like #REPLACE except it checks if the symbol exists first.
  9007//
  9008// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9009
  9010#COMMAND DEFINE_SYMBOL R "FOR" R
  9011  #IFDEF !1
  9012  #ELSE
  9013    #REPLACE !1 !3
  9014  #ENDIF
  9015#ENDCOMMAND
  9016
  9017// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9018//
  9019//  Command:
  9020//      GET_DATE_ATTRIBUTE
  9021//
  9022//  Description:
  9023//
  9024// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9025
  9026#COMMAND GET_DATE_ATTRIBUTE R "TO" R .
  9027    !A [] $2E1 !1 !3
  9028#ENDCOMMAND
  9029
  9030// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9031//
  9032//  Command:
  9033//      SET_DATE_ATTRIBUTE
  9034//
  9035//  Description:
  9036//
  9037// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9038
  9039#COMMAND SET_DATE_ATTRIBUTE R "TO" R .
  9040    !A [] $2E2 !1 !3
  9041#ENDCOMMAND
  9042
  9043#IFDEF IS$WINDOWS
  9044#ELSE
  9045
  9046//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9047//
  9048//  Command:
  9049//      SET_GROUP_ID groupId
  9050//
  9051//  Description:
  9052//      This command sets the group id to be used.
  9053//
  9054//  Parameters:
  9055//      groupId
  9056//           The group id to set as the current group id
  9057//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9058
  9059#COMMAND SET_GROUP_ID R
  9060    !A []   $582    !1
  9061#ENDCOMMAND
  9062
  9063//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9064//
  9065//  Command:
  9066//
  9067//      SET_USER_ID userId
  9068//
  9069//  Description:
  9070//      This command sets the user id to be used.
  9071//
  9072//  Parameters:
  9073//      userId
  9074//           The user id to set as the current user id
  9075//
  9076//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9077
  9078#COMMAND SET_USER_ID R
  9079    !A []   $583    !1
  9080#ENDCOMMAND
  9081
  9082//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9083//
  9084//  Command:
  9085//
  9086//      GET_GROUP_ID retVal
  9087//
  9088//  Description:
  9089//      This command returns the current group id.
  9090//
  9091//  Parameters:
  9092//      retVal
  9093//           the value returned is the current user group id
  9094//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9095
  9096#COMMAND GET_GROUP_ID R
  9097    !A []   $584    !1
  9098#ENDCOMMAND
  9099
  9100//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9101//
  9102//  Command:
  9103//
  9104//      GET_EFFECTIVE_GROUP_ID retVal
  9105//
  9106//  Description:
  9107//      This command returns the current effective group id. This may be
  9108//      different from the actual group id if, say, the user has become
  9109//      superuser under unix.
  9110//
  9111//  Parameters:
  9112//      retVal
  9113//           the value returned is the current effective user group id
  9114//
  9115//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9116
  9117#COMMAND GET_EFFECTIVE_GROUP_ID R
  9118    !A []   $585    !1
  9119#ENDCOMMAND
  9120
  9121//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9122//
  9123//  Command:
  9124//
  9125//      GET_USER_ID retVal
  9126//
  9127//  Description:
  9128//      This command returns the current user id.
  9129//
  9130//  Parameters:
  9131//      retVal
  9132//           the value returned is the current user id
  9133//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9134
  9135#COMMAND GET_USER_ID R
  9136    !A []   $586    !1
  9137#ENDCOMMAND
  9138
  9139//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9140//
  9141//  Command:
  9142//
  9143//      GET_EFFECTIVE_USER_ID retVal
  9144//
  9145//  Description:
  9146//      This command returns the current effective user id. This may be
  9147//      different from the actual user id if, say, the user has become
  9148//      superuser under unix.
  9149//
  9150//  Parameters:
  9151//      retVal
  9152//           the value returned is the current effective user group id
  9153//
  9154//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9155
  9156#COMMAND GET_EFFECTIVE_USER_ID R
  9157    !A []   $587    !1
  9158#ENDCOMMAND
  9159
  9160//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9161//
  9162//  Command:
  9163//
  9164//      GET_PERMISSION fileName "TO" retVal
  9165//
  9166//  Description:
  9167//      This command returns the current access privledeges for the specified
  9168//      file
  9169//
  9170//  Parameters:
  9171//      fileName
  9172//          The name of the file to check the permissions for
  9173//      retVal
  9174//          An value containing all the permission bits for the file
  9175//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9176
  9177#COMMAND GET_PERMISSION R "TO" R
  9178    !A []   $588    !1 !3
  9179#ENDCOMMAND
  9180
  9181//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9182//
  9183//  Command:
  9184//
  9185//      SET_PERMISSION fileName "TO" permissions
  9186//
  9187//  Description:
  9188//      This command sets the access privledeges for the specified file.
  9189//      The various permissions must be and'ed together to form one argument
  9190//
  9191//  Parameters:
  9192//      fileName
  9193//          The name of the file to set the permissions for
  9194//      permissions
  9195//          An value containing all the permission bits for the file and'ed
  9196//          together to form one integer value
  9197//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9198
  9199#COMMAND SET_PERMISSION R "TO" R
  9200    !A []   $589    !1 !3
  9201#ENDCOMMAND
  9202
  9203//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9204//
  9205//  Command:
  9206//
  9207//      ADD_PERMISSION fileName permissions
  9208//
  9209//  Description:
  9210//      This command adds the requested access privledeges for the specified
  9211//      file to the access permissions already set for this file.
  9212//      The various permissions must be and'ed together to form one argument.
  9213//      These permission bits will then be and'ed together with the existing
  9214//      permission bits for the file.
  9215//
  9216//  Parameters:
  9217//      fileName
  9218//          The name of the file to add the permissions for
  9219//      permissions
  9220//          An value containing the permission bits to be changed for the file
  9221//          and'ed together to form one integer value
  9222//
  9223//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9224
  9225#COMMAND ADD_PERMISSION R R
  9226    !A []   $58A    !1 !2
  9227#ENDCOMMAND
  9228
  9229//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9230//
  9231//  Command:
  9232//
  9233//      DELETE_PERMISSION fileName permissions
  9234//
  9235//  Description:
  9236//      This command removes the requested access privledeges for the specified
  9237//      file from the access permissions already set for this file.
  9238//      The various permissions must be and'ed together to form one argument
  9239//
  9240//  Parameters:
  9241//      fileName
  9242//          The name of the file to remove the permissions for
  9243//      permissions
  9244//          An value containing the permission bits to be removed for the file
  9245//          and'ed together to form one integer value
  9246//
  9247//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9248
  9249#COMMAND DELETE_PERMISSION R R
  9250    !A []   $58B    !1 !2
  9251#ENDCOMMAND
  9252
  9253//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9254//
  9255//  Command:
  9256//
  9257//      SET_FILE_OWNER fileName "TO" owner {group}
  9258//
  9259//  Description:
  9260//      Sets the file owner of the specifed file and optionally sets the
  9261//      group id of the file.
  9262//
  9263//  Parameters:
  9264//      fileName
  9265//          The file to set the owner for.
  9266//      owner
  9267//          The new owner for the file.
  9268//      {group}
  9269//          The new group id for the file.
  9270//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9271
  9272#COMMAND SET_FILE_OWNER R "TO" R
  9273    #IF (!0 > 3)
  9274        !A [] $59D !3 !4
  9275    #ELSE
  9276        !A [] $59D !3  0
  9277    #END
  9278
  9279    !A [] $59C !1
  9280#ENDCOMMAND
  9281
  9282//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9283//
  9284//  Command:
  9285//
  9286//      GET_FILE_OWNER fileName "TO" owner {group}
  9287//
  9288//  Description:
  9289//      Gets the file owner of the specifed file and optionally gets the
  9290//      group id of the file.
  9291//
  9292//  Parameters:
  9293//      fileName
  9294//          The file to get the owner for.
  9295//      owner
  9296//          The owner of the file.
  9297//      {group}
  9298//          The group id of the file.
  9299//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  9300
  9301#COMMAND GET_FILE_OWNER R "TO" R
  9302    !A [] $59B !1 !3
  9303
  9304    #IF (!0 > 3)
  9305        !A [] $59C !4
  9306    #ENDIF
  9307#ENDCOMMAND
  9308
  9309#ENDIF
  9310
  9311#COMMAND SET_REFRESH_AFTER_CHAIN R .
  9312    !A [] $EC !1
  9313#ENDCOMMAND
  9314
  9315#COMMAND GET_REFRESH_AFTER_CHAIN R .
  9316    !A [] $ED !1
  9317#ENDCOMMAND
  9318
  9319
  9320// JJT-5.1
  9321// Changed commands
  9322
  9323#COMMAND COMPILER_WARNINGS "ON""OFF""OLD""OLDOFF"
  9324  #IFSAME !1 ON
  9325    #SET ZL$ (!Zl & 6) // strip bit 1
  9326    #REM STRICT COMPILER WARNINGS ON
  9327  #ELSE
  9328    #IFSAME !1 OFF
  9329      #SET ZL$ (!Zl | 1)  // add bit 1
  9330      #REM STRICT COMPILER WARNINGS OFF
  9331    #ELSE
  9332      #IFSAME !1 OLD
  9333        #SET ZL$ (!Zl | 2)  // add bit 2
  9334        #REM OLD STYLE COMPILER CHECKING ON (written to .prn file)
  9335      #ELSE
  9336        #SET ZL$ (!Zl & 5) // strip bit 2
  9337        #REM OLD STYLE COMPILER CHECKING OFF
  9338      #ENDIF
  9339    #ENDIF
  9340  #ENDIF
  9341#ENDCOMMAND
  9342
  9343// changes: 1. declare an error if not within a procedure or function
  9344//          2. Check for mismatched Begin/End blocks.
  9345//          3. Check for child objects within end_object
  9346//
  9347#COMMAND END_PROCEDURE .
  9348  // This tracks number of nested objects in method.
  9349  // !Zn is the level of !n when the proc/funct started. Upon
  9350  // completion !n should be that value. If not error.
  9351  // If error, compiler stack is messed up
  9352  #IF (!Zn = !n)
  9353  #ELSE
  9354    #ERROR 4348 Mismatch in Method
  9355    #SET B$ (!b | 4) // stack is screwed up..we have no idea if we are in proc
  9356  #ENDIF
  9357
  9358  // When Proc started we set !Zm to 0. It counts nested objects. It
  9359  // should be zero. If not we have an error.
  9360  // If error, compiler stack is messed up
  9361  #IF (!Zm > 0)
  9362    #ERROR 4323 Mismatch in Method
  9363    #SET B$ (!b | 4) // stack is screwed up..we have no idea if we are in proc
  9364  #ENDIF
  9365
  9366  #IF (!b & 4)              // are we within a Procedure
  9367    #SET B$ (!b & 3)        // reset flag to in_procedure
  9368    #POP U$
  9369    #REPLACE OBJ$!Za$LNUM |CI!Zg     // Update the count in the local cmd.
  9370    //  !A [] OBJ$END$HANDLER |CI0
  9371    !A [] $0455 |CI0
  9372    #REPLACE OBJ$!Za$ENDPROC !a
  9373    #POP U$
  9374    #POP ZG$
  9375
  9376    #STKSYM
  9377  #ELSE
  9378    #ERROR 300 End_Funct/End_proc command .not. within a method
  9379  #ENDIF
  9380
  9381#ENDCOMMAND
  9382
  9383
  9384
  9385// changes: 1. declare an error if not within a class
  9386//          2. declare an error if within a procedure/function
  9387//          3. declare an error in object (implies missing end_object)
  9388// Note: it is possible that under advanced usage you might be
  9389//       creating a class in a method. If this is the case you should
  9390//       use base_end_class
  9391#COMMAND END_CLASS .
  9392  #IF (!b & 2)                     // must be within class or an error
  9393    #IF (!b & 4)                   // end-class within procedure is probably wrong
  9394      #ERROR 300 CLASS/END_CLASS should .not. be inside a method
  9395    #ELSE
  9396      #IF (!b & 1) // if object must be error. Should be end object
  9397        #ERROR 300 End_object expected before End_class
  9398      #ENDIF
  9399      BASE_END_CLASS
  9400    #ENDIF
  9401  #ELSE
  9402    #ERROR 300 End_class without class
  9403  #ENDIF
  9404#ENDCOMMAND
  9405
  9406// this is lower level end_class. It doesn't check that the
  9407// command apppears in the "right" spot.
  9408#COMMAND BASE_END_CLASS .
  9409  #SET ZI$ (!Zi+!Zf)             //subobject count = self + superclass
  9410  #REPLACE !$.AGG |CI!Zi         //define subobject count
  9411  !A [] END$CLASS U_!$ |CI!Zi
  9412
  9413  #SPOP                 // restore the old class name
  9414  #POP X$               // reset the property index
  9415  #POP ZI$              // reset old sub_object_count
  9416  #POP ZF$              // reset super_class_count
  9417  #POP ZB$              // reset current_dep
  9418  #POP B$               // reset obj_flag
  9419#ENDCOMMAND
  9420
  9421
  9422// changes: declare an error if not within an object
  9423//          if within a class, this should be inside of a method
  9424#COMMAND END_OBJECT
  9425  #IF (!b & 1)  // if not within an object..error
  9426    // if within a class (2) but not within a procedure (4) we have an error
  9427    // you should not place objects in classes outside of methods
  9428    #IF (!b = 3) // 3 = in class and in object, not in method
  9429      #IF (!Zl & 1)
  9430        #REM WARNING 302: Object/End_object within class is .NOT. in a method
  9431      #ELSE
  9432        #ERROR 302 Object/End_object within class should be in a method
  9433      #ENDIF
  9434    #ENDIF
  9435
  9436    // If within method, we count number of nested objects.
  9437    // If lt 0, declare an error, End_procedure will check for >0
  9438    #IF ( !b & 4 )   // if object within method
  9439      #SET ZM$ !Zm-1 // decrement count
  9440      #IF (!Zm < 0)  // if lt 0, declare error
  9441        #ERROR 300 End_Object without Object in Method
  9442      #ENDIF
  9443    #ENDIF
  9444
  9445    // if here we are within a object.
  9446    // if we are within a class we are also within a procedure
  9447
  9448    //
  9449    // The following section was added 01-08-90 by SAL to support inheritable
  9450    // end-instance macros for classes
  9451    //
  9452    #IFSUB '!$$SC'  //if flex-defined class
  9453    #IFSUB '!$$EM'  //if end-instance macro defined for class,
  9454      !$$EM !$ !1 !2 !3 !4 !5 !6 !7 !8 !9
  9455    #ELSE
  9456      FORWARD_END_CONSTRUCT !$ !1 !2 !3 !4 !5 !6 !7 !8 !9
  9457    #ENDIF
  9458    #ELSE
  9459      DEFAULT_END_OBJECT  //else use default
  9460    #ENDIF
  9461    #SPOP           //restore old class name
  9462    //
  9463    // end of addition 01-08-90 by SAL
  9464    //
  9465  #ELSE
  9466    #ERROR 300 End_Object without Object
  9467  #ENDIF
  9468#ENDCOMMAND
  9469
  9470// changes: declare an error if not within a procedure or function
  9471//
  9472#COMMAND FUNCTION_RETURN GO .
  9473  #IF (!b & 4)              // are we within a Procedure
  9474    #IF (!0 > 0)
  9475      #IFSAME !1 $0
  9476        // !A [] OBJ$HRET |CI0
  9477        !A [] $0450 |CI0
  9478      #ELSE
  9479        #IFSAME !1 $1
  9480          // !A [] OBJ$HRET |CI1
  9481          !A [] $0450 |CI1
  9482        #ELSE
  9483          #CHECK !1 U
  9484          // !A [] OBJ$HRET !1
  9485          !A [] $0450 !1
  9486        #ENDIF
  9487      #ENDIF
  9488    #ELSE
  9489      // !A [] OBJ$HRET |CI0
  9490      !A [] $0450 |CI0
  9491    #ENDIF
  9492  #ELSE
  9493    #ERROR 300 Method return .not. within a method
  9494  #ENDIF
  9495#ENDCOMMAND
  9496
  9497// change: return can be used in methods or in sub-routines
  9498// perhaps next revision
  9499//#COMMAND RETURN
  9500//  #IF (!b & 4)              // are we within a Procedure/function
  9501//    #IF (!Zl & 2)
  9502//      #REM #ERROR 301 Old Style Usage: Possible gosub return inside of method
  9503//    #ENDIF
  9504//    Procedure_Return !1     // we are returning from a method
  9505//  #ELSE
  9506//    // tells us what we need to fix.
  9507//    #IF (!Zl & 2)
  9508//      #REM #ERROR 301 Old Style Usage: Gosub style/Return s/b Gosub_return
  9509//    #ENDIF
  9510//    #IF (!Zl & 1)             // if relaxed...
  9511//      Gosub_Return !1 !2      // we are doing an old style sub-routine return
  9512//    #ELSE
  9513//      Procedure_Return !1     // we are returning from a method.. will gen an error
  9514//    #ENDIF
  9515//  #ENDIF
  9516//#ENDCOMMAND
  9517
  9518// change: if within a method declare an error. Force use of
  9519//         gosub_return. This catches errors where developer types
  9520//         return instead of procedure_return.
  9521//
  9522#COMMAND RETURN
  9523  #IF (!b & 4)                // are we within a Procedure/function
  9524    #IF (!Zl & 1)             // if relaxed...
  9525      #REM WARNING 301: Old Style Usage: s/b gosub_return
  9526      Gosub_Return !1 !2 !3 !4 !5 !6 !7 !8 !9 // we are doing an old style sub-routine return
  9527    #ELSE
  9528      #ERROR 301 Old Style Usage: s/b gosub_return
  9529    #ENDIF
  9530  #ELSE                       // we are not within method. Normal gosub/return usage
  9531    Gosub_Return !1 !2 !3 !4 !5 !6 !7 !8 !9 // we are doing an old style sub-routine return
  9532  #ENDIF
  9533#ENDCOMMAND
  9534
  9535#COMMAND Gosub_Return VFWNDE#G
  9536
  9537  #IF !0=0
  9538    !A [] $043 |CL0
  9539  #ELSE
  9540    #IFSAME !1 RETURN GOSUB_RETURN
  9541      #SET Q$ (!a+2)
  9542      !A [] $043 |CL!q // RETURN RETURN
  9543      GOSUB_RETURN !2 !3 !4 !5 !6 !7 !8 !9
  9544    #ELSE
  9545      #IFDEF !1
  9546        #CHECK !1 _S
  9547        #CHECK !2 .
  9548        !A [] $043 !1
  9549      #ELSE
  9550        !A [] $043 |CL0
  9551        #FREF !1 !a
  9552      #ENDIF
  9553    #ENDIF
  9554  #ENDIF
  9555#ENDCOMMAND
  9556
  9557// Change: Declare error if not within a method (it used to create
  9558//         globals.
  9559
  9560#COMMAND LOCAL T T
  9561  #IFDEF NUM_ARGUMENTS
  9562    #IF (!0>0)
  9563      #IFDEF SUPPORT$ADDRESS
  9564        #CHECK !1 '"STRING""NUMBER""DATE""INTEGER""REAL""ADDRESS"'
  9565      #ELSE
  9566        #CHECK !1 '"STRING""NUMBER""DATE""INTEGER""REAL"'
  9567      #ENDIF
  9568      #CHECK !2 RT
  9569      #IF (!Zg = 0)
  9570        //!A [] LOCAL$ARGUMENT |CI0  // Create the command to save the local count,
  9571        !A [] $0456 |CI0
  9572        #FREF OBJ$!Za$LNUM !a       // and tell flex to update it later.
  9573      #ENDIF
  9574      #IFSAME !1 STRING
  9575        #REPLACE !2 |SS!ZG
  9576      #ELSE
  9577        #IFSAME !1 NUMBER
  9578          #REPLACE !2 |SN!ZG
  9579        #ELSE
  9580          #IFSAME !1 DATE
  9581            #REPLACE !2 |SD!ZG
  9582          #ELSE
  9583            #IFSAME !1 INTEGER
  9584              #REPLACE !2 |SI!ZG
  9585            #ELSE
  9586              #IFDEF SUPPORT$ADDRESS
  9587                #IFSAME !1 REAL
  9588                  #REPLACE !2 |SR!ZG
  9589                #ELSE
  9590                  #IFSAME !1 ADDRESS
  9591                    #REPLACE !2 |SX!ZG
  9592                  #ENDIF
  9593                #ENDIF
  9594              #ELSE
  9595                #IFSAME !1 REAL
  9596                  #REPLACE !2 |SR!ZG
  9597                #ENDIF
  9598              #ENDIF
  9599            #ENDIF
  9600          #ENDIF
  9601        #ENDIF
  9602      #ENDIF
  9603      #IF (!0>2)
  9604        LOCAL !1 !3 !4 !5 !6 !7 !8 !9
  9605      #ENDIF
  9606    #ENDIF
  9607  #ELSE
  9608    #ERROR 300 LOCAL Variables can only be defined within methods
  9609  #ENDIF
  9610#ENDCOMMAND
  9611
  9612// if not defined as local make it local if needed
  9613//
  9614
  9615#COMMAND INTEGER TR
  9616  DEFINE$VARIABLE$HELP Integer !1 !2 !3 !4 !5 !6 !7 !8 !9
  9617#ENDCOMMAND
  9618
  9619#COMMAND STRING TR E#L%
  9620  DEFINE$VARIABLE$HELP String !1 !2 !3 !4 !5 !6 !7 !8 !9
  9621#ENDCOMMAND
  9622
  9623#COMMAND DATE TR
  9624  DEFINE$VARIABLE$HELP Date !1 !2 !3 !4 !5 !6 !7 !8 !9
  9625#ENDCOMMAND
  9626
  9627#COMMAND NUMBER TR
  9628  DEFINE$VARIABLE$HELP Number !1 !2 !3 !4 !5 !6 !7 !8 !9
  9629#ENDCOMMAND
  9630
  9631#COMMAND REAL TR
  9632  DEFINE$VARIABLE$HELP Real !1 !2 !3 !4 !5 !6 !7 !8 !9
  9633#ENDCOMMAND
  9634
  9635#COMMAND ADDRESS TR
  9636  DEFINE$VARIABLE$HELP Address !1 !2 !3 !4 !5 !6 !7 !8 !9
  9637#ENDCOMMAND
  9638
  9639
  9640// This would make Local keyword optional in methods
  9641#COMMAND DEFINE$VARIABLE$HELP
  9642  #IFDEF NUM_ARGUMENTS
  9643    //#IF (!Zl & 2) // warn if old style and odd
  9644    //  #REM #ERROR 301 Old style usage: Possible global variable in method
  9645    //#ENDIF
  9646    #IF (!Zl & 1) // old style - force to global
  9647      Global_Variable !1 !2 !3 !4 !5 !6 !7 !8 !9
  9648      #REM WARNING: Global Variable defined in method
  9649    #ELSE
  9650      Local !1 !2 !3 !4 !5 !6 !7 !8 !9
  9651    #ENDIF
  9652  #ELSE
  9653    Global_Variable !1 !2 !3 !4 !5 !6 !7 !8 !9
  9654  #ENDIF
  9655#ENDCOMMAND
  9656
  9657// check if global is within method and declare error
  9658//#COMMAND DEFINE$VARIABLE$HELP
  9659//  #IFDEF NUM_ARGUMENTS
  9660//    #IF (!Zl & 1) // old style - force to global
  9661//      Global_Variable !1 !2 !3 !4 !5 !6 !7 !8 !9
  9662//      #REM WARNING 301: Global Variable defined in method
  9663//    #ELSE
  9664//      #ERROR 301  Global Variable defined in method
  9665//    #ENDIF
  9666//  #ELSE
  9667//    Global_Variable !1 !2 !3 !4 !5 !6 !7 !8 !9
  9668//  #ENDIF
  9669//#ENDCOMMAND
  9670
  9671
  9672#COMMAND GLOBAL_VARIABLE
  9673  #IF (!0>0)
  9674    #IFDEF SUPPORT$ADDRESS
  9675      #CHECK !1 '"STRING""NUMBER""DATE""INTEGER""REAL""ADDRESS"'
  9676    #ELSE
  9677      #CHECK !1 '"STRING""NUMBER""DATE""INTEGER""REAL"'
  9678    #ENDIF
  9679    #CHECK !2 RT
  9680    #IFSAME !1 STRING
  9681      #IF (!0>2)
  9682        #IFDEF !3
  9683          #CHECK !3 _VSWDF
  9684          #STR V$ !3
  9685          #REPLACE !2 |VS!v
  9686          #IF (!0>3)
  9687            Global_Variable !1 !4 !5 !6 !7 !8 !9
  9688          #ENDIF
  9689        #ELSE
  9690          #STR V$ 80
  9691          #REPLACE !2 |VS!v
  9692          Global_Variable !1 !3 !4 !5 !6 !7 !8 !9
  9693        #ENDIF
  9694      #ELSE
  9695        #STR V$ 80
  9696        #REPLACE !2 |VS!v
  9697      #ENDIF
  9698    #ELSE
  9699      #IFSAME !1 INTEGER
  9700        #REPLACE !2 |VI!D
  9701      #ELSE
  9702        #IFSAME !1 DATE
  9703          #NUM V$
  9704          #REPLACE !2 |VD!v
  9705        #ELSE
  9706          #IFSAME !1 NUMBER
  9707            #NUM V$
  9708            #REPLACE !2 |VN!v
  9709          #ELSE
  9710            #IFDEF SUPPORT$ADDRESS
  9711              #IFSAME !1 REAL
  9712                #REAL V$
  9713                #REPLACE !2 |VR!v
  9714              #ELSE
  9715                #ADDRESS V$
  9716                #REPLACE !2 |VX!v
  9717              #ENDIF
  9718            #ELSE
  9719              #IFSAME !1 REAL
  9720                #REAL V$
  9721                #REPLACE !2 |VR!v
  9722              #ENDIF
  9723            #ENDIF
  9724          #ENDIF
  9725        #ENDIF
  9726      #ENDIF
  9727      #IF (!0>2)
  9728        GLOBAL_VARIABLE !1 !3 !4 !5 !6 !7 !8 !9
  9729      #ENDIF
  9730    #ENDIF
  9731  #ENDIF
  9732#ENDCOMMAND
  9733
  9734// Change: Check that U_!1 is not yet defined
  9735//         Error if within class
  9736//         Error if within a method
  9737#COMMAND CLASS _RCDNSO "IS" "A""AN" _RDNO //_UGBO#L _UGBO#L _GBO#L .
  9738  #IF (!b & 6)            // if within class or procedure...error
  9739    #IF (!b & 2)          // if within class
  9740      #ERROR 300 Classes can .not. be nested within classes
  9741    #ELSE                 // if within method
  9742      #ERROR 300 Classes can .not. be nested within methods
  9743    #ENDIF
  9744  #ELSE
  9745    #CHECK U_!1 _T                      // does new class exist? If yes error
  9746    #CHECK U_!4 _U                      // does superclass exist? if no error
  9747    #REPLACE !1$SC !4                   //define superclass of new class
  9748    #IFSAME !5 STARTMAC                 //if start macro specified,
  9749      #REPLACE !1$SM !6                 //remember its name
  9750      #IFSAME !7 ENDMAC                 //if end macro specified,
  9751        #REPLACE !1$EM !8               //remember it
  9752        BASE_CREATE_CLASS !1 !2 !3 !4 !9
  9753      #ELSE
  9754        BASE_CREATE_CLASS !1 !2 !3 !4 !7 !8 !9
  9755      #ENDIF
  9756    #ELSE
  9757      #IFSAME !5 ENDMAC                 //no STARTMAC - if ENDMAC specified,
  9758        #REPLACE !1$EM !6               //remember it
  9759        BASE_CREATE_CLASS !1 !2 !3 !4 !7 !8 !9
  9760      #ELSE
  9761        BASE_CREATE_CLASS !1 !2 !3 !4 !5 !6 !7 !8 !9
  9762      #ENDIF
  9763    #ENDIF
  9764  #ENDIF
  9765#ENDCOMMAND
  9766
  9767// Change: Clear In object Flag. If a class is created within an object
  9768//         it is not relevant.
  9769
  9770#COMMAND BASE_CREATE_CLASS _RCDNSO "IS" "A""AN" _RDNO _UGBO#L _UGBO#L _GBO#L .
  9771  #PUSH !b              // save obj_flag
  9772  #PUSH !Zb             // save current_dep
  9773  #PUSH !Zf             // save the super_class_count
  9774  #SET B$ (!b | 2)      // set flag to in_class
  9775  // we want to strip in in-object flag. This will get restored when
  9776  // the class is ended. When a class is defined it is not relevant if
  9777  // it is in an object or not.
  9778  #SET B$ (!b & 14)     // set flag to not in_class (remove bit 0)
  9779  #SET ZB$ 0                // based on atomic class object
  9780  #IF ( (!b & 1) = 0 )          // are we NOT in a create_object?
  9781    #IFDEF !4.AGG               // bump dep number by already
  9782      #SET ZB$ !4.AGG           // defined sub objects
  9783    #ENDIF
  9784  #ENDIF
  9785  #SET ZF$ !Zb              // save the super_class_count
  9786  #PUSH !Zi             // save current sub object count
  9787  #SET ZI$ 0                // and init for new class
  9788
  9789  #PUSH !x                  // save old property index
  9790  #SET X$ 0                 //init to first array index# (0)
  9791
  9792  #SPUSH !$             // save the old class name
  9793  #SET $$ !1                // retain the name of the class
  9794  #IFDEF U_!1               // if the new class id has already
  9795  #ELSE                 // been defined, dont bother
  9796    Global_variable INTEGER U_!1            // else put it into a int of that name
  9797  #ENDIF
  9798  #DATA                 // wind up the stream
  9799  #IFDEF !4
  9800    #DPUSH !4
  9801  #ELSE
  9802    #DPUSH U_!4             // based upon
  9803  #ENDIF
  9804  #IF (!0<5)
  9805    #DPUSH |CI0             // no colors defined, use default
  9806  #ELSE
  9807    #DPUSH !5               // else do what they say
  9808  #ENDIF
  9809  #IF (!0<6)
  9810    #DPUSH |CI0             // no colors defined, use default
  9811  #ELSE
  9812    #DPUSH !6               // else do what they say
  9813  #ENDIF
  9814  #IF (!0=7)                // if parameter used, this will be
  9815    #DPUSH |CS"!7"          // the name of a 'C' function.
  9816  #ELSE
  9817    #DPUSH |CS""            // else inherit one from the parent
  9818  #ENDIF
  9819  !A [] CREATE$CLASS U_!1 |VL       // let 'er rip
  9820#ENDCOMMAND
  9821
  9822
  9823// changes: 1. Allow New syntax: Property type Name {dflt} public|private is optional
  9824//          2. Check placement as follows:
  9825//             2.1. Must be in class or object
  9826//             2.2. Cannot be in a child object defined by a class
  9827//             2.3. If in class, must be in procedure (constructor)
  9828//             2.4. If in object, must not be in procedure.
  9829//          3. Check for Property Name conflicts (Get_name conflict)
  9830//             3.1. If defined as object access - error
  9831//             3.2. If defined as global method - error
  9832//             3.3. If defined with different param list - error (already does this)
  9833
  9834#COMMAND PROPERTY R R
  9835  #IFSAME !3 PRIVATE
  9836    PROPERTY !1 !$.!2 PUBLIC !4
  9837  #ELSE
  9838    #IFSAME !3 PUBLIC
  9839
  9840      // Check property for proper placement
  9841      // 1. Must be in class or object
  9842      // 2. Cannot be in a child object defined by a class
  9843      // 3. If in class, must be in procedure (constructor)
  9844      // 4. If in object, must not be in procedure.
  9845
  9846      #IF ((!Zl & 1) = 0)
  9847        #IF (!b & 3 ) // Within class or object? It should be
  9848          #IF ((!b & 3)=3 ) // but not both....Error
  9849            #ERROR 302 Property cannot be defined in an object within a class
  9850          #ELSE
  9851            #IF (!b & 2)        // in-class: Must be within a method (constructor)
  9852              #IF ( (!b & 4)=0) // in-class and not in method...bad
  9853                #ERROR 302 Class Property must be defined within a constructor procedure
  9854              #ENDIF
  9855            #ELSE // in-object: Cannot be in method
  9856              #IF (!b & 4)  // if within object and within method...an error
  9857                #ERROR 302 Object Property should .not. be in a method
  9858              #ENDIF
  9859            #ENDIF
  9860          #ENDIF
  9861        #ELSE
  9862          #ERROR 302 Property can only be defined within a class or object
  9863        #ENDIF
  9864      #ENDIF
  9865
  9866      #IF (!b & 1 ) // if within object
  9867        !A [] CLONE$CLASS     // Create a new class
  9868      #ENDIF
  9869
  9870      #IF ( (!Zl & 1)=0)
  9871        #IFSAME FN$!2  __F__
  9872          #ERROR 4330 !2 is an internal function name
  9873        #ENDIF
  9874      #ENDIF
  9875
  9876      // Check for GET_ name conflicts as follows:
  9877      //  1. If defined as object access - error
  9878      //  2. If defined as global method - error
  9879      //  3. If defined with different param list - error
  9880      #IFDEF GET_!2
  9881        #IF (GET_!2>$40000000)
  9882          #ERROR 4332 !1 is already defined as an object name
  9883        #ELSE
  9884          #IF (GET_!2<0)
  9885            #ERROR 4332 !2 is already defined as a global function
  9886          #ENDIF
  9887          // if >0 and less that $4000000 it is a valid address if
  9888          // if registers ok
  9889        #ENDIF
  9890      #ELSE
  9891        MESSAGE$ADDRESS GET_!2
  9892      #ENDIF
  9893
  9894      #DATA           // Start the property
  9895
  9896      #DPUSH GET_!2       // Push the get property id
  9897      #FREG GET_!2 RETURNS !1
  9898      MESSAGE$ADDRESS SET_!2
  9899      #DPUSH SET_!2       // Push the set property id
  9900      #DTYPE Q$ !1        // get the property type in q
  9901      #DPUSH |CI!q        // push the type
  9902      #IF (!0 > 3)
  9903        #DPUSH !4
  9904      #ELSE                // 10/30/1997: If no default param is passed force
  9905        #IFSAME !1 STRING  // a default value. String types require
  9906          #DPUSH |CS''     // a string, all others are numeric. This
  9907        #ELSE              // fixes a problem in the runtime where
  9908          #DPUSH |CI0      // dates and numbers did not initialize properly
  9909        #ENDIF             // when no initial param was passed in the command
  9910      #ENDIF
  9911      !A [] CREATE$PROPERTY |CI0 |VL
  9912    #ELSE
  9913      // this supports syntax of "property Integer Prop 10"
  9914      PROPERTY !1 !2 PUBLIC !3
  9915    #ENDIF
  9916  #ENDIF
  9917#ENDCOMMAND
  9918
  9919// Changes: 1. No_image is optional if windows (always provided by compiler)
  9920//          2. If within class, s/b within a class (in df$object)
  9921#COMMAND OBJECT R "IS" "A""AN" RVD#I
  9922  #IFDEF IS$WINDOWS
  9923    // If windows we can check for no_image and if it is not presented then
  9924    // we will provide a no_image argument. Therefore you should NEVER need to use
  9925    // No_image with windows.
  9926    #IF (!0<5)                // if no image try to aquire one
  9927      #IFDEF !1.N             // if image exists with object name, use that
  9928         OBJECT !1 !2 !3 !4 !1
  9929      #ELSE
  9930         OBJECT !1 !2 !3 !4 NO_IMAGE // else use no_image
  9931      #ENDIF
  9932    #ELSE
  9933      #IFDEF !5.N                               // if passed a valid image or
  9934         DF$OBJECT !1 !2 !3 !4 !5 !6 !7 !8 !9   // no_image use them. Else add
  9935      #ELSE                                     // the no_image parameter.
  9936        #IFSAME !5 NO_IMAGE
  9937           DF$OBJECT !1 !2 !3 !4 !5 !6 !7 !8 !9
  9938        #ELSE
  9939           DF$OBJECT !1 !2 !3 !4 NO_IMAGE !5 !6 !7 !8 !9
  9940        #ENDIF
  9941      #ENDIF
  9942    #ENDIF
  9943  #ELSE
  9944    // If character mode no_image must be explicitly provided (as it has always been).
  9945    // we cannot use the no_image replacement because it does not work with dynamic
  9946    // visual objects (like edits).
  9947    #IF (!0<5)                // if no image try to aquire one
  9948      DF$OBJECT !1 !2 !3 !4 !1
  9949    #ELSE
  9950      DF$OBJECT !1 !2 !3 !4 !5 !6 !7 !8 !9
  9951    #ENDIF
  9952  #ENDIF
  9953#ENDCOMMAND
  9954
  9955#COMMAND DF$OBJECT R "IS" "A""AN" RVD#I
  9956
  9957  #IF (!b & 2) // if within a class
  9958    #IF ( (!b & 4)=0 ) // should be within a method
  9959      #ERROR 300 Objects in classes should be within a method
  9960    #ENDIF
  9961  #ENDIF
  9962
  9963  // if we are within a method we will keep track of the number of
  9964  // nested objects. When the method ends we will verify that this is 0.
  9965  // This lets us warn about mismathed object/end-object commands
  9966  #IF ( !b & 4)   // if object within method
  9967    #SET ZM$ !ZM  // increment
  9968  #ENDIF
  9969
  9970
  9971  #DATA                   // start up the data stream
  9972  #PUSH !Zj               // save the unique object label
  9973  #PUSH !b                // save current definition state
  9974
  9975  #IF (!b > 0)            // if not global..we make no guesses about
  9976                          // dependent numbers. Let the runtime assign
  9977                          // dependent order.
  9978  //#IF (!b = 4)          // if in procedure and not class
  9979    #SET ZJ$ 0            // do not inc z
  9980  #ELSE
  9981    #SET ZJ$ !ZB          // assign the next object id
  9982  #ENDIF
  9983  #PUSH !Zb               // save this level on stack
  9984  #IFDEF !4.AGG           // was this a class with sub objects?
  9985    #SET ZB$ !4.AGG       // sub objects will begin at the
  9986  #ELSE                   // next object after superclass
  9987    #SET ZB$ 0            // base classes start at 0
  9988  #ENDIF
  9989  #SET ZI$ !ZI            // count this object at the current level
  9990  #PUSH !Zi               // and push the level
  9991  #IF (!b > 0)            // if (in_object | in_class)
  9992    #IF (!b & 2)          // obj_flag == in_class?
  9993      #IF (!b & 1)        // obj_flag == in_Object?
  9994      #ELSE               // No Name for Subobject in constructor
  9995        // don't define this anymore...
  9996        //#REPLACE !$.!1.OBJ |CI-!Zj  // object_name = -current_object
  9997      #ENDIF
  9998    #ENDIF
  9999    // (LS) removed setting of ZJ; it is NOT being used.
 10000    // (Removed when max lines increased > 32k)
 10001    //      #SET ZJ$ (32766-!a)           // a very unique label for this object
 10002    #DPUSH |CS".!1"           // make name from parent and child
 10003  #ELSE               // global object name
 10004    #DPUSH |CS"!1"            // assign an absolute name to object
 10005  #ENDIF
 10006  #CHECK U_!4 _U          // does class exist?
 10007  #DPUSH U_!4             // define then class the class id
 10008  GET$OBJ$IMAGE !5            // define the objects image
 10009  #IF ((!b & 3) = 2)          // if in_class & !in_object
 10010    // don't assign dep nums anymore
 10011    //#DPUSH !$.!1.OBJ          // pick the assigned dependant number
 10012    // New code just sets 0
 10013    #DPUSH |CI0           // pick the next dependant number
 10014  #ELSE               //
 10015    #IF (!b = 0)          // A global object must assign #
 10016      #IFDEF !1.OBJ           // Is the symbol defined, name_object?
 10017        #DPUSH |CI0           // pick the next dependant number
 10018      #ELSE
 10019        #DPUSH |CI!Zj         // force the dependant number
 10020//        #SET ZJ$ ($1000+!Zj)       // mark as global object
 10021        #SET ZJ$ ($10000000+!Zj)   // using 32-bit ids now
 10022        #REPLACE !1.OBJ |CI!Zj        // Assign an ID to this object
 10023      #ENDIF
 10024    #ELSE
 10025      #DPUSH |CI0         // pick the next dependant number
 10026    #ENDIF
 10027  #ENDIF
 10028  REGISTER_OBJECT !1
 10029  #DPUSH GET_!1
 10030  #SET B$ (!b | 1)            // we are in a object definition
 10031  !A [] OBJ$CREATE |VL        // create the object now
 10032
 10033  #IFDEF !1.OBJ
 10034    #IFCLASS !1.OBJ V$        // does this object have a global?
 10035      MOVE CURRENT_OBJECT TO !1.OBJ   // Move the object id to its global
 10036    #ENDIF
 10037  #ENDIF
 10038
 10039  #SPUSH !$   //save the old class name
 10040  #SET $$ !4
 10041  #IFSUB '!$$SC' // if flex-defined class
 10042    #IFSUB '!$$SM' // if begin-instance macro exists
 10043      #IFDEF IS$WINDOWS
 10044        // in windows we know that an image is always passed (object creates one if needed)
 10045        // and that images are never used. Therefore replace image argument with 0.
 10046        !$$SM !$ 0 !6 !7 !8 !9
 10047      #ELSE
 10048        // character might be passing an image and it might not. We must pass the value
 10049        !$$SM !$ !5 !6 !7 !8 !9
 10050      #ENDIF
 10051    #ELSE
 10052      FORWARD_BEGIN_CONSTRUCT !$ !5 !6 !7 !8 !9
 10053    #ENDIF
 10054  #ELSE
 10055    ADD$IMAGE$ARGS MSG_CONSTRUCT_OBJECT !5 !6 !7 !8 !9  //else use default
 10056  #ENDIF
 10057#ENDCOMMAND
 10058
 10059// Changes:  1. Methods not allowed in class child-objects
 10060//           2. If on desktop and not Global/for..is for dfdesktop
 10061
 10062#COMMAND GET$SET "GET""SET" RD#OBLG
 10063
 10064  #IFSAME !3 OF
 10065    #IFSAME !5 FILE_FIELD // is the file_field keyword used?
 10066      #IFCLASS !6 F       // test for file element
 10067        #PUSH !h
 10068        #PUSH !g
 10069        #SET H$ %!6       // get the fieldnumber of parameter
 10070        #SET G$ !6        // get the filenumber of parameter
 10071        GET$SET$HELP !1 !2 !3 !4 |CI!g |CI!h !7 !8 !9
 10072        #POP G$
 10073        #POP H$
 10074      #ELSE
 10075        #ERROR 998 UNKNOWN FIELD: !6
 10076      #ENDIF
 10077    #ELSE
 10078      #IFSAME !5 FIELD      // is the field keyword used?
 10079        #IFCLASS !6 F       // test for file element
 10080          #PUSH !h
 10081          #SET H$ %!6         // get the fieldnumber of parameter
 10082          GET$SET$HELP !1 !2 !3 !4 |CI!h !7 !8 !9
 10083          #POP H$
 10084        #ELSE
 10085          #ERROR 998 UNKNOWN FIELD: !6
 10086        #ENDIF
 10087      #ELSE
 10088        GET$SET$HELP !1 !2 !3 !4 !5 !6 !7 !8 !9
 10089      #ENDIF
 10090    #ENDIF
 10091  #ELSE  // !3 not OF. Provide Object
 10092    GET$SET !1 !2 OF CURRENT_OBJECT !3 !4 !5 !6 !7 !8 !9
 10093  #ENDIF
 10094#ENDCOMMAND
 10095
 10096#COMMAND GET$SET$HELP "GET""SET" RD#OBLG "OF" RSND#OBLG R
 10097
 10098  #IF ( (!Zl & 1)=0)
 10099    #IFCLASS !2 "EFWV"
 10100      #ERROR 302 Unusual Usage: Variable or Expression used as message
 10101    #ENDIF
 10102
 10103    #IF (!b = 2) // within class but not in object or method
 10104      #ERROR 300 Messages in class should be in method
 10105    #ENDIF
 10106  #ENDIF
 10107
 10108  #IFSAME DFLT$!2 __X__ __F__  // is this a item type message?
 10109    #IFSAME !5 ITEM       // is the item keyword used?
 10110      OBJECT$PROPERTIES !1 !2 !4 !6 !7 !8 !9 // pass it on
 10111    #ELSE
 10112      #IFSAME !5 TO       // if no param passed create a default
 10113        #IFSAME DFLT$!2 __F__   // is this a form type message?
 10114          #IF (!Zl & 2)
 10115            // if a Form_ message, and no item was passed before the TO
 10116            // and there are two params after the two this is an old syntax.
 10117            #IF (!0>6)
 10118              // this one must be fixed!
 10119              #ERROR 301 OBSOLETE SYNTAX: GET/SET FORM_XXX TO X Y
 10120              #REM #ERROR 301 OBSOLETE SYNTAX: GET/SET FORM_XXX TO X Y
 10121            #ENDIF
 10122          #ENDIF
 10123          OBJECT$PROPERTIES !1 !2 !4   0 !5 !6 !7 !8 !9  // use 0 as dflt
 10124        #ELSE
 10125          #IF (!Zl & 2)
 10126            // if a item_ message, and no item was passed before the TO
 10127            // it used to replace with current which is now changed to
 10128            // 0. Warn that this might cause a problem in old programs.
 10129            #REM #ERROR 301 Old Style Usage: No ITEM keyword. Is replacement for .current. or 0
 10130          #ENDIF
 10131          //OBJECT$PROPERTIES !1 !2 !4 0 !5 !6 !7 !8 !9  // use 0 as dflt
 10132          OBJECT$PROPERTIES !1 !2 !4 -99 !5 !6 !7 !8 !9  // use CURRENT as dflt
 10133        #ENDIF
 10134      #ELSE // params are passed. Just Use them
 10135        OBJECT$PROPERTIES !1 !2 !4 !5 !6 !7 !8 !9 // pass it on
 10136        //#REM ITEM KEYWORD OMITTED. USE !5
 10137      #ENDIF
 10138    #ENDIF
 10139  #ELSE // not Item or Form based
 10140    OBJECT$PROPERTIES !1 !2 !4 !5 !6 !7 !8 !9  // just supply args
 10141  #ENDIF
 10142#ENDCOMMAND
 10143
 10144#COMMAND OBJECT$PROPERTIES "GET""SET" RD#OBLG RSND#OBLG R
 10145  #DATA
 10146  #IFDEF !2         // is message in a variable?
 10147    #DPUSH !2           // yes, just push the value
 10148  #ELSE
 10149    #IFDEF !1_!2        // is this message defined?
 10150      #DPUSH !1_!2      // yes, push the definition
 10151    #ELSE
 10152      #DPUSH |CI0       // forward reference the message
 10153      #FREF !1_!2 !a,0      // add the reference to be defined
 10154    #ENDIF
 10155  #ENDIF
 10156
 10157  #PUSH !Zg
 10158  #SET ZG$ 0
 10159
 10160  #PUSH !Zh
 10161  #SET ZH$ 2  // 3 unrestricted params following TO and TO is optional
 10162  #IF (!Zl & 1)
 10163    #SET ZH$ 3  // Its ok...no fancy checking
 10164  #ELSE
 10165    #IFSAME !1 GET
 10166      #SET ZH$ 1  // 1 means 1 param following TO
 10167    #ELSE
 10168      #IFSAME DFLT$2$!2 __2__  // is this a complex set message? (more than 1 param)
 10169      #ELSE
 10170        #IFSAME DFLT$!2 __X__ __F__  // is this a item or form type message?
 10171        //#IFSAME DFLT$!2 __F__  // is this a item or form type message?
 10172          #SET ZH$ 1  // 1 means 1 param following TO
 10173        #ENDIF
 10174      #ENDIF
 10175    #ENDIF
 10176  #ENDIF
 10177
 10178  PROPERTY$HELP !4 !5 !6 !7 !8 !9
 10179
 10180  #POP ZH$
 10181  #POP ZG$
 10182
 10183  // Precedence of Object ID resolution
 10184  // 1. If variable (hopefully local)
 10185  // 2. if expression
 10186  // 3. If .obj (old style, to be avoided)
 10187  // 4. If object access id
 10188
 10189  #IFDEF !3 // if a variable, constant or expression...it's defined
 10190    OBJECT$DEFINE !1 !3
 10191  #ELSE
 10192    #IFDEF !3.OBJ   // old style: If global object or defined w/ .obj (ugh)
 10193      OBJECT$DEFINE !1 !3.OBJ
 10194    #ELSE
 10195      #IFDEF GET_!3 // if defined as a function
 10196        #IF (GET_!3>$40000000) // and an object access method
 10197          // this is where we can get tricky and use access methods
 10198          #IFDEF USE$NEAR$OBJECT
 10199            OBJECT$DEFINE !1 (obj(GET_!3))
 10200          #ELSE
 10201            OBJECT$DEFINE !1 (!3(Current_object))
 10202          #ENDIF
 10203        #ELSE // if defined as a function but not an access method. This is an error
 10204          #ERROR 300 Invalid Object reference
 10205        #ENDIF
 10206      #ELSE
 10207        // not yet defined. We could either forward ref as object or
 10208        // declare an error. For now let's just do an error.
 10209        #ERROR 300 Invalid Object reference
 10210        // here is how we would forward ref as obj
 10211        //Register_object !3
 10212        //!A [] OBJ$!1 (!3(Current_object)) |VL
 10213      #ENDIF
 10214    #ENDIF
 10215  #ENDIF
 10216#ENDCOMMAND
 10217
 10218#COMMAND OBJECT$DEFINE R R
 10219   !A [] OBJ$!1 !2 |VL
 10220#ENDCOMMAND
 10221
 10222// this forces the param passed to be subsituted for an expression
 10223// you can directly dpush an expression
 10224#COMMAND DPUSH$EXP R .
 10225    #DPUSH !1
 10226#ENDCOMMAND
 10227
 10228
 10229#COMMAND PROPERTY$HELP
 10230  #IF (!0>0)
 10231    #IFSAME !1 OF // "of" should have already been processed. This is an error
 10232      #ERROR 302 INVALID USE OF 'OF'
 10233      #SET ZH$ 4 // 4 means error occurred
 10234    #ELSE
 10235      // Check that TO is used properly.
 10236      #IFSAME !1 TO
 10237        #IF (!Zl & 1)
 10238        #ELSE
 10239          #IF (!Zh=3)  // TO already encountered. TOO many Tos
 10240            #ERROR 302 TOO MANY 'TO'
 10241            #SET ZH$ 4 // 4 means error occurred
 10242          #ELSE
 10243            #IF (!0=1) // missing param after to
 10244              #ERROR 302 NO VALUE FOLLOWING 'TO'
 10245              #SET ZH$ 4 // 4 means error occurred
 10246            #ELSE
 10247              #IF (!Zh=1) // A GET or ITEM SET without a TO yet
 10248                #IF (!0>2)  // too many params after the to
 10249                  #ERROR 302 TOO MANY PARAMS AFTER 'TO'
 10250                  #SET ZH$ 4 // 4 means error occurred
 10251                #ELSE
 10252                  #SET ZH$ 3 // Mark as found a to
 10253                #ENDIF
 10254              #ELSE        // If here a non-item SET
 10255                #SET ZH$ 3 // Mark as found a to
 10256              #ENDIF
 10257            #ENDIF
 10258          #ENDIF
 10259        #ENDIF
 10260      #ELSE
 10261        #IFSAME !1 ITEM
 10262        #ELSE
 10263          #SET ZG$ !ZG
 10264          #IFDEF !1
 10265            #DPUSH !1
 10266          #ELSE
 10267            #IFCLASS !1 0123456789ABCDEF
 10268              #DPUSH !1
 10269            #ELSE
 10270              //#IFDEF MSG_!1
 10271              //  #DPUSH MSG_!1
 10272              //#ELSE
 10273              //  #DPUSH |CI0
 10274              //  #FREF MSG_!1 !a,!Zg
 10275              //#ENDIF
 10276
 10277              #IFDEF GET_!1 // if defined as a function
 10278              // This would support passing of object names as parameters. Not supported
 10279              // for now.
 10280              //  #IF (GET_!1>$40000000) // and an object access method..we will help out
 10281              //    // this is where we can get tricky and use access methods
 10282              //    #IFDEF USE$NEAR$OBJECT
 10283              //      DPUSH$EXP (obj(GET_1))
 10284              //      //#DPUSH (obj(GET_!1))
 10285              //    #ELSE
 10286              //      DPUSH$EXP (!1(current_object))
 10287              //      //#DPUSH (!1(Current_object))
 10288              //    #ENDIF
 10289              //  #ELSE       // if defined as a function but not an access method. This is an error
 10290                  #DPUSH !1 // will generate an Error
 10291              //  #ENDIF
 10292              #ELSE       // If undefined
 10293                // this could be msg_!1 but we will call than an error
 10294                //#DPUSH !1 // will generate an Error
 10295                #IFDEF MSG_!1
 10296                  #DPUSH MSG_!1
 10297                #ELSE
 10298                  #DPUSH |CI0
 10299                  #FREF MSG_!1 !a,!Zg
 10300                #ENDIF
 10301
 10302              #ENDIF
 10303            #ENDIF
 10304          #ENDIF
 10305        #ENDIF
 10306      #ENDIF
 10307    #ENDIF
 10308    #IF (!Zh<4) // 4 indicates an error occurred
 10309      PROPERTY$HELP !2 !3 !4 !5 !6 !7 !8 !9 // as long as there is still no error
 10310    #ENDIF
 10311  #ELSE
 10312    #IF (!Zh<3) // If 1 or 2, TO was never found
 10313      #ERROR 302 MISSING 'TO' KEYWORD
 10314    #ENDIF
 10315  #ENDIF
 10316#ENDCOMMAND
 10317
 10318// Changes: 1. support "OF" as well as "TO". OF is preferred
 10319//          2. Check location of "OF" keyword
 10320//          3. Check for improper message type (expression)
 10321//          4. If sent directly within class (not method)...error
 10322#COMMAND SEND RSD#OBLG
 10323
 10324  #IF ( (!Zl & 1)=0)
 10325    // we expect message to be msg_xxx, constant or local var.
 10326    // Actually locals are wierd, but much more acceptable
 10327    #IFCLASS !1 "EFWV" // if exp, file, window or global...wierd
 10328      #ERROR 302 Unusual Usage: Variable or Expression used as message
 10329    #ENDIF
 10330
 10331    #IF (!b = 2) // within class but not in object or method
 10332      #ERROR 302 Messages in class should be in method
 10333    #ENDIF
 10334  #ENDIF
 10335
 10336  #DATA
 10337  #IFDEF !1
 10338    #DPUSH !1
 10339  #ELSE
 10340    #IFDEF MSG_!1
 10341      #DPUSH MSG_!1
 10342    #ELSE
 10343      #DPUSH |CI0
 10344      #FREF MSG_!1 !a,0
 10345    #ENDIF
 10346  #ENDIF
 10347  #IFSAME !2 TO OF // support both OF (suggested) and TO (old)
 10348    SEND$HELP !4 !5 !6 !7 !8 !9
 10349    SEND$CMD TO TO !3
 10350  #ELSE
 10351    SEND$HELP !2 !3 !4 !5 !6 !7 !8 !9
 10352    SEND$CMD TO TO CURRENT_OBJECT
 10353  #ENDIF
 10354#ENDCOMMAND
 10355
 10356#COMMAND SEND$CMD
 10357  #IFSAME !1 !2
 10358    #IFDEF !3 // if a variable, constant or expression...it's defined
 10359      OBJECT$SEND$DEFINE !3
 10360    #ELSE
 10361      #IFDEF !3.OBJ   // old style: If global object or defined w/ .obj (ugh)
 10362        OBJECT$SEND$DEFINE !3.OBJ
 10363      #ELSE
 10364        #IFDEF GET_!3 // if defined as a function
 10365          #IF (GET_!3>$40000000) // and an object access method
 10366            // this is where we can get tricky and use access methods
 10367            #IFDEF USE$NEAR$OBJECT
 10368              OBJECT$SEND$DEFINE (obj(GET_!3))
 10369            #ELSE
 10370              OBJECT$SEND$DEFINE (!3(Current_object))
 10371            #ENDIF
 10372          #ELSE // if defined as a function but not an access method. This is an error
 10373            #ERROR 300 Invalid Object reference
 10374          #ENDIF
 10375        #ELSE
 10376          // not yet defined. We could either forward ref as object or
 10377          // declare an error. For now let's just do an error.
 10378          #ERROR 300 Invalid Object reference
 10379          // here is how we would forward ref as obj
 10380          //!A [] OBJ$SEND |CI0 |VL
 10381          //#FREF (!3(Current_object)) !a
 10382        #ENDIF
 10383      #ENDIF
 10384    #ENDIF
 10385  #ELSE
 10386    !A [] OBJ$SEND CURRENT_OBJECT |VL
 10387  #ENDIF
 10388#ENDCOMMAND
 10389
 10390#COMMAND OBJECT$SEND$DEFINE R
 10391   !A [] OBJ$SEND !1 |VL
 10392#ENDCOMMAND
 10393
 10394
 10395#COMMAND SEND$HELP
 10396  #IF (!0>0)
 10397    #IFSAME !1 OF TO
 10398      #ERROR 300 INVALID POSITION FOR '!1'
 10399    #ELSE
 10400      #IFSAME !1 FIELD
 10401        #IFCLASS !2 F         // test for file element
 10402          #PUSH !h
 10403          #SET H$ %!2         // get the fieldnumber of parameter
 10404          SEND$HELP |CI!h !3 !4 !5 !6 !7 !8 !9
 10405          #POP H$
 10406        #ELSE
 10407          #ERROR 998 UNKNOWN FIELD: !2
 10408        #ENDIF
 10409      #ELSE
 10410        #IFSAME !1 FILE_FIELD
 10411          #IFCLASS !2 F         // test for file element
 10412            #PUSH !h
 10413            #PUSH !g
 10414            #SET H$ %!2  // get the fieldnumber of parameter
 10415            #SET G$ !2   // get the filenumber of parameter
 10416            SEND$HELP |CI!g |CI!h !3 !4 !5 !6 !7 !8 !9
 10417            #POP G$
 10418            #POP H$
 10419          #ELSE
 10420            #ERROR 998 UNKNOWN FIELD: !2
 10421          #ENDIF
 10422        #ELSE
 10423          // DPush will check any untyped errors
 10424          //#CHECK !1 _U // removed from #COMMAND and placed here
 10425          #DPUSH !1
 10426          SEND$HELP !2 !3 !4 !5 !6 !7 !8 !9
 10427        #ENDIF
 10428      #ENDIF
 10429    #ENDIF
 10430  #ENDIF
 10431#ENDCOMMAND
 10432
 10433// Create Move command that will move object access methods
 10434// to a var with simple name
 10435#COMMAND MOVE R R R
 10436  #IFDEF !1 // if Move Var to Var...normal move.
 10437    MoveVar !1 !2 !3
 10438  #ELSE
 10439    #IFDEF GET_!1   // if defined as a function
 10440      #IF (GET_!1>$40000000) // If move Object-access to (var|property)
 10441        MoveObj !1 !2 !3
 10442      #ELSE
 10443        MoveVar !1 !2 !3 // this will generate an error
 10444      #ENDIF
 10445    #ELSE
 10446      MoveVar !1 !2 !3 // will gen an error
 10447    #ENDIF
 10448  #ENDIF
 10449#ENDCOMMAND
 10450
 10451#COMMAND MOVEVAR #L "TO" #GLEURC .
 10452  #IFCLASS !1 "G"  // MOVE INDICATOR
 10453    #CHECK !1 _VWFC
 10454    !A [] $4020 !1 |GB[0] !3 IN$GLALL |3
 10455  #ELSE
 10456    // Type independent move as of 2.3
 10457    !A  [] $086 !1 !3
 10458  #ENDIF
 10459#ENDCOMMAND
 10460
 10461#COMMAND MOVEOBJ #L "TO" #GLEURC .
 10462  #IFDEF GET_!1   // if defined as a function
 10463    #IF (GET_!1>$40000000) // If move Object-access to (var|property)
 10464      #IFDEF USE$NEAR$OBJECT
 10465        MoveVar (Obj(Get_!1)) to !3
 10466      #ELSE
 10467        MoveVar (!1(Current_object)) to !3
 10468      #ENDIF
 10469    #ELSE
 10470      #ERROR 300 Invalid Object reference
 10471    #ENDIF
 10472  #ELSE
 10473    #ERROR 300 Invalid Object reference
 10474  #ENDIF
 10475#ENDCOMMAND
 10476
 10477
 10478// changes: Check that object name is not already a global/class function
 10479//          Add alternate access syntax @Name
 10480//          check that the name is not an internal function
 10481#COMMAND REGISTER_OBJECT R
 10482  #IFDEF UI.EXISTS
 10483  #ELSE
 10484    USE UI
 10485  #ENDIF
 10486
 10487  #IF ( (!Zl & 1)=0)
 10488    #IFSAME FN$!1  __F__
 10489      #ERROR 4330 !1 is an internal function name
 10490    #ENDIF
 10491  #ENDIF
 10492
 10493  // Check that object name is not already a global or class function.
 10494  #IFDEF GET_!1
 10495    #IF (GET_!1<$40000001)
 10496      #IF (GET_!1<0)
 10497        #ERROR 4332 !1 Already defined as a global function
 10498      #ELSE
 10499        #ERROR 4332 !1 Already defined as a function/Property
 10500      #ENDIF
 10501    #ENDIF
 10502  #ELSE
 10503    #REPLACE GET_!1 |CI!ZH
 10504    #FREG GET_!1 RETURNS INTEGER
 10505    // register additional object access methods
 10506    #IFDEF USE$NEAR$OBJECT
 10507      #REPLACE @!1 (Obj(Get_!1))    // for @ObjName   syntax near/global/default
 10508      // These are here for test purposes right now.
 10509      //#REPLACE !1.SELF (!1(current_object)) // for ObjName.self  syntax = obj(self)
 10510      //#REPLACE !1.NEAR (NearObj(Get_!1))    // for ObjName.Near  syntax near
 10511    #ELSE
 10512      #REPLACE @!1 (!1(current_object))
 10513    #ENDIF
 10514  #ENDIF
 10515#ENDCOMMAND
 10516
 10517// Changes:  Check for Global error (used to check !1)
 10518//           Check for Object access name error
 10519//           Check that the name is not a global name
 10520#COMMAND REGISTER_FUNCTION R
 10521  #IFDEF UI.EXISTS
 10522  #ELSE
 10523    USE UI
 10524  #ENDIF
 10525
 10526  #IF ( (!Zl & 1)=0)
 10527    #IFSAME FN$!1  __F__
 10528      #ERROR 4330 !1 is an internal function name
 10529    #ENDIF
 10530  #ENDIF
 10531
 10532  #IFSAME !2 GLOBAL
 10533    #ERROR 101 GLOBAL FUNCTIONS CANNOT BE REGISTERED
 10534  #ELSE
 10535    #IFDEF GET_!1
 10536      #IF (GET_!1>$40000000)
 10537        #ERROR 4332 !1 is already defined as an object
 10538      #ENDIF
 10539    #ELSE
 10540      MESSAGE$ADDRESS GET_!1
 10541    #ENDIF
 10542
 10543    #IFSAME !2 FOR
 10544      #FREG GET_!1 !4 !5 !6 !7 !8 !9
 10545    #ELSE
 10546      #FREG GET_!1 !2 !3 !4 !5 !6 !7 !8 !9
 10547    #ENDIF
 10548  #ENDIF
 10549#ENDCOMMAND
 10550
 10551// Changes:  Check for Object access name error
 10552#COMMAND FUNCTION R
 10553
 10554    #IF ( (!Zl & 1)=0)
 10555      #IFSAME FN$!1  __F__
 10556        #ERROR 4330 !1 is an internal function name
 10557      #ENDIF
 10558    #ENDIF
 10559
 10560    #IFDEF GET_!1
 10561      #IF (GET_!1>$40000000)
 10562        #ERROR 4332 !1 is already defined as an object
 10563      #ENDIF
 10564    #ENDIF
 10565
 10566    HANDLE$MESSAGE GET_!1 !2 !3 !4 !5 !6 !7 !8 !9
 10567#ENDCOMMAND
 10568
 10569// called by Set/Get
 10570// Changes:  1. If in object and msg_consruct_object..error
 10571//           2. Cannot nest methods (already was there)
 10572//           3. Methods not allowed in class child-objects
 10573//           4. If on desktop and not Global/for..is for dfdesktop
 10574//
 10575#COMMAND HANDLE$MESSAGE RGOBL#
 10576  #IFDEF UI.EXISTS
 10577  #ELSE
 10578    USE UI
 10579  #ENDIF
 10580
 10581  // procedure construct_object only allowed in class
 10582  #IF (!b & 1) // if in object
 10583    #IFSAME !1 MSG_CONSTRUCT_OBJECT
 10584      #ERROR 300 Construct_object .not. allowed in objects
 10585    #ENDIF
 10586  #ENDIF
 10587
 10588  // not allowed to nest methods
 10589  #IF (!b & 4)
 10590    #ERROR 300 Procedures and Functions may .not. be nested.
 10591  #ELSE
 10592    // non global methods are not allowed class child-objects
 10593    #IFSAME !2 GLOBAL
 10594    #ELSE
 10595      #IF ((!b & 3)=3) // if in class object
 10596        #ERROR 300 Methods .not. allowed in class child-objects
 10597      #ENDIF
 10598    #ENDIF
 10599  #ENDIF
 10600
 10601  #CHECK NUM_ARGUMENTS _T
 10602  //
 10603  #SET ZN$ !n     // static nesting level
 10604  #SET ZM$ 0      // # objects in method
 10605  #PUSH !Zg
 10606  #PUSH !Za
 10607  #SET ZA$ !a
 10608  #PUSH !Zu
 10609  #DATA
 10610  #STKSYM                      // forget all old stack symbols
 10611  #SET B$ (!b | 4)             // set flag to in_procedure
 10612  #REPLACE NUM_ARGUMENTS |SI0  // define the arg count
 10613  #IFSAME !2 GLOBAL
 10614    #DPUSH |CI0         // No message
 10615    #DPUSH |CI0         // for no class
 10616    #CHECK !1 T         // cant have dups of these globals
 10617    #SET ZG$ (0-!a-2)   // make it negative to distuinguish it
 10618    #REPLACE !1 |CI!Zg  // this will cause all fwd refs to be fixed.
 10619    #IF (!0>1)          // do we have arguments?
 10620      #SET ZG$ 1        // starting argument number
 10621      DEFINE_ARGUMENTS !3 !4 !5 !6 !7 !8 !9
 10622    #ENDIF
 10623    #FREG !1 !2 !3 !4 !5 !6 !7 !8 !9
 10624  #ELSE
 10625    #IFSAME !2 FOR          // are we explict about the class?
 10626      MESSAGE$ADDRESS !1            // create id symbol for this message
 10627      #DPUSH !1
 10628      #IFDEF !3
 10629        #IFSAME !3 DESKTOP
 10630          #DPUSH U_DESKTOP      // Message for the desktop class
 10631        #ELSE
 10632          #DPUSH !3         // Message for the named class
 10633        #ENDIF
 10634      #ELSE
 10635        #CHECK U_!3 RSDNU           // check the class for goodness
 10636        #DPUSH U_!3         // Message for the named class
 10637      #ENDIF
 10638      #IF (!0>3)
 10639        #SET ZG$ 1                  // starting argument number
 10640        DEFINE_ARGUMENTS !4 !5 !6 !7 !8 !9
 10641      #ENDIF
 10642      #FREG !1 !4 !5 !6 !7 !8 !9
 10643    #ELSE
 10644      #IF (!b & 2)              // obj_flag == in_class?
 10645        MESSAGE$ADDRESS !1      // yes, same as handle "for"
 10646        #DPUSH !1               // the message
 10647        #DPUSH U_!$         // handle msg for "current class"
 10648      #ELSE
 10649        #IF (!b & 1)            // in_object, instance method
 10650          !A [] CLONE$CLASS
 10651          MESSAGE$ADDRESS !1        // yes, same as handle "for"
 10652          #DPUSH !1         // the message
 10653          #DPUSH |CI0           // handle for objects class
 10654        // if here, an ambigious desktop method.
 10655        // for now, we make this FOR DESKTOP which adds message to base_class.
 10656        // In other words, all classes will understand this message directly
 10657        #ELSE               // just your simple global message
 10658
 10659          // This has changed. Prior fmacs created a semi-global. A global call that
 10660          // required an object access ID (because GLOBAL keyword was missing - that
 10661          // keyword is parsed by #freg). This was a bug.
 10662          // This made it act like a FOR DESKTOP object which is how it is docced.
 10663          // We will change this so it *really* is a FOR DESKTOP object.
 10664          MESSAGE$ADDRESS !1      // handle like "for"
 10665          #DPUSH !1               // the message
 10666          #DPUSH U_DESKTOP        // Message for the desktop (UI_OBJECT) class
 10667
 10668          // below is an alternate for windows where the handler is placed on
 10669          // the dfdesktop object whichs is what everyone thinks they are doing anyway.
 10670          // The problem with this is that this creates a delegation (which people expect)
 10671          // that includes odd delegation of current_object (which they do not expect). This
 10672          // tends to break a lot of existing programs in a way that is very hard to debug.
 10673          // So for now we make this for desktop (above)
 10674          //#IF (!Zl & 2)
 10675          //  #REM #ERROR 301 Old Style Usage: Ambigious .desktop. method
 10676          //#ENDIF
 10677          //#IFDEF IS$WINDOWS
 10678          //   #DPUSH U_DFDESKTOP      // Message for the DF desktop class
 10679          //#ELSE
 10680          //   #DPUSH U_DESKTOP       // Message for the desktop (UI_OBJECT) class
 10681          //#ENDIF
 10682
 10683        #ENDIF
 10684      #ENDIF
 10685      #IF (!0>1)                // do we have arguments?
 10686        #SET ZG$ 1                  // starting argument number
 10687        DEFINE_ARGUMENTS !2 !3 !4 !5 !6 !7 !8 !9
 10688      #ENDIF
 10689      #FREG !1 !2 !3 !4 !5 !6 !7 !8 !9
 10690    #ENDIF
 10691  #ENDIF
 10692//  !A [] HANDLE$FOR |CI0 |VL     // handle the message
 10693  !A [] $0454 |CI0 |VL
 10694  #FREF OBJ$!Za$ENDPROC !a      // fref the end procedure line
 10695  #SET ZG$ 0                    // starting argument number for locals
 10696#ENDCOMMAND
 10697
 10698#COMMAND ITEM_LIST .
 10699  #PUSH !Zd
 10700  #SET ZD$ |CI-1         // -1 means in an item list.
 10701
 10702  #PUSH !Zg
 10703  #PUSH !Zj
 10704  #SET ZJ$ !a
 10705  #PUSH !Zj
 10706  #SET ZG$ 0              // Set the item counter to zero.  This is used to
 10707                         // count and assign ID's to the items.
 10708  !A [] OBJ$ILIST |CI0   // Create the command to save the item count,
 10709  #FREF OBJ$!Zj$INUM !a    // and tell flex to update it later.
 10710#ENDCOMMAND
 10711
 10712
 10713#COMMAND END_ITEM_LIST .
 10714  #POP ZJ$
 10715  #REPLACE OBJ$!Zj$INUM |CI!Zg     // Update the count in the ITEM_LIST cmd.
 10716  !A [] OBJ$ENDILIST OBJ$!Zj$INUM         // Tell runtime this is the end of list.
 10717  #POP ZJ$
 10718  #POP ZG$
 10719  #POP ZD$    // Restore "in item list" marker
 10720#ENDCOMMAND
 10721
 10722#COMMAND ENTRY_ITEM R
 10723  #IF (!Zd = -1) // if within a On_item group
 10724    ENTRY$ITEM !1 !2 !3 !4 !5 !6 !7 !8 !9
 10725  #ELSE
 10726    #IF (!0>1)
 10727      ENTRY$ITEM !1 !2 !3 !4 !5 !6 !7 !8 !9
 10728    #ELSE
 10729      #IFCLASS !1 "F"
 10730        #PUSH !h
 10731        #PUSH !g
 10732        #SET H$ %!1  // get the fieldnumber of parameter
 10733        #SET G$ !1   // get the filenumber of parameter
 10734        Send Bind_Data |CI!g |CI!h
 10735        #POP G$
 10736        #POP H$
 10737      #ELSE
 10738        ENTRY$ITEM !1 !2 !3 !4 !5 !6 !7 !8 !9
 10739      #ENDIF
 10740    #ENDIF
 10741  #ENDIF
 10742#ENDCOMMAND
 10743
 10744#COMMAND ENTRY$ITEM R
 10745  #SET ZG$ !ZG
 10746  #DATA
 10747  #IFCLASS !1 "EC"
 10748    #ENTOPT {$C0A0=!1,$C002,$C003,!2}
 10749  #ELSE
 10750    #ENTOPT {$C0A0=!1,!2}
 10751  #ENDIF
 10752  !A [] OBJ$ENTRY$ITEM |CI0 |VL
 10753#ENDCOMMAND
 10754
 10755#COMMAND REPLACE_CLASS_NAME R R
 10756   #IFDEF U_!2
 10757       #Replace U_!1 U_!2
 10758       #IFSUB '!2$SC'
 10759          #Replace !1$SC !2$SC
 10760       #ENDIF
 10761       #IFSUB '!2$SM'
 10762          #Replace !1$SM !2$SM
 10763       #ENDIF
 10764       #IFSUB '!2$EM'
 10765          #Replace !1$EM !2$EM
 10766       #ENDIF
 10767   #ENDIF
 10768#ENDCOMMAND
 10769
 10770#COMMAND ON_KEY RULGBO#SDN "SEND" RLGBO#SDN """TO""OF""PRIVATE" _DNOB """PRIVATE" .
 10771  #IFSAME !4 PRIVATE
 10772    ON_KEY !1 !2 !3 TO |CI-1 PRIVATE
 10773  #ELSE
 10774    #DATA
 10775    #DPUSH !1
 10776    #IFSAME !4 TO OF
 10777      #IFDEF !5
 10778        #DPUSH !5
 10779      #ELSE
 10780        //#IFDEF !5.OBJ
 10781        //  #DPUSH !5.OBJ
 10782        //#ELSE
 10783        //  #DPUSH |CI0
 10784        //  #FREF !5.OBJ !a,1
 10785        //#ENDIF
 10786        #IFDEF GET_!5 // if defined as a function
 10787          #IF (GET_!5>$40000000) // and an object access method..we will help out
 10788            // this is where we can get tricky and use access methods
 10789            #IFDEF USE$NEAR$OBJECT
 10790              DPUSH$EXP (obj(GET_!5))
 10791              //#DPUSH (obj(GET_!5))
 10792            #ELSE
 10793              DPUSH$EXP (!5(current_object))
 10794              //#DPUSH (!5(Current_object))
 10795            #ENDIF
 10796          #ELSE       // if defined as a function but not an access method. This is an error
 10797            #DPUSH !5 // will generate an Error
 10798          #ENDIF
 10799        #ELSE       // If undefined
 10800          #DPUSH !5 // will generate an Error
 10801        #ENDIF
 10802      #ENDIF
 10803    #ELSE
 10804      #DPUSH |CI-1
 10805    #ENDIF
 10806    #IFSAME !6 PRIVATE
 10807      #DPUSH |CI1
 10808    #ENDIF
 10809    #IFDEF !3
 10810      !A [] OBJ$ONKEY !3 |VL
 10811    #ELSE
 10812      #IFDEF MSG_!3
 10813        !A [] OBJ$ONKEY MSG_!3 |VL
 10814      #ELSE             // else the command is defined in flex code
 10815        !A [] OBJ$ONKEY |CI0 |VL        // get flex to fix the fwd ref
 10816        #FREF MSG_!3 !a
 10817      #ENDIF
 10818    #ENDIF
 10819  #ENDIF
 10820#ENDCOMMAND
 10821
 10822#COMMAND ON_ITEM NDI """SEND""BEGIN_PULL_DOWN"
 10823  #IF (!0<2)
 10824    #IF (!0<1)
 10825      ON_ITEM '' SEND MSG_NONE
 10826    #ELSE
 10827      ON_ITEM !1 SEND MSG_NONE
 10828    #ENDIF
 10829  #ELSE
 10830    #IFSAME !1 SEND
 10831      ON_ITEM '' !1 !2 !3 !4 !5 !6 !7 !8 !9
 10832    #ELSE
 10833      #IFSAME !2 SEND
 10834        #SET ZG$ !ZG                   // Increment the item counter
 10835        #IFSAME !4 TO OF
 10836          #CHECK !6 .
 10837          #DATA
 10838          #IFDEF !3
 10839            #DPUSH !3           // Push the (variable) message
 10840          #ELSE
 10841            #IFDEF MSG_!3
 10842              #DPUSH MSG_!3     // Push the constant message
 10843            #ELSE
 10844              #DPUSH |CI0
 10845              #FREF MSG_!3 !a,0     // Forward fef the message
 10846            #ENDIF
 10847          #ENDIF
 10848          #IFDEF !5
 10849            #DPUSH !5           // Push the (expression, var) dest object
 10850          #ELSE
 10851            //#IFDEF !5.OBJ
 10852            //  #DPUSH !5.OBJ     // Push the global object
 10853            //#ELSE
 10854            //  #DPUSH |CI0
 10855            //  #FREF !5.OBJ !a,1     // Forward ref the object
 10856            //#ENDIF
 10857
 10858            #IFDEF GET_!5 // if defined as a function
 10859              #IF (GET_!5>$40000000) // and an object access method..we will help out
 10860                // this is where we can get tricky and use access methods
 10861                #IFDEF USE$NEAR$OBJECT
 10862                  DPUSH$EXP (obj(GET_!5))
 10863                  //#DPUSH (obj(GET_!5))
 10864                #ELSE
 10865                  DPUSH$EXP (!5(current_object))
 10866                  //#DPUSH (!5(Current_object))
 10867                #ENDIF
 10868              #ELSE       // if defined as a function but not an access method. This is an error
 10869                #DPUSH !5 // will generate an Error
 10870              #ENDIF
 10871            #ELSE       // If undefined
 10872              #DPUSH !5 // will generate an Error
 10873            #ENDIF
 10874
 10875          #ENDIF
 10876          !A [] OBJ$ITEM_EXEC !1 |VL
 10877        #ELSE
 10878          #IF (!0 > 3)
 10879            #CHECK !4 "TO"
 10880          #ENDIF
 10881          #IFDEF MSG_!3
 10882            !A [] OBJ$ITEM MSG_!3 !1       // Create the item passing name and value.
 10883          #ELSE
 10884            #IFDEF !3
 10885              !A [] OBJ$ITEM !3 !1         // Create the item passing name and value.
 10886            #ELSE
 10887              !A [] OBJ$ITEM |CI0 !1       // Create the item passing name and value.
 10888              #FREF MSG_!3 !a              // fix value later with procedure address
 10889            #ENDIF
 10890          #ENDIF
 10891        #ENDIF
 10892      #ELSE
 10893        #IFSAME !2 BEGIN_PULL_DOWN
 10894          #CHECK !3 R
 10895          REGISTER_OBJECT !3
 10896          ON_ITEM !1 SEND ACTIVATE_PULL_DOWN TO (!3(CURRENT_OBJECT))
 10897          #IFSUB 'END_MENU'
 10898            CREATE_MENU !3 SUB_LOCATION !4 !5 !6 !7 !8 !9
 10899          #ELSE
 10900            #ERROR 1000 INVALID ARGUMENT: "BEGIN_PULL_DOWN" REQUIRES MENU_SYSTEM PACKAGE
 10901          #ENDIF
 10902        #ENDIF
 10903      #ENDIF
 10904    #ENDIF
 10905  #ENDIF
 10906#ENDCOMMAND
 10907
 10908//****************************************************************************//
 10909//                                                                            //
 10910// Returns the field number of a fieldnumber passed.                          //
 10911//                                                                            //
 10912// USAGE:                                                                     //
 10913// GET_FIELDNUMBER FlexErrs.Note to MyVar                                     //
 10914//                                                                            //
 10915//****************************************************************************//
 10916
 10917#COMMAND GET_FIELDNUMBER R "TO" R .
 10918  #PUSH !g
 10919  #SET G$ %!1
 10920  Move |CI!g to !3
 10921  #POP G$
 10922#ENDCOMMAND
 10923
 10924
 10925
 10926//****************************************************************************//
 10927//                                                                            //
 10928// Returns the file number of a fieldnumber passed.                           //
 10929//                                                                            //
 10930// USAGE:                                                                     //
 10931// GET_FILENUMBER FlexErrs.Note to MyVar                                      //
 10932//                                                                            //
 10933//****************************************************************************//
 10934
 10935#COMMAND GET_FILENUMBER R "TO" R .
 10936  #PUSH !g
 10937  #SET G$ !1
 10938  Move |CI!g to !3
 10939  #POP G$
 10940#ENDCOMMAND
 10941
 10942
 10943