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.RequestString - Display a dialog box for retrieving a character string

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.RequestString('box_caption'); 

Description

The lpav.RequestString LUA function displays a dialog box for retrieving a character string.

Warning! If you use this function, the main thread of your ActiveView is blocked throughout the time during which the dialog box is displayed.

Parameters

‘box_caption’           A comment inside the dialog box

Return Values

‘string’      The character string input by the user

Return nil if an error occurs

Example

The following example move some object with the value input by the user.

lpav.Load(lp.GetPath().."/config/active-view/sample/Cisco3500.cmp");

lpav.SelectAll();

lpav.RefreshMap();

shift=lpav.RequestString("Shift to x ?");

lpav.ShiftPositionAllSelected(lp.atof(shift),lp.atof(shift));

lpav.RefreshMap();

 

input string in lua and active view

 

input string in lua and active view

Warning! In this example we can notice that some widgets have not been offset. This is because it is impossible to move an object graph outside the display area of a ActiveView. In our case, the loaded ActiveView defines constraints that prevent the rightward shift of 100 pixels for large objects


www.loriotpro.com