home *** CD-ROM | disk | FTP | other *** search
- ╔═════════════════════════════╗
- ║ AllSwap.pas ║
- ║Copyright 1988 by MorganSoft ║
- ║ All Rights Reserved ║
- ╚═════════════════════════════╝
-
-
-
- This procedure is for your use, in anyway you see fit--go
- ahead and include it in your own units where ever you need it.
- Feel free to distribute it to anyone you feel like. I only
- ask that you keep this document and any other files that I
- may have added since writing this intact and with the
- procedure(s) itself/(themselves). I'm not asking for any
- money for it but I would appreciate any comments you care to
- loft my way. (Addresses and phone numbers are listed below).
-
- I am NOT releasing this to the public domain.
-
- ┌──────────────────┐
- │The Hows and Whys:│
- └──────────────────┘
-
- I was getting pretty fed up with having about 8 procedures
- clogging up my units (or programs, for that matter) that
- essentially did exactly the same thing. I pondered what to
- do about it but was unable to come up with anyway to combat
- the problem at first (heck, I'm still learning the language--I
- started out in Basic for crying outloud).
-
- Then while going over a couple of books by a gentleman named
- Jeff Duntemann (Turbo Pascal Solutions and Complete Turbo
- Pascal) he introduced me to a couple of things that
- immediately struck me as being quite usefull--Untyped
- Variables and Free-Union Variants. His explanation of both
- of them was such that I actually understood without having to
- break into a sweat figuring things out (Mr. Duntemann, thank
- you. You write quite well).
-
- Anyway, this is the first result of that (I'll be using the
- free-union stuff a little down the line--no need right now).
-
- Briefly, this procedure allows the programmer to use one
- routine to swap two variables, no matter what the type
- (excepting pointers and compound/complex types). There are
- 3 arguments --two untyped variables and a third,
- enumerated type that tells the procedure what the actual type
- needed is. This third argument gives the actual length of
- taken up by the individual variables (straight from the TP
- 4.0 manual).
-
- User Defined Enumerated types are supported and can be
- swapped also.
-
- One warning--I have NOT checked to see how any of the types
- work out THAT REQUIRE AN 8087 COPROCESSOR. I don't have one.
- I honestly can't think of any reasons why they wouldn't work,
- but that's no guarantee as I'm sure you're aware. If you
- have an 8087, then please test 'em out first.
-
-
- T. G. Browning
-
- Easy-Comm Acorn BBS Delphi The Source
- Ph (503)-588-2834 PH (207)-865-3004 User Name: User ID:
- Salem, Oregon Freeport, Maine Browning Bey775
-
- T. G. Browning
- 2170 Raynor St. SE
- Salem, OR 97302
-
-
-
- Compiler information:
-
-
- ╔════════════════════════ Information ════════════════════════╗
- ║ ║
- ║ Primary file : ║
- ║ Current file : ALLSWAP.PAS ║
- ║ File size : 4027 Available memory: 216K ║
- ║ Lines compiled: 130 Run code is on disk ║
- ║ ║
- ║ Code size 7376 bytes ║
- ║ Data size 1139 bytes ║
- ║ Stack size 16384 bytes ║
- ║ Minimum heap size 0 bytes ║
- ║ Maximum heap size 655360 bytes ║
- ║ ║
- ║ Program exit code ║
- ║ Error message ║
- ║ Error module ║
- ║ Error address ║
- ║ ║
- ║ Press any key ║
- ╚═════════════════════════════════════════════════════════════╝
-
- The above is the compiler info for allswap.exe.
-
-