Home News DOC Class DL Others Cooker
Documents  >  Reference  >  import command
Loading of external source code

import command

Extracts the source code from the external file to the position of the command. If the command is outside of the class definition, it can be used anywhere in the source file. There is no limit to the order and number of the command.

Format is:


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


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"


This is the standard Windows path specification. We will omit the explanation.

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"


This is the standard Windows path specification. We will omit the explanation.

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. We will omit the explanation.

Next
Previous
Copyright © Rice All rights reserved.