latest

latest — gives the latest value in a history.

Syntax

(latest history)
    

Parameters

history

The name of a history defined by the history command.

Returns

The value and system time in the following format:

(latest history data seconds)

if successful, where data and seconds are real values. Otherwise

(error "No data for point history")
(error "History history does not exist")

Description

This command returns the value for the last data item in the history. This item may be either in a file or in memory.

This command corresponds to the Cogent C API function HI_Latest and the hist_latest dynamic library function.

Example

[sh]$ lsend Hist
Hist> (latest p3)
(latest p3 38.2 973636953.463209)
Hist>