SetTime

PowerBuilder Native Interface

IPB_Session interface:

SetTime method

Description

Resets the value of the specified pbtime object.

Syntax

SetTime (pbtime time, pbint hour, pbint minute, pbdouble second)

Argument

Description

time

The pbtime object to be reset

hour

An hour in the range 0 to 23

minute

A minute in the range 0 to 59

second

A second in the range 0 to 59.999999

Return Values

PBX_RESULT. PBX_OK for success or PBX_E_INVALID_ARGUMENT if the new time is invalid.

Examples

This code puts a new time with the value 01:01:01 into the time_val property of the pArguments array if the value in the PBCallInfo structure is null. Otherwise it sets time_val to the time in the PBCallInfo structure:

if (ci->pArgs->GetAt(i)->IsNull())
{
   pArguments[i].time_val = Session-> NewTime();
  Session->SetTime(pArguments[i].time_val, 1, 1, 1); 
                                    // Time: 01:01:01
}
else
{
   pArguments[i].time_val =
      ci-> pArgs-> GetAt(i)-> GetTime();
}

Usage

If the parameters are invalid, the time is reset to 0:0:0.0.

See Also