To use this website fully, you first need to accept the use of cookies. By agreeing to the use of cookies you consent to the use of functional cookies. For more information read this page.

Official ZPE/YASS documentationIncluding other code

One of the greatest things about C or PHP is being able to include other code files. ZPE has supported libraries since a minor version of version 1.3 and yet as of version 1.5, it has no way to include a script, other than the run_script function.

To make development of larger applications more efficient, ZPE 1.5.1 and onward feature the includes keyword. This keyword signifies to the compiler to include a file's contents. The file should be UTF-8 text but the extension does not matter.

It's really easy to use the new feature by simply using:

includes "file_to_include.txt"

Inclusion is done at parse time (the step before compliation) and therefore if a program is compiled with a file included the file cannot be modified after.

If the file contains valid ZPE/YASS code, the code is included as part of the main application script and compiled as part of it.

Code previewClose
Feedback 👍
Comments are sent via email to me.