home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 May / PCW596.iso / wtest / clico / sunsoft / pcnfspro / telnet / ddedemo.ec_ / ddedemo.ECF
Encoding:
Text File  |  1995-10-30  |  2.6 KB  |  68 lines

  1. !----------------------------------------------------------
  2. ! DDE Demonstration
  3. ! (C) Copyright 1994 Diversified Computer Systems, Inc.
  4. ! All rights reserved.
  5. !----------------------------------------------------------
  6.  
  7. ! Make the DDE connection
  8. DDE CONNECT "DDEDEMO" "Population" CONVERSATION
  9.  
  10. ! Turn on the automatic advising for the population
  11. DDE ADVISE 'CONVERSATION' "US" POPUS
  12.  
  13. ! Clear the screen
  14. CLS
  15.  
  16. DISPLAY [2, 2] "<ESC>[1mDDEDEMO - Demonstrates some DDE (Dynamic Data Exchange) capabilities<ESC>[0m"
  17. DISPLAY [3, 2] "<ESC>[1m====================================================================<ESC>[0m"
  18. DISPLAY [4, 2] "This command file demonstrates the following:"
  19. DISPLAY [5, 4] "- The DDE Connection/Termination process"
  20. DISPLAY [6, 4] "- A DDE 'Request' operation (the Time)"
  21. DISPLAY [7, 4] "- An 'Advise Data Link' (the Population)"
  22.  
  23. DISPLAY [ 9, 2] "+------------------------------------------------------+"
  24. DISPLAY [10, 2] "|                                                      |"
  25. DISPLAY [11, 2] "|                                                      |"
  26. DISPLAY [12, 2] "+------------------------------------------------------+"
  27. DISPLAY [10,5] " <ESC>[1mCurrent Time:<ESC>[0m"
  28. DISPLAY [11,5] "<ESC>[1mUS Population:<ESC>[0m"
  29.  
  30. DISPLAY [14, 2] "The <ESC>[1mCurrent Time<ESC>[0m is updated by initiating a 'DDE REQUEST' and displaying"
  31. DISPLAY [15, 2] "the value of the requested variable each time through a loop."
  32. DISPLAY [17, 2] "The <ESC>[1mUS Population<ESC>[0m is updated by initiating a 'DDE ADVISE' before the loop"
  33. DISPLAY [18, 2] "and displaying the variable each time through a loop. The variable is updated"
  34. DISPLAY [19, 2] "automatically by the DDE server. The <ESC>[1mUS Population<ESC>[0m increases approximately"
  35. DISPLAY [20, 2] "every 10 seconds."
  36. DISPLAY [22, 2] "This command file will terminate automatically in:"
  37.  
  38. COUNT = 0
  39. REMAINING = 30 - COUNT
  40. loop:
  41.  
  42.   ! Get the current time from the server
  43.   DDE REQUEST 'CONVERSATION' "TIME" POPTIME
  44.  
  45.   DISPLAY [10,20] "<ESC>[7m" + POPTIME + "<ESC>[0m"
  46.   DISPLAY [11,20] "<ESC>[7m" + POPUS + "<ESC>[0m"
  47.  
  48.   ! Show the number of seconds remaining. The two spaces are to erase previous numbers.
  49.   DISPLAY [22,53] "<ESC>[1m  "
  50.   DISPLAY [22,53] REMAINING
  51.   DISPLAY [22,53] "<ESC>[0m"
  52.   DISPLAY [22,55] " seconds."
  53.   DELAY /NOMESSAGE 1
  54.   COUNT = COUNT + 1
  55.   REMAINING = REMAINING - 1
  56. IF REMAINING .GE. 0 THEN GOTO LOOP
  57.  
  58. ! Turn off the automatic advising for the population
  59. DDE UNADVISE 'CONVERSATION' "US"
  60.  
  61. ! Disconnect the DDE connection
  62. DDE DISCONNECT 'CONVERSATION'
  63.  
  64. DISPLAY [23,2] "Finished!"
  65.