HP3000-L Archives

April 2003, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"VANCE,JEFF (HP-Cupertino,ex1)" <[log in to unmask]>
Reply To:
VANCE,JEFF (HP-Cupertino,ex1)
Date:
Thu, 3 Apr 2003 15:23:43 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (24 lines)
Donna wrote:
> given the following:
>
>   HPDATETIME = 20030403133637300
...
> you (or i :-) want to extract "030403" (yymmdd) and "1336" (hhmm)
> without resorting to substring manipulation (eg: setvar foo
> pos(hpdatetime,3,6) and setvar bar pos(hpdatetime(9,4)).

However you extract the part(s) you want, make sure you do NOT
reference HPDATETIME more than once.  The reason is to ensure
that you don't reference once before and once after a boundary
condition, such as the day changing.  I would do it this way:

  setvar tmp hpdatetime
  setvar my_yymmdd str(tmp, 3, 4)
  setvar my_hhmm   str(tmp, 9, 4)

HTH,
 Jeff Vance, vCSY

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2