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.SelectAllRef - Select all objects with the same reference

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

number = lpav.SelectAllRef(number (1-4), mode, string);

Description

Allow to select a group of graphical Active View objects with their reference variables. All the objects that contain the specified string in the specified reference variable number are selected.

A reference variable is a user defined reference that is 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

Mode - The case mode, 1 nocase sensitive, 0 case sensitive

string - The character string that your are looking for. The name of the group of object a user defined reference.

Return Values

number - The number of object selected, 0 if zero object and nil if error.

Example

dofile(lp.GetPath().."/config/script/loriotinit.lua");

zz=LPAV_OBJ_ANALOGIC_METER_01;

k=0;
for i=0,5 do
lpav.Insert(20*i,1,9,9,zz);
lpav.SetRef(1,"ref");
lpav.SetClipart( lp.GetPath().."/card/vumeters/vumeter8.emf");
if (i==3) then
lpav.SetRef(1,"other");
end;
end
aa=lpav.SelectAllRef(1,0,"ref");
lp.Trace("number found =",aa);
if aa then
lpav.DeleteAllSelected();
end
lpav.RefreshMap();
lp_buffer ="ok";

 


www.loriotpro.com