Program

The Program object provides methods and functions to interface directly with Nios4.

clienttype = program.type()

if clienttype == 1 then

output.print("Client windows")

else

output.print("Other client")

end

*value* = program.type()

Returns the current client type.

0 nobody

1 windows

2 android

3 ios

4 web

5 mac

*dataform* = program.newdataform()

Create a new dataform object. The dataform object allows you to create a selection form consisting of input fields that allow the user to type or select values.

*dataview* = program.newdataview (*tablename*,*gguid*)

Creates a new dataview object. The dataview object is a data editing form. It is necessary to indicate the name of the table and any gguid of the row to be loaded. To create a new tab just give a null string ("") as gguid.

*fileinfo* = program.newfileinfo(*pathfile*)

Create a new fileinfo object. The object allows to extrapolate information and to manipulate a file.

program.refreshsection(*tablename*)

Updates all sections by forcing the program to reload data from the database. If null string ("") is passed, the program will update all sections.

*list* = program.listlocalusers()

A list of local users of the currently open database is returned.

*list* = program.listglobalusers()

A list of cloud users who have access to the currently open database is returned.

*list* = program.listnamedatabases()

A list of the names of the databases currently connected to the client is returned.

*list* = program.listpathdatabases()

A list of the paths to the databases currently connected to the Windows client is returned. The databases taken into consideration are only the paths of the databases in Access format.

*value* = program.getusername()

Allows you to retrieve the name of the current user.

*value* = program.getuserid()

Allows you to retrieve the ID of the current user.

*value* = program.useradmin()

Returns a value indicating whether the user is the database administrator.

*xmldocument* = program.newxmldocument()

Creates an xmldocument object to be able to manage and create an XML file.

*xmldocument* = program.loadxmldocument(*path*)

Creates an xmldocument object by loading from an XML file. If a null string ("") is given for the path, the program asks (if the client is Windows) to select the file from a loading window.

program.showwarning(*message*)

Displays a warning message on the program status bar.

program.showconfirm(*message*)

Displays a confirmation message on the program status bar.

program.showerror(*message*)

Displays an error message on the program status bar.

*list* = program.geocoding(*address_string*)

Returns the latitude and longitude of an address. The function can only be used on mobile devices.

*list* = program.geocodingreverse(*lat*,*lng*)

Returns the address based on a longitude and latitude.

*list* = program.geolocation()

Returns the current GPS point. The function can only be used on mobile devices.