Standard front-end functions

 

The table below shows the built-in functions implemented by the front end in the "standard" module. Additional modules and functions are available for front ends, but are specific to the front-end type.

 

The names of front-end functions and pre-defined arguments are case-sensitive.

 

Function

Description

Lycia

Desktop

LyciaWeb

LyciaTouch

cbadd

adds the text passed as an argument to the content of the clipboard of the front-end platform:

 

ui.Interface.frontCall("standard", "cbadd", [text], [result])

 

text = text to be added

result = variable which holds the results of the function execution (1 = success, 0 = error)

cbclear

clears the content of the clipboard:

 

ui.Interface.frontCall("standard", "cbсlear", [], [result])

 

result = variable which holds the results of the function execution (1 = success, 0 = error)

 

Takes no input arguments

cbget

returns the current content of the clipboard:

 

ui.Interface.frontCall("standard", "cbget", [], [text])

 

text = text found in the clipboard

 

Takes no input arguments

cbpaste

pastes the content of the clipboard to the current field:

 

ui.Interface.frontCall("standard", "cbpaste", [], [result])

 

result = variable which holds the results of the function execution (1 = success, 0 = error)

 

Takes no input arguments

cbset

sets the content of the clipboard:

 

ui.Interface.frontCall("standard", "cbset", [text], [result])

 

text = text to be set

result = variable which holds the results of the function execution (1 = success, 0 = error)

 

The text is passed as argument

feinfo

returns a front-end property value (according to the property name passed as the argument):

 

ui.Interface.frontCall("standard", "feinfo", [name], [result])

 

name = name of the property

result = variable which holds the results of the function execution (1 = success, 0 = error)

 

See the table below for property names and values

getenv

returns the environment variable set in the user session on the front-end platform:

 

ui.Interface.frontCall("standard", "getenv", [name], [value])

 

name = name of the environment variable

value = value of the environment variable

getwindowid

returns the local identifier that corresponds to the AUI window id passed as an argument, in the window manager where the front end is displaying application forms:

 

ui.Interface.frontCall("standard", "getwindowid", [aui-win-id], [loc-win-id])

 

aui-win-id = id of the window node in the AUI tree:

 

OPEN WINDOW aui-win-id AT 5, 2 WITH 20 ROWS, 80 COLUMNS

 

loc-win-id = id of the window in the window manager where the front end is running

 

The node id must refer to a Window node: Otherwise, "0" is returned.

      In the traditional mode, window widgets are simple frames.

      Use "0" as aui-win-id argument to get the top level window id in the local windowing system

server responds without requesting the client side

launchurl

opens an URL with the default URL handler available on the front-end platform.

This is typically a web browser for "HTTP:" URLs, or the mailer for "mailto:" URLs, but the corresponding application may also be dedicated to the object  type specified by the URL:

 

ui.Interface.frontCall("standard", "launchurl", [url [, mode ]], [])

 

url = URL to invoke

mode (optional) = front end specific meaning

 

launchurl is a powerful feature: Front-end applications can register themselves as URL handlers,

      so you can start applications on the front end through the lauchurl front call

opendir

opens a file dialog window on the local file system where the end user can enter a directory path:

 

ui.Interface.frontCall("standard", "opendir", [path, caption], [result])

 

path = default path

caption = caption to be displayed

result = name of the selected directory (or NULL if canceled)

 

If the user cancels the dialog, the front-call returns NULL for result

openfile

allows opening existing files: A file dialog window on the local file system is opened where the end user can enter the file path:

 

ui.Interface.frontCall("standard", "openfile", [path, name, filetype, caption], [result])

 

path = default path

name = name to be displayed for the file type

filetype = file types (as a blank separated list of extensions)

caption = caption to be displayed

result = name of the selected file (or NULL if canceled)

 

If the user cancels the dialog, the front-call returns NULL for result

savefile

allows saving new files: A file dialog window on the local file system is opened where the end user can enter the file path:

 

ui.Interface.frontCall("standard", "savefile", [path, name, filetype, caption], [result])

 

path = default path

name = name to be displayed for the file type

filetype = file types (as a blank separated list of extensions)

caption = caption to be displayed

result = name of the selected file (or NULL if canceled)

 

If the user cancels the dialog, the front-call returns NULL for result

setwebcomponentpath

defines the basic path to find gICAPI web components files:

 

ui.Interface.frontCall("standard", "setwebcomponentpath", [path], [])

 

path = basic URL or the path to the web-component file:

 

LET res = "c://1//wc01//wc01.html"

LET res = "http://querix.com/go/docs_online/"

 

This function will work only for LyciaDesktop as LyciaWeb opens only files which are stored on the application server.

shellexec

opens a file on the front-end platform with the program associated with the file extension:

 

ui.Interface.frontCall("standard", "shellexec", [document, action], [result])

 

document = document file to be opened

action (optional, ) = action to perform, related to the way the file type is registered in Windows Registry

result = variable which holds the results of the function execution (1 = success, 0 = error)

 

To view documents which can be displayed by web browsers, it is better to use launchurl instead.

execute

executes a command on the workstation with or without waiting:

 

ui.Interface.frontCall("standard", "execute", [cmd, wait], [result])

 

cmd = command to be executed

wait = wait option (TRUE=wait, FALSE=do not wait)

result = variable which holds the results of the function execution (1 = success, 0 = error)

 

If the second argument is set to 1 (TRUE), the runtime system will wait until the front end gives the control back

after the local command was executed

not implemented

hardcopy

prints a screen shot of the current window:

 

ui.Interface.frontCall("standard", "hardcopy", [pgsize], [result])

 

pgsize = pass "1" to adapt the screen shot to the page size

result = variable which holds the results of the function execution (1 = success, 0 = error)

 

pgsize is optional: Either leave out, or enter "1" to indicate that the screen shot must be adapted to the page size

not implemented

mdclose

unloads a DLL or shared library front-call module:

 

ui.Interface.frontCall("standard", "mdclose", [name], [result])

 

name = name of the module to be closed

result = variable which holds the results of the function execution (0 = success, -1 = module not found, -2 = cannot unload, busy)

 

Front call modules are loaded on demand.

After calling a function of a specific module, you can use mdclose to unload the shared library and save resources

not implemented

playsound

opens the sound file passed as argument and plays the sound on the front end:

 

ui.Interface.frontCall("standard", "playsound", [text], [])

 

filename = sound file to play

 

If the file is not located on the front end, it will be automatically transferred to the front end through the file-transfer facility.

Supported sound formats depend on the front-end infrastructure (platform, technology, web browser, ...)

not implemented

setreportprinter

allows overriding the printer configuration used for report generation for the current application:

 

ui.Interface.frontCall("standard", "setreportprinter", [printer], [result])

 

printer = string describing the printer to be used for report generation

result = variable which holds the results of the function execution (1 = success, 0 = error)

 

Printer argument is a string that describes the printer to be used for report generation:

 

ui.Interface.frontCall("standard", "setreportprinter", [moliere, Portrait, A4, 96 dpi, 1 copy, Ascendent, Color, Auto], [result])

not implemented

setreportfont

allows overriding the font used for report generation for the current application:

 

ui.Interface.frontCall("standard", "setreportfont", [font], [result])

 

font = string describing the font to be used for report generation

result = variable which holds the results of the function execution (1 = success, 0 = error)

 

Font argument is a string that describe the font to be used for report generation:

 

ui.Interface.frontCall("standard", "setreportfont", [Helvetica, Bold, Italic, 13], [true])

not implemented

 

 

feinfo properties

 

fename

returns the name of the front end

fepath

returns the installation directory of the front-end executable

ostype

returns the type of the operating system installed on the client's host (can be Windows, OSX, HPUX, AIX®, SOLARIS, LINUX)

osversion

returns the current version of the operating system installed on the client's host

numscreens

returns the number of screens available on the front-end platform (typically, 1)

screenresolution

returns the screen resolution of the front-end platform (with a screen number as optional argument). For mobile devices, the value can change depending on the device orientation

ip

returns the IP address of the network interface used for GUI connection

datadirectory

returns the directory name that can be used to transfer temporary files. This directory is common to all front-end instances and is cleaned when the front-end instance starts and ends

target

returns the target code name for the build platform, identifying the operating system at which the front-end binary code was compiled. This front call serves for debugging purpose; it can change if the target OS changes (e.g. after version upgrades)

isActiveX

returns "TRUE" when the front-end runs in Active X mode (LyciaDesktop specific).

outputmap

returns the output map for the current application run by LyciaWeb

 

 

Related article:

FrontCall()