Home About Rice Downloads Documents Others Cooker CookerGX
Documents  >  Reference  >  import
Loading of external source code

import command

Source code defined in an external file will be loaded in the source file. If Import command is outside of the class definition, it can be used anywhere in the source file. An order of the import command is unlimited.

Import command is the following format.


import "file path"


The file path specify the location of the external file. There are three ways to specify a file path in the import command.


Absolute path specification

Relative path specification

Expanded relative path specification


please be careful about the end symbol (semicolon) is never used at an import command.

Absolute path specification

Absolute path specification is a method to describe the position of the file beginning from a top hierarchy of the file system.

In the Windows file system, a drive letter is the top hierarchy, so it'll be as follows.


"C:\Users\YourName\Documents\Rice\souce\sample.88"


Details of absolute path specification do not explain. Please search if it is necessary.

Relative path specification

Relative path specification is a method to describe the position of the file from a current directory.

In the Windows file system, the dot is a symbol to specify, so it'll be as follows.


".\sample.88"

"..\source\sample.88"


Details of relative path specification do not explain. Please search if it is necessary.

Expanded relative path specification

Expanded relative path specification is a method to describe the position of the file from a current source file.

In the expanded relative path specification, the @ is a symbol to specify, so it'll be as follows.


"@\sample.88"

"@@\source\sample.88"


Single @ expresses the directory which a current source file is put.

Double @ expresses the parent directory of the directory which a current source file is put.

Double @ can repeat any number. For example, "@@\@@\ ... " expresses a parent directory of a parent directory.

The usage of @ is same as dot of relative path specification. Details of relative path specification do not explain. Please search if it is necessary.

Next
Previous
Copyright © Rice All rights reserved.