Difference between revisions of "SCI Programming Language/Files"

From SCI Wiki
Jump to navigationJump to search
 
(11 intermediate revisions by the same user not shown)
Line 37: Line 37:
 
<blockquote>This contains the definitions for interfacing with the various system classes and procedures. It also contains the system global variable definitions and defines for keycodes, script numbers, etc. It is automatically included in all compiles.</blockquote>
 
<blockquote>This contains the definitions for interfacing with the various system classes and procedures. It also contains the system global variable definitions and defines for keycodes, script numbers, etc. It is automatically included in all compiles.</blockquote>
  
===<br /> kernel.sh
+
===<br /> kernel.sh ===
 
<blockquote>This contains the definitions for interfacing with the kernel.</blockquote>
 
<blockquote>This contains the definitions for interfacing with the kernel.</blockquote>
  
Line 49: Line 49:
 
<blockquote>This is a text file that contains a list of class-selector pairs for frequently used properties. It is used by the compiler to produce 994.voc.</blockquote>
 
<blockquote>This is a text file that contains a list of class-selector pairs for frequently used properties. It is used by the compiler to produce 994.voc.</blockquote>
  
===<br /> 994.voc
+
===<br /> 994.voc ===
 
<blockquote>For each class-selector pair in offsets.txt, the compiler writes an entry to this file containing the offset of that property in an SCI object. With this information, the interpreter can access a frequently used property without going through the message-passing mechanism. It is generated by the compiler when the -0 command line parameter is used.</blockquote>
 
<blockquote>For each class-selector pair in offsets.txt, the compiler writes an entry to this file containing the offset of that property in an SCI object. With this information, the interpreter can access a frequently used property without going through the message-passing mechanism. It is generated by the compiler when the -0 command line parameter is used.</blockquote>
  
Line 60: Line 60:
 
===<br /> $$$sc.lck ===
 
===<br /> $$$sc.lck ===
 
<blockquote>This read-only file serves as a semaphore, indicating that a compile is occurring in the current directory. This prevents two compiles from trying to do the same task concurrently (updating the same classdef, for instance). $$$sc.lck is created at the beginning of a compile and deleted at the end.</blockquote>
 
<blockquote>This read-only file serves as a semaphore, indicating that a compile is occurring in the current directory. This prevents two compiles from trying to do the same task concurrently (updating the same classdef, for instance). $$$sc.lck is created at the beginning of a compile and deleted at the end.</blockquote>
 +
&nbsp;
  
 
The following two SCI commands deal with source code organization:
 
The following two SCI commands deal with source code organization:
Line 70: Line 71:
 
sets the output file names to 4.scr and 4.hep, regardless of the actual name of the
 
sets the output file names to 4.scr and 4.hep, regardless of the actual name of the
 
source file.</blockquote>
 
source file.</blockquote>
 +
 +
===<br /> scriptID ===
 +
<blockquote><div id="scriptID"></div><code>(scriptID 86 0)</code></blockquote>
 +
 +
<blockquote>Unknown hand written note</blockquote>
  
 
===<br /> include ===
 
===<br /> include ===
Line 77: Line 83:
  
 
includes the file /sc/foo.sh. Include files may be nested as deeply as desired.</blockquote>
 
includes the file /sc/foo.sh. Include files may be nested as deeply as desired.</blockquote>
 +
&nbsp;
  
When compiling or including a file, the compiler first looks in the current directory. If it fails to find it there, it next looks for the file in the directories specified in the environment variable '''sinclude'''. This variable is just like the DOS path variable. The search directories are separated by semicolons. To set the compiler to look for include files in f:/games/scilsystem and c:/include if it doesn't find them in the current directory, add the line:
+
When compiling or including a file, the compiler first looks in the current directory. If it fails to find it there, it next looks for the file in the directories specified in the environment variable <div id="sinclude"></div>'''sinclude'''. This variable is just like the DOS path variable. The search directories are separated by semicolons. To set the compiler to look for include files in f:/games/scilsystem and c:/include if it doesn't find them in the current directory, add the line:
  
 
<blockquote><code>set sinclude=f:/games/sci/system;c:/include</code></blockquote>
 
<blockquote><code>set sinclude=f:/games/sci/system;c:/include</code></blockquote>

Latest revision as of 19:32, 26 May 2016

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Index


Files
Author: Jeff Stephenson

 

Files

Source files for the script compiler traditionally have the extension .sc. Header (include) files traditionally have the extension .sh. Message editor header files traditionally have the extension .shm. Source files may have any filename; two examples are banner.sc and castle.sc. The two output files from the compilation will have the names number.scr and number.hep where number is the script# (defined below) of the module. Following are other files (besides the source file and any user-defined header files) which are involved in a compilation.


classdef

This file contains the information about the structure of the classes which have been defined in the application. It is read automatically by the compiler and is rewritten by the compiler after a successful compilation in order to keep it up to date.


selector

This file contains definitions of selectors which are used in object-oriented programming. It is automatically included in a compile and, like classdef, is rewritten after a successful compile. Any symbol in a properties or methods statement or in the selector position in a send to an object is assumed to be a selector and is assigned a selector number included in selector.


system.sh

This contains the definitions for interfacing with the various system classes and procedures. It also contains the system global variable definitions and defines for keycodes, script numbers, etc. It is automatically included in all compiles.


kernel.sh

This contains the definitions for interfacing with the kernel.


game.sh

This is the game-specific header file. It contains global variables, procedure declarations, and definitions for an individual game. It is automatically included in the compile after system.sh.


classes.txt

This is a text file produced by the compiler that is used by a BRIEF macro to browse the SCI class system.


offsets.txt

This is a text file that contains a list of class-selector pairs for frequently used properties. It is used by the compiler to produce 994.voc.


994.voc

For each class-selector pair in offsets.txt, the compiler writes an entry to this file containing the offset of that property in an SCI object. With this information, the interpreter can access a frequently used property without going through the message-passing mechanism. It is generated by the compiler when the -0 command line parameter is used.


996.voc

This is the class table. It specifies the number of the script files that contain each class.


997.voc

This file contains the names of selectors. It is only used by the debugger and in printing error messages.


$$$sc.lck

This read-only file serves as a semaphore, indicating that a compile is occurring in the current directory. This prevents two compiles from trying to do the same task concurrently (updating the same classdef, for instance). $$$sc.lck is created at the beginning of a compile and deleted at the end.

 

The following two SCI commands deal with source code organization:


script#

The script# command sets the script number of the output file.

(script# 4)

sets the output file names to 4.scr and 4.hep, regardless of the actual name of the

source file.


scriptID

(scriptID 86 0)

Unknown hand written note


include

This includes a header file in the current source file at the current position.

(include "/sc/foo.sh") or (include /sc/foo.sh)

includes the file /sc/foo.sh. Include files may be nested as deeply as desired.

 

When compiling or including a file, the compiler first looks in the current directory. If it fails to find it there, it next looks for the file in the directories specified in the environment variable

sinclude. This variable is just like the DOS path variable. The search directories are separated by semicolons. To set the compiler to look for include files in f:/games/scilsystem and c:/include if it doesn't find them in the current directory, add the line:

set sinclude=f:/games/sci/system;c:/include

to your autoexec.bat file.

 

Notes


Table of Contents

< Previous: Procedures Next: Compiling SCI >