Xbasic

A5_REGISTRATION_LICENSE_INUSE Function

Alpha Anywhere no longer produces .MUF files. The Alpha Anywhere Runtime no longer restricts the number of concurrent users.

Syntax

User_Count as N = A5_REGISTRATION_LICENSE_INUSE(fileName as c[,N serial_start,N count])

Arguments

fileName

Character. The name of the file tracking concurrent users.

serial_start

Numeric

count

Numeric

Description

Return the number of users logged in via a .muf file, optional license key if checking a *different* installation (for example runtime).

Discussion

The A5_REGISTRATION_LICENSE_INUSE() function counts the number of users in .MUF and .RMUF files. This makes it easier for developers to control the number of simultaneous users of an application. When an application is opened (i.e. an .ADB file is opened), Alpha Anywhere keeps track of the number of simultaneous users of that application in a .MUF file with the same name as the .ADB file. If the application is opened using Runtime, Alpha Anywhere keeps track of the number of users in a .RMUF file.

Example 

Open AlphaSports.

? a5_registration_license_inuse("C:\Program Files\A5v6\Samples\Alphasports\Alphasports.muf")

Open a second copy of AlphaSports.

? a5_registration_license_inuse("C:\Program Files\A5v6\Samples\Alphasports\Alphasports.muf")
= 2

Open a third copy of AlphaSports using the Alpha Anywhere Runtime and check the .RMUF file.

? a5_registration_license_inuse("C:\Program Files\A5v6\Samples\Alphasports\Alphasports.rmuf")
= 1

Close the second copy of AlphaSports.

? a5_registration_license_inuse("C:\Program Files\A5v6\Samples\Alphasports\Alphasports.muf")
= 1

This example gets the total number of users of the current application.

dim MUFFile as C
MUFFile = file.filename_parse(a5.get_name() ,"dpn") + ".muf"
dim RMUFFile as C
RMUFFile = file.filename_parse(a5.get_name() ,"dpn") + ".rmuf"
dim totalUsers as N
totalUsers = a5_registration_license_inuse(MUFFile) + a5_registration_license_inuse(RMUFFile)

Limitations

Desktop applications only.

See Also