home *** CD-ROM | disk | FTP | other *** search
- !----------------------------------------------------------
- !
- ! DDE Demonstration
- !
- ! (C) Copyright 1994 Diversified Computer Systems, Inc.
- ! All rights reserved.
- !
- !----------------------------------------------------------
-
- ! Make the DDE connection
- DDE CONNECT "DDEDEMO" "Population" CONVERSATION
-
- ! Turn on the automatic advising for the population
- DDE ADVISE 'CONVERSATION' "US" POPUS
-
- ! Clear the screen
- CLS
-
- DISPLAY [2, 2] "<ESC>[1mDDEDEMO - Demonstrates some DDE (Dynamic Data Exchange) capabilities<ESC>[0m"
- DISPLAY [3, 2] "<ESC>[1m====================================================================<ESC>[0m"
- DISPLAY [4, 2] "This command file demonstrates the following:"
- DISPLAY [5, 4] "- The DDE Connection/Termination process"
- DISPLAY [6, 4] "- A DDE 'Request' operation (the Time)"
- DISPLAY [7, 4] "- An 'Advise Data Link' (the Population)"
-
- DISPLAY [ 9, 2] "+------------------------------------------------------+"
- DISPLAY [10, 2] "| |"
- DISPLAY [11, 2] "| |"
- DISPLAY [12, 2] "+------------------------------------------------------+"
- DISPLAY [10,5] " <ESC>[1mCurrent Time:<ESC>[0m"
- DISPLAY [11,5] "<ESC>[1mUS Population:<ESC>[0m"
-
- DISPLAY [14, 2] "The <ESC>[1mCurrent Time<ESC>[0m is updated by initiating a 'DDE REQUEST' and displaying"
- DISPLAY [15, 2] "the value of the requested variable each time through a loop."
- DISPLAY [17, 2] "The <ESC>[1mUS Population<ESC>[0m is updated by initiating a 'DDE ADVISE' before the loop"
- DISPLAY [18, 2] "and displaying the variable each time through a loop. The variable is updated"
- DISPLAY [19, 2] "automatically by the DDE server. The <ESC>[1mUS Population<ESC>[0m increases approximately"
- DISPLAY [20, 2] "every 10 seconds."
- DISPLAY [22, 2] "This command file will terminate automatically in:"
-
- COUNT = 0
- REMAINING = 30 - COUNT
- loop:
-
- ! Get the current time from the server
- DDE REQUEST 'CONVERSATION' "TIME" POPTIME
-
- DISPLAY [10,20] "<ESC>[7m" + POPTIME + "<ESC>[0m"
- DISPLAY [11,20] "<ESC>[7m" + POPUS + "<ESC>[0m"
-
- ! Show the number of seconds remaining. The two spaces are to erase previous numbers.
- DISPLAY [22,53] "<ESC>[1m "
- DISPLAY [22,53] REMAINING
- DISPLAY [22,53] "<ESC>[0m"
- DISPLAY [22,55] " seconds."
- DELAY /NOMESSAGE 1
- COUNT = COUNT + 1
- REMAINING = REMAINING - 1
- IF REMAINING .GE. 0 THEN GOTO LOOP
-
- ! Turn off the automatic advising for the population
- DDE UNADVISE 'CONVERSATION' "US"
-
- ! Disconnect the DDE connection
- DDE DISCONNECT 'CONVERSATION'
-
- DISPLAY [23,2] "Finished!"
-