!************************************************************************ ! * ! DEVDMO.BAS - SAMPLE PROGRAM TO DEMONSTRATE DART/BASIC INTERACTION * ! * !************************************************************************ ! ! NOTICE ! ! COPYRIGHT (C) 1987 Distributed Management Systems, Inc. ! ALL RIGHTS RESERVED. ! ! THIS PROGRAM HAS BEEN DONATED TO THE PUBLIC DOMAIN FOR EDUCATIONAL PURPOSES. ! RECEIPT OR POSSESSION OF THIS PROGRAM DOES NOT CONVEY ANY RIGHTS TO SELL ! OR OTHERWISE USE THIS PROGRAM FOR COMMERCIAL GAIN. ALL RIGHTS REMAIN VESTED ! IN THE COPYRIGHT HOLDER. ! ! Edit History: ! ![101] 06/01/88 Released via AMUS./CAE ![100] 11/14/87 Designed and implemented by Creed Erickson. ! PROGRAM DEVDMO,1.0(101) ! Command buffer that we will be building to chain to. ! MAP1 CMD'BUF , S, 512 ! Command buffer. MAP1 CRLF , S, 2, CHR$(13)+CHR$(10) ! EOL constant. ! Misc stuff. ! MAP1 X , F, 6 ! Misc real. MAP1 X$ , S, 80 ! Misc string. MAP1 ESP'MENU , F, 6, 128+27 ! The program: ! XCALL GETUSR, 0 , X ! See if USRIMP.BUF there. IF X = -1 THEN GOTO LOD'USRIMP ! No, go load it. XCALL SETUSR, 0 , 1 ! Yes, lock it into memory. ! Do something visible to the user. Status lines are displayed, the ! accumulator value is incremented and displayed. ! XCALL INITRM, & "System Developers' Example Demo.", & "This is the AlphaBASIC program which chains to DART." PRINT TAB(4,1); "Next accumulator value:"; XCALL GETUSR, 10000+300, X ! Get accumulator #100. PRINT X + 1 ! Display new value. ! Display some helpful information on the bottom portion of screen. ! PRINT TAB(14,1); ! Position cursor. FOR X = 1 TO 5 ! Five lines to display. READ X$ ! Get a line. PRINT X$ ! Display that line. NEXT X ! Loop for all lines. ! Prompt for user response. EXECUTE causes chain to DART; MENU exits program. ! LOOP: PRINT TAB(8,1); TAB(-1,9); ! Clear line 8. PRINT "Press MENU to abort, any other key to proceed. "; XCALL GTCHR, X ! Get user response. IF X = ESP'MENU THEN GOTO FINI ! Exit on MENU. ! User is going for it-- increment the accumulator. ! XCALL GETUSR, 10000+300, X ! Get accumulator #100. X = X + 1 ! Increment the value by one. XCALL SETUSR, 10000+300, X ! Set new value into accumulator. ! Build command buffer... ! CMD'BUF = ":" + CRLF ! Tell BASIC it's AMOS command line. CMD'BUF = CMD'BUF + ":R" + CRLF ! Show output. CMD'BUF = CMD'BUF + "DART DEVDMO" + CRLF ! Goto DART. CMD'BUF = CMD'BUF + "RUN DEVDMO" + CRLF ! Return to this program. ! Chain to the command buffer that we have built. ! CHAIN CMD'BUF ! What to do on exit... ! FINI: XCALL INITRM ! Clear screen and status lines. END ! Finish. ! Load USRIMP.BUF-- Invoked when USRIMP.BUF is not in memory. ! Chain through series of AMOS commands to load memory modules then ! return to this program. ! LOD'USRIMP: CMD'BUF = ":"+CRLF ! Command line prefix. CMD'BUF = CMD'BUF+":R"+CRLF ! Allow output. CMD'BUF = CMD'BUF+":"+CRLF ! Display blank line. CMD'BUF = CMD'BUF+"LOAD BAS:USRIMP.BUF"+CRLF ! Load impure. CMD'BUF = CMD'BUF+"LOAD BAS:SETUSR.SBR"+CRLF ! Going to use this. CMD'BUF = CMD'BUF+"LOAD BAS:GETUSR.SBR"+CRLF ! And this. CMD'BUF = CMD'BUF+"LOAD BAS:GTCHR.SBR"+CRLF ! And this also. CMD'BUF = CMD'BUF+"RUN DEVDMO"+CRLF ! Come back to program. CHAIN CMD'BUF ! User helpful explaination of this program which gets displayed on the ! bottom portion of the screen. ! DATA "This program increments an accumulator value which is then displayed on the" DATA "screen. By pressing EXECUTE the program will then chain to a DART Data Base," DATA "passing the accumulator value into the Data Base for use as a key field." DATA "Although this example performs no useful function, it is a valuable example of" DATA "how an AlphaBASIC program and DART Data Base can interact with one another."