Fnd_Reg
32 shared methods.
- Fnd_Reg_Alert
- Fnd_Reg_BuyNowButton
- Fnd_Reg_BuyNowURL
- Fnd_Reg_CreateTable
- Fnd_Reg_DemoDays
- Fnd_Reg_DemoDialog
- Fnd_Reg_DemoDialogFormMethod
- Fnd_Reg_DemoMessage
- Fnd_Reg_FeatureCodeIndex
- Fnd_Reg_FeatureName
- Fnd_Reg_Format
- Fnd_Reg_GetDemoDaysRemaining
- Fnd_Reg_GetExpirationDate
- Fnd_Reg_GetLicenseInfo
- Fnd_Reg_GetUnlockCode
- Fnd_Reg_GetUserName
- Fnd_Reg_Info
- Fnd_Reg_LoadRegistrationRecord
- Fnd_Reg_Localize
- Fnd_Reg_RegDialogFormMethod
- Fnd_Reg_RegDialogOKButton
- Fnd_Reg_Register
- Fnd_Reg_RegistrationDialog
- Fnd_Reg_RegistrationState
- Fnd_Reg_Reset
- Fnd_Reg_SaveRecord
- Fnd_Reg_SaveRegistrationInfo
- Fnd_Reg_SetHostVars
- Fnd_Reg_SetSecretKey
- Fnd_Reg_StartDemoPeriod
- Fnd_Reg_ValidateUnlockCode
- Fnd_Reg_VerifyRecord
Fnd_Reg_Alert
Fnd_Reg_Alert (message)
Displays an alert message. Uses the Foundation Dialog module alert if available.
| Parameter | Type | Direction | Description |
|---|---|---|---|
message | Text | in | The alert message text |
Fnd_Reg_BuyNowButton
Fnd_Reg_BuyNowButton
Gets called from the Buy Now buttons.
No parameters.
Fnd_Reg_BuyNowURL
Fnd_Reg_BuyNowURL ({feature code{; URL}}) --> Text
Allows the developer to get and set the URL to go to if the Buy Now button is clicked.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | A feaure code (optional) |
inUrl | Text | in | The URL (optional) |
Result | Text | out | The URL |
Fnd_Reg_CreateTable
Fnd_Reg_CreateTable --> Object
Creates the [Fnd_Reg] table the Registration component needs, in an interpreted host. Fnd_Reg_Init offers to call it; a developer can also call it directly. If the table already exists, nothing is changed.
The table it creates: ID Longint, primary key Feature_Code Alpha 80 (Fnd_Reg_Init indexes it) Demo_Days Integer Demo_Start_Date Date Unlock_Code Alpha 40 User_Name Alpha 80 License_Info Alpha 80 Checksum Alpha 40
In a compiled host, or on a remote client, it changes nothing and returns success False with a message. After it creates the table, restart the host before using Fnd_Reg.
| Parameter | Type | Direction | Description |
|---|---|---|---|
Result | Object | out | { success : Boolean ; created : Boolean ; restartRequired : Boolean ; message : Text } |
Fnd_Reg_DemoDays
Fnd_Reg_DemoDays ({feature code{; days}}) --> Number
Allows the developer to set and get the number of demo days for the specified feature.
This routine does not modify the expiration date if it has already been set.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | Feature code (optional) |
inDays | Longint | in | The number of days (optional) |
Result | Longint | out | The number of days |
Fnd_Reg_DemoDialog
Fnd_Reg_DemoDialog ({feature code})
Displays the demo dialog if the feature is not registered.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | Feature code (optional) |
Fnd_Reg_DemoDialogFormMethod
Fnd_Reg_DemoDialogFormMethod
We call this from a protected method because a public form can't call private methods.
No parameters.
Fnd_Reg_DemoMessage
Fnd_Reg_DemoMessage ({feature code{; message}}) --> Text
Sets and gets the demo message for the specified feature code.
This text is displayed in the demo dialog.
This text can be localized, so it's not stored in the with the registration record. If you want to use something other than the default values, you'll need to call this method to set up the names before trying to retrieve them or before displaying the registration dialogs.
Pass an empty string to revert to the default message (from the localization strings).
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | The feature code (optional) |
inMessage | Text | in | The new demo message (optional) |
Result | Text | out | The current demo message |
Fnd_Reg_FeatureCodeIndex
Fnd_Reg_FeatureCodeIndex (feature code) --> Number
Returns the index in the arrays for the specified feature code. If the feature code hasn't been added to the arrays yet it is created.
| Parameter | Type | Direction | Description |
|---|---|---|---|
featureCode | Text | in | A feature code |
Result | Longint | out | The index in the arrays |
Fnd_Reg_FeatureName
Fnd_Reg_FeatureName ({feature code{; feature name}}) --> Text
Sets and gets the feature name for the specified feature code.
This name is used in the registration dialogs.
These names can be localized, so they're not stored in the with the registration information. If you want to use something other than the default values, you'll need to call this method to set up the names before trying to retrieve them or before displaying the registration dialogs.
The Application code returns the database name.
Other feature codes return "Feature: codename"
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | The feature code (optional) |
inFeatureName | Text | in | The new feature name (optional) |
Result | Text | out | The current feature name |
Fnd_Reg_Format
Fnd_Reg_Format (MD5; format) --> Text
Returns an unlock code by formatting the MD5 value using the specified format.
The # characters in the format string are replaced by characters from the MD5.
Example: Input: ("35bf6fd6b73c1e29ac15a50316c4cc6c";"Test ###-##/###*") Output: "Test 35b-f6/fd6*"
| Parameter | Type | Direction | Description |
|---|---|---|---|
md5 | Text | in | An MD5 value |
inFormat | Text | in | A format description |
Result | Text | out | The formatted value |
Fnd_Reg_GetDemoDaysRemaining
Fnd_Reg_GetDemoDaysRemaining ({feature code}) --> Number
Returns the number of days left in the demo. Calculated by adding the number of demo days to the demo start date.
If the demo hasn't been started, the number of demo days is returned.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | The feature code (optional) |
Result | Longint | out | Days remaining |
Fnd_Reg_GetExpirationDate
Fnd_Reg_GetExpirationDate ({feature code}) --> Date
Gets the feature's expiration date. This is calculated by adding the number of demo days to the date the demo period was started.
If the demo hasn't been started, the number of demo days is added to the current date, and the resulting date is returned.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | The feature code (optional) |
Result | Date | out | The expiration date |
Fnd_Reg_GetLicenseInfo
Fnd_Reg_GetLicenseInfo ({feature code}) --> Text
Returns the name of the registered user. Returns an empty string if the program hasn't been registered yet.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | The feature code (optional) |
Result | Text | out | The name of the registered user |
Fnd_Reg_GetUnlockCode
Fnd_Reg_GetUnlockCode ({feature code}) --> Text
Returns the unlock code that's been entered into the data file. Returns an empty string if the program hasn't been registered yet.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | The name of the feature in question (optional) |
Result | Text | out | The feature's unlock code |
Fnd_Reg_GetUserName
Fnd_Reg_GetUserName ({feature code}) --> Text
Returns the user name that has been saved in the registration record (if any).
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | Feature name (optional) |
Result | Text | out | The registered user's name |
Fnd_Reg_Info
Fnd_Reg_Info (label) --> Text
Returns requested information. See the Fnd_Gen_ComponentInfo method for more information.
Fnd_Reg licenses the host developer's application, not Foundation: it shows the host's demo and registration dialogs and checks the unlock codes the host issues.
Fnd_Reg needs a [Fnd_Reg] table in the host: ID Longint, Feature_Code Alpha 80, Demo_Days Integer, Demo_Start_Date Date, Unlock_Code Alpha 40, User_Name Alpha 80, License_Info Alpha 80 and Checksum Alpha 40. Fnd_Reg_Init offers to create it with Fnd_Reg_CreateTable.
| Parameter | Type | Direction | Description |
|---|---|---|---|
request | Text | in | Info desired ("version" or "name") |
Result | Text | out | Response |
Fnd_Reg_LoadRegistrationRecord
Fnd_Reg_LoadRegistrationRecord ({feature code})
Searches for the registration record for the specified feature. If one is found, it is checked to make sure it hasn't been tampered with.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | The feature code (optional) |
Fnd_Reg_Localize
Fnd_Reg_Localize
Passed the localization strings to the General and (if available) Localization components.
No parameters.
Fnd_Reg_RegDialogFormMethod
Fnd_Reg_RegDialogFormMethod
We call this from a protected method because a public form can't call private methods.
No parameters.
Fnd_Reg_RegDialogOKButton
Fnd_Reg_RegDialogOKButton
We call this from a protected method because a public form can't call private methods.
No parameters.
Fnd_Reg_Register
Fnd_Reg_Register (feature code; unlock code; user name)
Call to register the product. Sets the OK variable to 1 if the product gets registered. Sets the Error variable if there's a problem.
This doesn't check to see if it's already been registered, so it can be called to change the registration at any time. But only does the update if the user name and unlock code are valid.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | The feature code |
inUnlockCode | Text | in | Unlock code |
userName | Text | in | User name |
Fnd_Reg_RegistrationDialog
Fnd_Reg_RegistrationDialog ({feature code})
Displays the registration dialog. Works even if the product has been registered.
Sets the OK button if a valid registration number was entered.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | Feature code (optional) |
Fnd_Reg_RegistrationState
Fnd_Reg_RegistrationState ({feature code}) --> Longint
Returns the current registration state.
It can be one of these constants: Fnd_Reg_PreDemo Fnd_Reg_Demo Fnd_Reg_Expired Fnd_Reg_Registered
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | The feature code (optional) |
Result | Longint | out | The current registration state |
Fnd_Reg_Reset
Fnd_Reg_Reset ({feature code})
Clears out the start date and other information for the specified feature.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | The feature code (optional) |
Fnd_Reg_SaveRecord
Fnd_Reg_SaveRecord (product code)
Saves the current [Fnd_Reg] record after first setting the Checksum field.
Assumes the record is loaded in read/write mode.
Leaves the record loaded.
Use Fnd_Reg_VerifyRecord to verify the checksum.
| Parameter | Type | Direction | Description |
|---|---|---|---|
secretKey | Text | in | The secret product code |
Fnd_Reg_SaveRegistrationInfo
Fnd_Reg_SaveRegistrationInfo (feature name; personalization; license info; unlock code)
Save's the specified info into a registration record.
Doesn't check to make sure the unlock code is valid. We'll assume whoever called us did that.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | Feature name |
userName | Text | in | Personalization |
licenseInfo | Text | in | License info |
unlockCode | Text | in | Unlock code |
Fnd_Reg_SetHostVars
Fnd_Reg_SetHostVars (->text; ->text; ->text; ->text; ->longint; ->longint; ->longint)
Called by the Buy Now button method of the Fnd_Reg_DemoDialog form to pass some pointers to host variables to the component.
| Parameter | Type | Direction | Description |
|---|---|---|---|
hostFeatureName | Pointer | in | Host feature name |
hostMessage1 | Pointer | in | Host message 1 |
hostMessage2 | Pointer | in | Host message 2 |
hostCountDown | Pointer | in | Host count down |
hostOKButton | Pointer | in | Host OK button |
hostRegisterButton | Pointer | in | Host Register button |
hostBuyNow | Pointer | in | Host Buy Now button |
Fnd_Reg_SetSecretKey
Fnd_Reg_SetSecretKey (key)
Allows the developer to set the secret key.
For security reasons, there is no routine to get the secret key.
Fnd_Reg licenses the host developer's application, not Foundation: it shows the host's demo and registration dialogs and checks the unlock codes the host issues.
Security: Fnd_RegG_GenerateUnlockCode ships in Foundation's source, so a host must set its own key with Fnd_Reg_SetSecretKey at startup. The MD5-based codes deter casual copying only; they are not copy protection.
| Parameter | Type | Direction | Description |
|---|---|---|---|
key | Text | in | The secret key |
Fnd_Reg_StartDemoPeriod
Fnd_Reg_StartDemoPeriod ({feature code})
Call this to begin the demo period. If the demo period has already been started, this routine will do nothing.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFeatureCode | Text | in | Feature code (optional) |
Fnd_Reg_ValidateUnlockCode
Fnd_Reg_ValidateUnlockCode (secret key; feature code; user name; license info; unlock code; format) --> Boolean
Returns True if a valid unlock code was passed for the specified product number and user name.
Strip any license info before calling.
| Parameter | Type | Direction | Description |
|---|---|---|---|
secretKey | Text | in | The unique product secret key |
featureCode | Text | in | The feature code |
personalization | Text | in | The user name |
licenseInfo | Text | in | The license information |
enteredUnlockCode | Text | in | The user-entered unlock code |
format | Text | in | The license code format string |
Result | Boolean | out | True if the entered unlock code equals the generated unlock code |
Fnd_Reg_VerifyRecord
Fnd_Reg_VerifyRecord
Makes sure the current [Fnd_Reg] record's Checksum field is correct.
If not, the record is updated so that it is expired. Theoretically this will happen only if the user tampers with a [Fnd_Reg] record. Otherwise processing is allowed to continue uninterrupted.
Assumes that there is exactly one record in the current selection.
Fnd_Reg_SaveRecord is called to set the checksum.
No parameters.