Next Topic

Previous Topic

Book Contents

Object context

Functions are relative to the object context.

All calls that are accessing resources is relative to the parent object. For example, if the scripts opens a file the path supplied to the open function must be relative to the object.

Example

Set the host to be the address of the windows computer "domainserver".

TLuaFile:Open("C:\\test.txt");

Calling the function would make the script open the file test.txt located on the C: harddisk of the computer "domainserver".

This is also why all communication related classes such as TLuaFTPClient, TLuaHTTPClient and TLUASocket only takes an port number argument, the IP address is hard coded to the current object by the framework.