home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / PM-M2.ZIP / README < prev    next >
Text File  |  1990-08-05  |  4KB  |  123 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                   Writing Presentation Manager Programs in Modula-2
  8.  
  9.                                    by Chris Barker
  10.  
  11.                                    August 4, 1990
  12.  
  13.      The files contained in this zipped file constitute my attempt to write OS/2
  14.      Presentation Manager programs using JPI's Modula-2 for OS/2 version 2.0.  I
  15.      am both new to Modula-2 and to programming for the Presentation Manager.
  16.      Previously I have been programming extensively with Turbo Pascal and less
  17.      extensively with Turbo C.
  18.  
  19.      Since the preponderance of documentation for writing PM code is in C, I
  20.      thought the world might benefit from some examples written in another
  21.      language such as Modula-2.  I have taken a very clearly written book,"OS/2
  22.      Presentation Manager - Programming Primer" by Asael Dror and Robert Lafore,
  23.      and adapted their "C" examples to Modula-2.  Hopefully, my adaptions have
  24.      been correct!
  25.  
  26.      Personally, I find the protective environment of Pascal/Modula-2 (i.e.
  27.      strong type checking, promoting modular projects, etc.) a much more
  28.      comfortable and rewarding programming experience.  I am a very high level
  29.      minded kind of programmer that would prefer to adapt and reuse mine or
  30.      someone else's code (OOP?) to get a job done rather than wallowing down in
  31.      the internals of my computer's CPU.  I am always impressed by the
  32.      blindingly fast routines of a Zen assembler master like Michael Abrash, but
  33.      I'd rather work on a higher level.  Jeff Duntemann is programmer I look up
  34.      to.
  35.  
  36.      Speaking of OOP, my other reason for being attracted to JPI's M2 for OS/2
  37.      is its inclusion of object extensions to Modula-2.  The example program,
  38.      PMTEST, is my own cursory attempt at encapsulating some of the complexity
  39.      of PM programming using OOPS.  I hope to extend this and leverage some real
  40.      power.  I hope to hear from others that may be trying the same thing.
  41.  
  42.      While adapting these programs, I came across a few puzzling issues that
  43.      JPI's fairly sparse documentation didn't enlighten me on.  In the cases
  44.      where I got stumped, I spent a lot of time scanning JPI's WIN.DEF file for
  45.      possible answers.  Sometimes I was lucky, other times I wasn't.  For
  46.      example, I am still puzzled by JPI's implementation of PM's two message
  47.      queues.  I have often found that the "correct" M2 code was the opposite of
  48.      the "C" code (e.g. using mp2 instead of mp1).  I am probably missing
  49.      something and would love to be enlightened.  Also, has anyone figured out
  50.      the equivalent M2 routine for the "C" macro: #define SHORT1FROMMP(mp)
  51.      ((USORT)(ULONG)(mp))?  I have tried for example: SHORTCARD(LONGCARD(mp1)),
  52.      but this does not return the correct values.
  53.  
  54.      So far I have gotten through chapter six of the book and will hopefully
  55.      update this file as I adapt further examples.  Please read the header
  56.      comments in each program before you run the program so you will understand
  57.      what each is supposed to do.  I hope these examples will encourage others
  58.      to try a hand at PM programming using Modula-2.
  59.  
  60.  
  61.      Writing OS/2 PM Programs in Modula-2          August 4, 1990         Page 2
  62.  
  63.  
  64.  
  65.      I would love to hear from other programmers.  Please send a message to me,
  66.      Chris Barker, at one of the following:
  67.  
  68.          -  Compuserve ID: 72261,2312
  69.  
  70.          -  Pete Norloff's OS/2 Shareware BBS - (703) 385-4325
  71.  
  72.          -  Max's Doghouse BBS - (703) 548-7849
  73.  
  74.             The above two BBS carry the Fidonet OS/2 echo which I read
  75.             regularly.
  76.  
  77.          -  Programmer's Corner - (301) 596-1180
  78.  
  79.          -  CPCUG Mix (Window Sig) BBS - (301) 738-9060
  80.  
  81.      Enjoy!
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.                                         - 2 -
  123.