The initialisation files system is a mechanism for setting commonly used options for a program. The is a primary initialisation file that should always be called "grarls.ini" and placed in the same directory as the main executable file "grarls.exe". This will be read before the command line is processed. The user may create any other initialisation files and place them on the command line.
The initialisation file consists of two sections. The first is a general default section to set up default values for things like the image size and the language to use. Any default can be overridden by a value explicitly stated on the command line or in another ini file specified on the command line.
The second section is for setting up directory aliases.
assignment ::= target = value ;
The ini files may also contain comments using the same syntax as in the source files.
The defaults section is introduced with the "[Defaults]" section tag.
There is a fixed set of targets, which are covered below.
This will set the default output graphics file type. It should be one of the identifiers :- AVI, BMP, PNG, JPG or PAT.
This can be overridden on the command line with one of the output file type parameters e.g. -bmp.
This will set the default language file to use. The language name is used to generate the path of the language file. The extension ini will be appended to the name and the file be looked for in the directory specified by the LANGFILES directory ( see below ).
This can be overridden on the command line with the -lng parameter.
This specifies where the graphics files generated should be written. The value can be a Windows path name or a GraRLS style pathname using directory aliases.
This can be overridden on the command line with the -out parameter.
This will specify default size of any image produced. The format is the same as on the command line.
This can be overridden on the command line with the value following the file type.
This is the number of frames per second. This only applies to video output.
This can be overridden on the command line with the -fps parameter.
This is a value in the range 1 to 100 representing the quality of output of lossy compressed image files. The exact effect of each value depends on the type of file. For AVI files a value of 0 indicates that the images should not be compressed.
This can be overridden on the command line with the -qty parameter.
The directory section is introduced with the "[Directories]" section tag.
This section contains a list of all the directory aliases that can be used within programs.
An alias name must be at least TWO characters long ( single letters are treated as system drive codes ) and the characters must be in the ASCII section of the letter or digits. By convention alias are in upper case and do not start with a digit.
If a definition itself contains an alias then the substitution will be done when the ini file is processed.
[Defaults] FileType = "PNG"; Size = 240x200; Language = "English"; OutDir = "TESTOUT:"; [Directories] [= this will generally vary between users =] ROOT = "C:/Robin/GraRLS"; [= standard directory - should not be changed =] LANGFILES = "ROOT:/LangFiles"; [= standard library - should not be changed =] STDLIB = "ROOT:/stdlib"; [= user's own added directory =] MYPROJ = "C:/Robin/GraRLS/tests"; [= user's own added directory =] TESTDATA = "C:/Robin/GraRLS/TestData"; [= probably be overridden on command line =] TESTOUT = "C:/Robin/GraRLS/testout";