Difference between revisions of "Manual:DIL Manual/Built-In Procedures"
Jump to navigation
Jump to search
(XML import) |
(XML import) |
||
| Line 1: | Line 1: | ||
| + | <span id="biproc"></span> | ||
| + | <h3>Built-In Procedures:</h3> | ||
| + | DIL features some built-in procedures that allows you increased control over | ||
| + | in-game data structures and event handling. Once such procedure (used above)is | ||
| + | 'exec()'. The inline procedures are used as any other procedure by typing its | ||
| + | name, followed by a list of argument expression enclosed in parentheses. The | ||
| + | return types of the expressions used for built-in procedure calls are checked | ||
| + | by the compiler. | ||
| + | |||
| + | DIL also lets you call templates defined in the current or other zones. The | ||
| + | naming of templates follows the normal naming convention for zone, using the | ||
| + | 'name@zone' as a symbolic name for a procedure. Before being able to use | ||
| + | external procedures, you must define their name and type in a separate | ||
| + | 'external' section in the template. The declaration in the 'external' section | ||
| + | should match the original declaration of the referenced program. You can define | ||
| + | the number and type of arguments the template take, by listing them inside the | ||
| + | declaration parenthesis (as well as in the original declaration of that template) | ||
| + | (see example below) | ||
| + | |||
| + | '''Example:''' | ||
| + | |||
| + | <nowiki> | ||
| + | |||
| + | dilbegin bar(s:string); | ||
| + | code | ||
| + | dilend</nowiki> | ||
| + | |||
| + | <nowiki> | ||
| + | dilbegin foo(); | ||
| + | external | ||
| + | someproc@hades1(); | ||
| + | bar(s:string); | ||
| + | code | ||
| + | dilend</nowiki> | ||
| + | When the procedure is called, the argument expressions are calculated, and | ||
| + | passed to the template. Built-in procedures, their arguments and function | ||
| + | are listed later. | ||
| + | |||
| + | The following are definitions and documentation for the built-in procedures | ||
| + | in DIL. The definitions are not definitions 'as such', but serve to distinguish | ||
| + | arguments in the documentation below. | ||
| + | |||
| + | |||
| + | ---~---~---~---~---~---~---~---~--- | ||
<span id="biproc"></span> | <span id="biproc"></span> | ||
<h3>Built-In Procedures:</h3> | <h3>Built-In Procedures:</h3> | ||
| Line 26: | Line 70: | ||
dilbegin bar(s:string); | dilbegin bar(s:string); | ||
code | code | ||
| − | + | dilend</nowiki> | |
| − | |||
| − | |||
| − | |||
| − | |||
<nowiki> | <nowiki> | ||
| Line 39: | Line 79: | ||
bar(s:string); | bar(s:string); | ||
code | code | ||
| − | + | dilend</nowiki> | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
When the procedure is called, the argument expressions are calculated, and | When the procedure is called, the argument expressions are calculated, and | ||
Latest revision as of 22:30, 4 December 2025
Built-In Procedures:
DIL features some built-in procedures that allows you increased control over in-game data structures and event handling. Once such procedure (used above)is 'exec()'. The inline procedures are used as any other procedure by typing its name, followed by a list of argument expression enclosed in parentheses. The return types of the expressions used for built-in procedure calls are checked by the compiler.
DIL also lets you call templates defined in the current or other zones. The naming of templates follows the normal naming convention for zone, using the 'name@zone' as a symbolic name for a procedure. Before being able to use external procedures, you must define their name and type in a separate 'external' section in the template. The declaration in the 'external' section should match the original declaration of the referenced program. You can define the number and type of arguments the template take, by listing them inside the declaration parenthesis (as well as in the original declaration of that template) (see example below)
Example:
dilbegin bar(s:string); code dilend
dilbegin foo();
external
someproc@hades1();
bar(s:string);
code
dilend
When the procedure is called, the argument expressions are calculated, and passed to the template. Built-in procedures, their arguments and function are listed later.
The following are definitions and documentation for the built-in procedures in DIL. The definitions are not definitions 'as such', but serve to distinguish arguments in the documentation below.
---~---~---~---~---~---~---~---~---
Built-In Procedures:
DIL features some built-in procedures that allows you increased control over in-game data structures and event handling. Once such procedure (used above)is 'exec()'. The inline procedures are used as any other procedure by typing its name, followed by a list of argument expression enclosed in parentheses. The return types of the expressions used for built-in procedure calls are checked by the compiler.
DIL also lets you call templates defined in the current or other zones. The naming of templates follows the normal naming convention for zone, using the 'name@zone' as a symbolic name for a procedure. Before being able to use external procedures, you must define their name and type in a separate 'external' section in the template. The declaration in the 'external' section should match the original declaration of the referenced program. You can define the number and type of arguments the template take, by listing them inside the declaration parenthesis (as well as in the original declaration of that template) (see example below)
Example:
dilbegin bar(s:string); code dilend
dilbegin foo();
external
someproc@hades1();
bar(s:string);
code
dilend
When the procedure is called, the argument expressions are calculated, and passed to the template. Built-in procedures, their arguments and function are listed later.
The following are definitions and documentation for the built-in procedures in DIL. The definitions are not definitions 'as such', but serve to distinguish arguments in the documentation below.
---~---~---~---~---~---~---~---~---