SetProperty(propertyName As String, propertyValue As string) As Boolean

 

Set a string 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

String

String value, to be assigned to the property propertyName

A String is an intrinsic data type. It is a series of numeric or alphabetic characters enclosed in quotes.

Any kind of alphabetic or numeric information can be stored as a string. "Jean Marie", "3/17/98", "45.90" are all examples of strings. When you place quotes around information in your code, you are indicating the data as just a series of characters and nothing more. The maximum length of a string is limited only by available memory. The default value of a String is ""

 

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

 

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 '%SetProperty(%'

 

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 cLocation which holds the city name to be printed on

                  various documents, like invoices or confirmation letters.

 

// Set location to be printed on invoice

Call SetProperty("cLocation","Le Mont-Plerin")

 

// Display property to user

MsgBox(GetProperty("cLocation"))