home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!mimsy!nocusuhs!nmrdc1!frmug!lill!vanney.raphael
- From: vanney.raphael@lill.frmug.fr.mugnet.org (Vanney Raphael)
- Newsgroups: comp.lang.pascal
- Subject: TURBO PASCAL 6.0 QUESTION
- Message-ID: <1021.6.uupcb@lill.frmug.fr.mugnet.org>
- Date: 23 Dec 92 00:28:00 GMT
- Reply-To: vanney.raphael@lill.frmug.fr.mugnet.org (Vanney Raphael)
- Organization: Li'LL BBS - Paris, France
- Lines: 54
-
- FS>Sorry if this a FAQ, I am currently looking at some turbo pascal 6.0
- FS>code that someone else has written and I am running into a problem
- FS>with segment sizes. The problem is as follows, this program (actually
- FS>a suite of programs) has a lot of explicitly declared variables and
- arrays
- FS>and they come very close to the 64K limit. This makes it very
- difficult to
- FS>extend any of these arrays, which is what I want to do, beyond their
- current
- FS>bounds. What I would like to know is if it is possible to go beyond
- this
- FS>limit in any way, or is this just hopeless. I know I can change these
- FS>variable to
- FS>dynamically allocated ones ( like a malloc in C), but I would rather
- not
- FS>mess with the programs too much.
-
- Anyway, it seems like this is definitely your only solution ; here is a
- piece of hint on how to proceed :
-
- Original (Ill-written :-)) program :
-
- Type Tab : Array[1..16384] Of Word ;
-
- Var Tab : TTab ;
-
- Begin
- { Tab[] anywhere }
- End.
-
- What you have 2 do is :
-
- Type Tab : Array[1..16384] Of Word ;
-
- Var Tab : ^TTab ; { Make Tab a dynamically allocated
- variable }
-
- Begin
- New(Tab) ; { Don't forget to instanciate it... }
- { Tab^[] anywhere } { Replace, with your favourite editor, any
- reference to Tab with a reference to
- Tab^...
- And that's it ! }
- Dispose(Tab) ; { Cleaning-up is always worth it }
- End.
-
- Hope I helped,
-
- Alp, Raphael.
-
- * OLX 2.1 TD * So be it...
- --- FMail 0.92
- * Origin: ICEBERG - La Garenne * FRANCE * Tel:(33)-1-47699261 (2:320/1)
-
-