Use (GETVAL('GetMACAddr','n')) to retrieve the number of active network adapter(s) on workstation/server as well as the physical MAC (Media Access Control) address(es) of active network adapter(s).
Media Access Control address is a physical hardware address that uniquely identifies each node of a network. In IEEE 802 networks, the Data Link Control (DLC) layer of the OSI Reference Model is divided into two sub-layers: the Logical Link Control (LLC) layer and the Media Access Control (MAC) layer. The MAC layer interfaces directly with the network media. Consequently, each different type of network media requires a different MAC layer.
Where 'n' is the parameter to either retrieve the number of active network adapters or to retrieve the MAC address of given active network adapter. Use '0' to retrieve the number of active network adapters and 1-9 to retrieve the MAC address of active network adapter(s) on given network station/server.
Examples:
Example 01: To get the number of active network adapter(s)
SET VAR vActiveAdapters = (GETVAL('GetMACAddr','0'))
The variable vActiveAdapters will return the number of active network adapters on that work station/server.
Example 02: To retrieve the MAC address of first active adapter
SET VAR vMACAddress = (GETVAL('GetMACAddr','1'))
The variable vMACAddress will return the value of first active network adapter on that workstation.
Example 03: To retrieve the MAC address of second active adapter
SET VAR vMACAddress = (GETVAL('GetMACAddr','2'))
The variable vMACAddress will return the value of second active network adapter on that workstation.
Example 04: To retrieve the MAC address of third active adapter
SET VAR vMACAddress = (GETVAL('GetMACAddr','3'))
The variable vMACAddress will return the value of third active network adapter on that workstation.
Practically, this new (GETVAL('GetMACAddr','n')) function can be used to customize access to your R:BASE for Windows Applications. Consequently, you can use this function to customize the properties of any control and/or settings of form using the PROPERTY command based on unique MAC address of workstation.
Example 05: Disabling/Hiding Application Menus based on MAC Address
Assuming your application includes 6 main menu options, namely Customers, Contacts, Employees, Products, Sales, Quarterly Sales Reports, General Inquiry (Read Only) with Component IDs MM_Customers, MM_Contacts, MM_Employees, MM_Products, MM_Sales, MMQuarterlyReports, MM_GeneralInquiry accordingly.
In a secure work environment, suppose only one workstation or notebook can have access to all menus with MAC address 00-0D-43-2B-D6-B4 and everyone else can only access to General Inquiry (Read Only) menu.
If you would like to disable Customers, Contacts, Employees, Products, Sales and Quarterly Sales Report menus to all except the workstation or notebook with the MAC address 00-0D-43-2B-D6-B4, then here's an example to use as embedded Custom EEP in "On After Start EEP" option of form properties:
IF (GETVAL('GetMACAddr','1')) <> '00-0D-43-2B-D6-B4' THEN
PROPERTY MM_Customers ENABLED 'FALSE'
PROPERTY MM_Contacts ENABLED 'FALSE'
PROPERTY MM_Employees ENABLED 'FALSE'
PROPERTY MM_Products ENABLED 'FALSE'
PROPERTY MM_Sales ENABLED 'FALSE'
PROPERTY MM_QuarterlyReports ENABLED 'FALSE'
ENDIF
RETURN
If you would like to hide Customers, Contacts, Employees, Products, Sales and Quarterly Sales Report menus to all except the workstation or notebook with the MAC address 00-0D-43-2B-D6-B4, then here's an example to use as embedded Custom EEP in "On After Start EEP" option of form properties:
IF (GETVAL('GetMACAddr','1')) <> '00-0D-43-2B-D6-B4' THEN
PROPERTY MM_Customers VISIBLE 'FALSE'
PROPERTY MM_Contacts VISIBLE 'FALSE'
PROPERTY MM_Employees VISIBLE 'FALSE'
PROPERTY MM_Products VISIBLE 'FALSE'
PROPERTY MM_Sales VISIBLE 'FALSE'
PROPERTY MM_QuarterlyReports VISIBLE 'FALSE'
ENDIF
RETURN