Set a Integer value of a
property, which exists in the properties manager.
If the property is not
existing yet, it will be added.
Select New Properties Manager
from menu Script to add or remove properties manually.
Properties are saved to the customproperties table in the database.
Parameters:
Name |
Type |
Description |
propertyName |
String |
The
name of the property, as it is used in Properties Manager |
propertyValue |
Integer |
Integer
value, to be assigned to the property propertyName Used
to store integer values. The default value is 0 Range
from -2,147,483,648 to 2,147,483,647 |
Returns:
Type |
Value |
Description |
Boolean |
True or
False |
Returns True if the property has been set. Returns False upon failure |
Available in:
WindowMain |
WindowLink |
YES |
YES |
Used in:
XojoScript
Name |
GUID |
Set
new BirthdaysTimeSpan property |
B73607E5-3D47-40D2-9B16-6ADDDA94FD4E |
Hint: You can
find references to XojoScripts which make use of this function by sending the following
SQL statement to the database:
Select id,GUID, ScriptName,ScriptCode from
im_scripts where ScriptCode Like '%SetPropertyInt%'
Example XojoScript:
Hint: Use
properties in order to hold a value at a single location, which then can be reused
in various scripts.
For
instance in this example we have the property BirthdaysTimeSpan
which holds the number of days to search
for
forthcoming birthdays of people registered in the database.
// Set a number of days where the startup script will check
// for forthcoming birthdays
// Retrieve currently set value
Dim
currentValue As String
= Str(GetPropertyInt("BirthdaysTimeSpan"))
// Display current value and ask user for new timespan value
Dim
numDays As String
= GetInput("Number
of days ahead","Check for
Birthdays",currentValue)
// If new value is higher than 0, save it
If
Val(NumDays) > 0 Then
Call SetPropertyInt("BirthdaysTimeSpan",Val(numDays))
End
If