Cicode Programming Reference > Cicode Function Categories > Scheduler Functions > SchdSpecialItemAdd

SchdSpecialItemAdd

The SchdSpecialItemAdd function adds a new Special Day to the scheduler engine. It returns the ID of the Special Day which can be used for modifying and deleting the Special Day.

This function is a blocking function. It blocks the calling Cicode task until the operation is complete.

Syntax

LONG SchdSpecialItemAdd(STRING Cluster, LONG GroupID, STRING Name, TIMESTAMP Day)

Cluster:

Name of the Cluster

GroupID:

Special day group ID

Name:

Name of special day

Day:

The special day as a timestamp. Use TimestampCreate or StrToTimestamp Cicode functions to get a timestamp data value.

Return Value

Returns the ID for an existing special day or -1 if unsuccessful. Trap the error to get the error returned by this function.

Related Functions

SchdSpecialItemModify, SchdSpecialItemDelete

Example

	TIMESTAMP tsDate = TimestampCreate(2012,1,2,0,0,0);

	// Add the new special day
	nCatID = SchdSpecialAdd(STRING Cluster, sCategory);
	IF (nCatID > -1) THEN
		nSchdID = SchdSpecialItemAdd(STRING Cluster, nCatID, sLabel, tsDate);
		IF (nSchdID > -1) THEN
			// Use the new schedule special day item
		END
	END 

See Also

Scheduler Functions

Published June 2018