Resource saveResourceProperties

From Catglobe Wiki
Jump to: navigation, search



Resource_saveResourceProperties

Save a resource's properties to the database

Syntax

Resource_saveResourceProperties(resourceId, properties)

Arguments

  • resourceId: is a number expression. It is the resource's unique id
  • properties: is an array, it is the property array which has the same format as what described in Resource_getResourceProperties function

Return value

empty

Example

array properties = Resource_getResourceProperties(15543655);

number i;

number n = arrayCount(properties);

for (i = 0; i <n; i = i + 1)

{

if (properties[i][RESOURCE_PROPERTY_TYPE] == RESOURCE_PROPERTY_TYPE_SINGLE)

//set the first option selected

properties[i][RESOURCE_PROPERTY_VALUE] = 1;

}

Resource_saveResourceProperties(15543655, properties);

Availability

Version 5.6