home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 August / PCWorld_2000-08_cd.bin / Software / TemaCD / xbasic / xbpro.exe / xb / aloha.x < prev    next >
Text File  |  1996-01-19  |  2KB  |  64 lines

  1. '
  2. ' ####################
  3. ' #####  PROLOG  #####
  4. ' ####################
  5. '
  6. PROGRAM "aloha"
  7. VERSION "0.0002"
  8. '
  9. IMPORT    "xst"
  10. IMPORT    "ahowdy"
  11. '
  12. ' This program calls Howdy() in dynamic link library ahowdy.dll.
  13. ' ahowdy.x is the XBasic program from which ahowdy.dll was created.
  14. ' Note that ahowdy.x prints two lines, "Hello from Entry()" and
  15. ' "Hello from ahowdy!".  The first line is printed by the entry
  16. ' function in ahowdy, even though this program never called it,
  17. ' because the entry functions of dynamic link libraries are called
  18. ' by XBasic programs that import them.  See IMPORT "ahowdy" above.
  19. ' If you run this program several times, you'll notice that the
  20. ' "Hello from Entry()" appears only the first time - ahowdy.x has
  21. ' already been imported by the program development environment.
  22. '
  23. ' ahowdy.dll may already exist in yuor working directory.  If not,
  24. ' you can create ahowdy.dll from ahowdy.x as follows:
  25. '
  26. ' Enter "xb ahowdy.x -lib" in a console window.  This causes XBasic
  27. ' to compile ahowdy.x as a library and create ahowdy.s, ahowdy.mak,
  28. ' and a few other operating system specific support files.
  29. '
  30. ' Enter "nmake ahowdy.mak" to convert ahowdy.s into ahowdy.dll.
  31. '
  32. '
  33. ' The IMPORT "ahowdy" statement in this PROLOG makes XBasic compile
  34. ' the contents of ahowdy.dec into this program.  ahowdy.dec contains
  35. ' "EXTERNAL FUNCTION  Howdy()" which is what makes it possible for
  36. ' this program to call Howdy() in ahowdy.dll.
  37. '
  38. ' ahowdy.dll is a standalone library, which means it can be called
  39. ' by any XBasic program that contains an IMPORT "ahowdy" statement.
  40. '
  41. '
  42. ' First run this aloha.x program in the program development environment
  43. ' to make sure it runs and successfully calls Howdy() in ahowdy.dll.
  44. ' Then, if you want to convert this program into a standalone executable
  45. ' enter "xb aloha" in a console window, followed by "nmake aloha.mak".
  46. ' To run the resulting standalone aloha.exe/ahowdy.dll comination,
  47. ' enter "aloha" in a console window.
  48. '
  49. DECLARE FUNCTION  Entry ()
  50. '
  51. '
  52. ' ######################
  53. ' #####  Entry ()  #####
  54. ' ######################
  55. '
  56. FUNCTION  Entry ()
  57. '
  58.     Howdy ()
  59.     PRINT "Aloha from Hawaii!"
  60.     XstSleep (2000)
  61.     PRINT "*****  DONE  *****"
  62. END FUNCTION
  63. END PROGRAM
  64.