Table of Contents

TatScript.SaveCodeToStream Method

Saves the compiled script p-code and meta-information to AStream.

Remarks

Use SaveCodeToStream to save a compiled script p-code to the stream specified by AStream. SaveCodeToStream does not automatically compile the script, so you must do it previously before saving the code. You can save the compiled p-code to a stream in order to load it later using LoadCodeFromStream method. Saving and loading p-code prevents recompilation of the script, making it faster for script execution. SaveCodeToStream also saves the meta information of the script (ScriptInfo object, with all declared routines, methods, etc.). Form resources are also saved, so you don't need the form file when loading the code. You must be aware that the script might use classes, methods and properties registered in the scripter. Those are not saved in the compiled p-code, so when you later load the code, you must be sure that the same used classes, methods and properties are registered in the scripter otherwise the loaded code might not execute properly.

Syntax

Unit: atScript

procedure TatScript.SaveCodeToStream(AStream: TStream); virtual;

Parameters

<-> Parameter Type Description
AStream TStream

See also