LUALoriotPro WEB site

LoriotPro scripting documentation
Extensions for LUA language

Table of contents Search function

Print the current page Mail this  link UTUBE Channel version française

lpav.GetRef - Get the references attached to a graphical object

LoriotPro has extended the LUA sripting language by providing its own LUA libraries. The new functions provided are dedicated to the creation of monitoring and SNMP automation application.

Syntax 

string = lpav.GetRef(number(1-4));
objet_number = lpav.FindRef(number (1-4), mode, string,array);

Description

Read a reference variable linked to the default graphical object. A reference variable is a user defined reference that are assigned with the lpav.SetRef function.

A graphical object has 4 reference variables. These reference variables are used to create groupe of graphical objects or for object manipulation. The first object in the list become the default object of the group.

Parameters

number - The reference number, either 1, 2, 3 or 4

Return Values

string - The character string of the reference variable or nil if error or empty.

Example

lp_value = 0;
lp_buffer ="error";

dofile(lp.GetPath().."/config/script/loriotinit.lua");
lpav.Insert(10,30,99,99,LPAV_OBJ_FILL_CIRCLE);
lpav.SetRef(1,"ref1");
lpav.SetRef(2,"ref2");
lpav.SetRef(3,"ref3");
lpav.SetRef(4,"ref4");

lp.Trace(lpav.GetRef(1));
lp.Trace(lpav.GetRef(2));
lp.Trace(lpav.GetRef(3));
lp.Trace(lpav.GetRef(4));

lpav.RefreshMap();
lp_buffer ="ok";


 



www.loriotpro.com