Contents | Prev | Next | Index


Environment Variables

Canterbury Pascal for JVM uses the following Java System properties for its environment:

path.separator
A special character which is being used in the java.class.path property for separating its directory list and/or zip-file list entries. On Win32 or OS/2 systems it is the semicolon character ";". On UNIX systems it is the colon character ":"
file.separator
A special character which is being used in the java.class.path property for separating the components of directory names. On Win32 or OS/2 systems it is the character "\". On UNIX systems it is the character "/".
user.dir
This is the users current working directory, usually the one from where he launches the compiler.
java.class.path
A list of directory or zip-file name entries, separated by the path.separator character. When Java looks for a class file, it goes through this list for finding it. If the requested class file is in a package, e.g. "java.awt.event", it looks for the class file in a nested directory, e.g. "java\awt\event\<classfile>", nested as a whole in one of the directory or zip-file entries of the java.class.path property list.

This is where Canterbury Pascal looks for source files:

It first looks for the source file in the current working directory according to the user.dir property. If it is not there, the compiler looks for it in the compiler home directory "mhc\compiler\runtime\pas" (or "mhc/compiler/runtime/pas"), which in turn resides in the installation directory. If it is not there either, the compiler goes through the whole java.class.path list in order to locate the source file.

Finally, this is where Canterbury Pascal for JVM writes its Java output files:

If the compiled Pascal source file contains no JAVA PACKAGE directive, the output goes into the current working directory according to the user.dir property. If the source contains a JAVA PACKAGE directive, it translate its package identifier into a corresponding directory name (e.g. "mystuff.samples" would become "mystuff\samples" or "mystuff/samples" depending on operating and file system being used). It then goes through the whole list of directory entries according to the java.class.path property in an attempt to locate this subdirectory, and it is there where the compiler output then goes. If the compiler can't find the subdirectory it stops with an error message.

Notice that on some systems, e.g. OS/2 HPFS or Windows-95 FAT, files are located by using a case insensitive name search even though file names themselves are stored with correct cases. Though Pascal is case insensitive, too, Java is not. Thus, Java makes a distinction between e.g. "myStuff" and "mystuff" because of being case sensitive, which might not necessarily be the case with some file systems. Hence, to be on the safe side, when using type names for RECORD types (which are mapped to Java classes and will eventually end up as class files) there should be also a case insensitive name distinction for these names.


Contents | Prev | Next | Index

Canterbury Pascal for JVM  (Last documentation update Sep 02, 2004)
Copyright © 1999-2004 J.Neuhoff - mhccorp.com  . All rights reserved.
Please send any comments or corrections to neuhoff@mhccorp.com