file_to_pascal_data - Man Page

convert files to Pascal source code

Synopsis

file_to_pascal_dataINPUT_FILE OUTPUT_FILE
file_to_pascal_stringINPUT_FILE OUTPUT_FILE

Description

The file_to_pascal_data and file_to_pascal_string programs can be used to convert files to Pascal source code, in order to embed data inside Pascal programs.

file_to_pascal_data encodes INPUT_FILE as an Array of Byte, whereas file_to_pascal_string encodes it as a string literal.

Examples

Consider a file containing only the text "Example" (with a newline character at the end) being used as the input.

After converting the input using file_to_pascal_data, the output file can be used like in the following example:

const EmbeddedData: {$INCLUDE output_data.inc};

After including the file, this will evaluate to something like:

const EmbeddedData: array[0..7] of byte = (
    $45, $78, $61, $6D, $70, $6C, $65, $0A
);

The output generated by file_to_pascal_string can be used in a similar fashion:

const EmbeddedString = {$INCLUDE output_string.inc};

After including the file, this will evaluate to something like:

const EmbeddedString = 'Example' + LineEnding;

See Also

pascal_pre_proc(1), pasdoc(1)

Referenced By

pascal_pre_proc(1).

The man page file_to_pascal_string(1) is an alias of file_to_pascal_data(1).

2021-09-22 User commands