discussion
[Top] [All Lists]

Re: [Discussion] api question: accessing integers

To: Phil <prizk@xxxxxxxxxxx>
Subject: Re: [Discussion] api question: accessing integers
From: John Heffner <jheffner@xxxxxxx>
Date: Fri, 2 Apr 2004 18:44:15 -0500 (EST)
On Tue, 30 Mar 2004, Phil wrote:

> I have a snapshot and am trying to read the values. Many of the variable
> types are probably stored as integers or longs, but I can only seem to
> get them as ints by doing this:
>
> atoi(web100_value_to_text(web100_get_var_type(var),buf)));
>
> This feels redundant. Is there a way to get the value as an int?

If you know that buf contains an int, you should be able to get the value
by dereferincing the pointer: *(int *)buf.


> I was also curious if there was a way to access a timestamp for the
> snapshot.

The Duration variable contains a timestamp of sorts.  If you want this in
"real" time, you can use Duration as an offset from StartTime.

  -John


_______________________________________________
Discussion mailing list
Discussion@xxxxxxxxxx
http://internal.web100.org/mailman/listinfo/discussion

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Discussion] api question: accessing integers, John Heffner <=