checkForLicense

Syntax

checkForLicense(Feature:string, Version:string, PasswordHash:string) → integer

The function checkForLicense checks if a user-defined license is available or not.

Parameters

  • The parameter Feature of data type string designates the name of the license feature.

  • The parameter Version of data type string designates the requested version number of the license.

  • The parameter PasswordHash of data type string designates the SHA-1-Hash of the password of the license.

Return Value

The return value has the data type integer.

The individual values have this meaning:

  • 0: The license feature is registered and valid.

  • 1: The license feature is not registered.

  • 2: The file has an invalid registry data format.

  • 3: The SHA-1-Hash is wrong.

  • 4: The Host-ID is wrong.

  • 5: The registered version of the feature is too old.

  • 6: The license has expired.

  • 7: The feature does not permit the use with the license type of Plant Simulation (Professional / Standard / Runtime /...).

Example

if checkForLicense("MyFeature", "1", "686483805ac47ca14e03514f7481a7973b401762") = 0 
-- The license is available, you can proceed ...
else
closeModel
messageBox("The license 'MyFeature' is unavailable. The model was closed.\n", 1, 1)
end

Related Topics

createLicenseFile

setRequiredLicense