Board index » delphi » Data Segment to Large
super...@superior.net (Superius!)
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
super...@superior.net (Superius!)
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Data Segment to Large
Okay. I am working on a rather large program right now, and I am
having some problems with running it. It seems that the "Data Segment is to Large" according to the compiler. I am aware of what the problem is, but what I am unsure of is how to fix it. I know that it is possible to make bigger programs in pascal, but how is the question? Please help me! This is very urgent. Steve... Reply here or via email at... shisc...@atcon.com |
eman..
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Data Segment to LargeQuoteSuperius! (super...@superior.net) wrote: assigning heap memory to pointers with the NEW procedure. Then instead of referring to x as a variable, you use x^ as the variable pointed at by the pointer x. Check the sample programs for examples. b) Make your variables smaller - use singles instead of doubles or c) Store infrequently referenced data arrays as records in disk d) Shrink the buffers on text files. etc. etc. Mostly use the heap. David Emanuel |
Arthur Hoornw
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Data Segment to LargeQuotesuper...@superior.net (Superius!) wrote: variables. Variables that take up a lot of space are ARRAYS and STRINGS. A simple string takes up 256 bytes (255 for the contents, 1 for the Now usually a string needn't contain more than about 80 characters (a "VAR a:String" with "VAR a:String[80]" and you'll save HUNDREDS of Next, try to move all variables that you DON'T NEED GLOBALLY into So instead of: VAR s:array[1..1000] of char; procedure test; Use: procedure test; These tips are the easiest way to save memory, without resorting to Hope this helps, Arthur Hoornweg |
Mundsa
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Data Segment to LargeFor any arrays that you define, put 'em on the heap. Type Var Begin Also, put any strings you want to use in a text file, one per line. Then, If you do this, however, bear in mind that using New() on a String type (Suppose the following line is the contents of your string file:) Program HeapStr; Type Procedure AssignString(sp : PMyString; sv : String); Var Begin This program would output: This is a string on the heap. |
Michael Chap
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Data Segment to LargeIn article <4dovqq$...@thor.atcon.com>, super...@superior.net (Superius!) wrote: Quote>Okay. I am working on a rather large program right now, and I am pointers to those arrays. Allocate the memory for them rather having them static in memory. A pointer only takes eight bytes as opposed to a bunch of memory being taken up by a static array. ----------------------------------------------- Not the end of the earth but you can see it from |