HoursEntry

(VTScada-Layer function. Must be called with a leading backslash.)

Description:

Displays a time editing field.

Returns:

Nothing (see parameter descriptions)

Usage:

Steady State only.

Function Groups:

Graphics, Time and Date

Format:

\HoursEntry(Left, Top, Hours, Minutes, Enable, TimeChange[, Trigger, FocusID, Force24HourEditing])

Related to:  
Parameters:

 

Left
Required. Left reference
Top
Required. Right reference
Hours

Required integer. Displays and returns the hour portion of the time from 0 to 23. "0" will be shown only for a 24-hour clock. In a 12-hour clock, midnight is shown as 12:00 AM

See comments.

If the initial value is not an integer, the return value must be cast to an integer.

Minutes

Required integer. Displays and returns the minute portion of time from 0 to 59. See comments.

If the initial value is not an integer, the return value must be cast to an integer.

Enable
Required Boolean. Set TRUE to enable, or FALSE to display the selector as a grayed-out control.
TimeChanged

Optional Boolean. Will be set TRUE when the operator changes the hour or minute value. If provided, this parameter should be initialized to FALSE.

Does not reset automatically.

Trigger
An optional numeric value. Will be set to the status of the underlying edit field.
FocusID

Optional. Any numeric expression from 0 to 32767. Defaults to 1 if not set.

Force24HourEditing

Optional Boolean. Set TRUE for a 24-hour clock. AM and PM will not be displayed.

Set FALSE for a 12-hour display with AM or PM shown. Defaults to FALSE if missing or Invalid.

Comments:

This module displays a time selector at the given top, left coordinates. Values are returned in the 3rd and 4th parameters, which update when the user selects a value.

Example:

...
  Hours;
  Minutes;
  TimeChanged = FALSE;
  StartTime;
]
Init [
  If 1 Main;
  [
    StartTime = Int(Seconds());
    Hours = Int(StartTime / 3600);
    Minutes = Int((StartTime % 3600)/ 60);
  ]
]
Main [
  Return(Self);
  \HoursEntry(100, 200, Hours, Minutes, TRUE, TimeChanged, Invalid, 1, Invalid );
  If Edge(TimeChanged, 1);
  [
     TimeChanged = FALSE   { Reset the trigger    }; 
     {... Process the new time }