[comp.sys.mac.programmer] Think Pascal 2.03 module size

d89-zke@nada.kth.se (Zoltan Kelemen) (05/31/90)

Hello!

I am using Think Pascal version 2.01 for a programming project. I have a Pascal unit, whose text part is quite large (around 60k because of many comments) but the compiled code is no more than approximately 20k. When i try to edit this unit, i get the following error from Think Pascal upon opening the file:

WARNING: The file "xxxx" is near the module size limit

Then, if i try to add text to the file Think Pascal tells me this:

One or more statements which would have pushed program size over the limit have been lost.

The manual says nothing about these error messages. I've figured out that a Think Pascal program has three parts:

Text part		{ pure ascii text of program }
Pseudo-code part	{ The Think Pascal Editor converts every	}
			{ pascal statement to some kind of pseudo-code	}
			{ to make the compilation process faster 	}
Object part		{ the compiled code				}

The module size is the Pseudo-code part size, and has nothing to do with the Object part size. The object part size must be less than 32k because of Macintosh
segment limit.
It seems to me that there is a limitation on how big the Pseudo-code part can be. You don't even have to compile a program to get the error messages above, it's enough that you try to edit a file. Why are these error messages not in the manual?

Is there a way to increase this module size limit or to go around it somehow?

I don't want to split this unit into two separate units, because the code in it fits tightly together logically. It would be bad programming practice to make two units just because of some limitation in the compiler.

An include command would solve my problems. Unfortunately, Think Pascal unlike MPW lacks include possibilities.

I would be very grateful if somebody out there has an answer.

Zoltan Kelemen, Stockholm, Sweden

siegel@endor.harvard.edu (Rich Siegel) (05/31/90)

In article <1990May30.190521.13299@nada.kth.se> d89-zke@nada.kth.se (Zoltan Kelemen) writes:
>
>WARNING: The file "xxxx" is near the module size limit
>
>One or more statements which would have pushed program size over the limit have been lost.

	The only surefire way around the file size limit is to upgrade to
version 3.0, which increases the maximum size of the internal form from
64K to two gigabytes (RAM permitting :-)).

R.



~~~~~~~~~~~~~~~
 Rich Siegel
 Staff Software Developer
 Symantec Corporation, Language Products Group
 Internet: siegel@endor.harvard.edu
 UUCP: ..harvard!endor!siegel

"It's not the years, honey, it's the mileage."

~~~~~~~~~~~~~~~