home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ALLSWAP.ZIP / ALLSWAP.DOC next >
Encoding:
Text File  |  1988-03-16  |  4.8 KB  |  100 lines

  1.                         ╔═════════════════════════════╗
  2.                         ║         AllSwap.pas         ║
  3.                         ║Copyright 1988 by MorganSoft ║
  4.                         ║      All Rights Reserved    ║
  5.                         ╚═════════════════════════════╝
  6.  
  7.  
  8.  
  9.          This procedure is for your use, in anyway you see fit--go 
  10.          ahead and include it in your own units where ever you need it.  
  11.          Feel free to distribute it to anyone you feel like.  I only 
  12.          ask that you keep this document and any other files that I
  13.          may have added since writing this intact and with the 
  14.          procedure(s) itself/(themselves).  I'm not asking for any 
  15.          money for it but I would appreciate any comments you care to 
  16.          loft my way.  (Addresses and phone numbers are listed below).
  17.  
  18.          I am NOT releasing this to the public domain.
  19.  
  20.         ┌──────────────────┐
  21.         │The Hows and Whys:│
  22.         └──────────────────┘
  23.  
  24.          I was getting pretty fed up with having about 8 procedures 
  25.          clogging up my units  (or programs, for that matter) that 
  26.          essentially did exactly the same thing.  I pondered what to
  27.          do about it but was unable to come up with anyway to combat 
  28.          the problem at first (heck, I'm still learning the language--I    
  29.          started out in Basic for crying outloud).
  30.  
  31.          Then while going over a couple of books by a gentleman named 
  32.          Jeff Duntemann (Turbo Pascal Solutions and Complete Turbo 
  33.          Pascal) he introduced me to a couple of things that 
  34.          immediately struck me as being quite usefull--Untyped 
  35.          Variables and Free-Union Variants.  His explanation of both
  36.          of them was such that I actually understood without having to
  37.          break into a sweat figuring things out (Mr. Duntemann, thank 
  38.          you.  You write quite well).
  39.  
  40.          Anyway, this is the first result of that (I'll be using the 
  41.          free-union stuff a little down the line--no need right now).
  42.  
  43.          Briefly, this procedure allows the programmer to use one 
  44.          routine to swap two variables, no matter what the type 
  45.          (excepting pointers and compound/complex types).  There are 
  46.          3 arguments --two untyped variables and a third, 
  47.          enumerated type that tells the procedure what the actual type 
  48.          needed is.  This third argument gives the actual length of 
  49.          taken up by the individual variables (straight from the TP 
  50.          4.0 manual).
  51.  
  52.          User Defined Enumerated types are supported and can be 
  53.          swapped also.
  54.  
  55.          One warning--I have NOT checked to see how any of the types 
  56.          work out THAT REQUIRE AN 8087 COPROCESSOR.  I don't have one.
  57.          I honestly can't think of any reasons why they wouldn't work, 
  58.          but that's no guarantee as I'm sure you're aware.  If you 
  59.          have an 8087, then please test 'em out first.
  60.  
  61.  
  62.          T. G. Browning
  63.  
  64.          Easy-Comm            Acorn BBS            Delphi       The Source
  65.          Ph (503)-588-2834    PH (207)-865-3004    User Name:   User ID:
  66.          Salem, Oregon        Freeport, Maine      Browning     Bey775
  67.  
  68.          T. G. Browning
  69.          2170 Raynor St. SE
  70.          Salem, OR  97302
  71.          
  72.          
  73.  
  74.          Compiler information:
  75.  
  76.  
  77.          ╔════════════════════════ Information ════════════════════════╗
  78.          ║                                                             ║
  79.          ║  Primary file  :                                            ║
  80.          ║  Current file  : ALLSWAP.PAS                                ║
  81.          ║  File size     : 4027            Available memory: 216K     ║
  82.          ║  Lines compiled: 130             Run code is on disk        ║
  83.          ║                                                             ║
  84.          ║  Code size                  7376 bytes                      ║
  85.          ║  Data size                  1139 bytes                      ║
  86.          ║  Stack size                16384 bytes                      ║
  87.          ║  Minimum heap size             0 bytes                      ║
  88.          ║  Maximum heap size        655360 bytes                      ║
  89.          ║                                                             ║
  90.          ║  Program exit code                                          ║
  91.          ║  Error message                                              ║
  92.          ║  Error module                                               ║
  93.          ║  Error address                                              ║
  94.          ║                                                             ║
  95.          ║                        Press any key                        ║
  96.          ╚═════════════════════════════════════════════════════════════╝
  97.    
  98.          The above is the compiler info for allswap.exe.
  99.  
  100.