Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Resource saveResourceProperties: Difference between revisions

From Catglobe Wiki
Cg_pham (talk | contribs)
No edit summary
Cg_pham (talk | contribs)
No edit summary
 
Line 1: Line 1:
[[Category:Resource_Functions]]
[[Category:Resource_Functions]]

{{HelpFiles}}


====Resource_saveResourceProperties====
====Resource_saveResourceProperties====

Latest revision as of 02:58, 14 December 2011



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