HP3000-L Archives

October 1999, Week 2

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:
TRACY PIERCE <[log in to unmask]>
Reply To:
Date:
Wed, 13 Oct 1999 13:40:28 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
Better yet, go from 9999 to 999A, and from 999Z (or whatever) to 99A0,
which will increment normally.  Then you won't have any problems until
after ZZZZ, when you can expand to a bigger-still base!

Still need to write the INCRement routine?  Here's a quick & dirty one
that works ONLY vs a variable "MYCOUNTER" with a known length of 4, but
it works (note it must live in a file called INCR36, since it's
recursive):

1) put this in a file called INCR36...
PARM POSITIONTOINCR=4
SETVAR CURRVALUE STR ( MYCOUNTER , POSITIONTOINCR , 1 )
IF  "!CURRVALUE" = "Z"
  SETVAR MYCOUNTER STR ( MYCOUNTER , 1 , POSITIONTOINCR - 1 ) + "0"
  SETVAR POSITIONTOINCR POSITIONTOINCR - 1
  INCR36 POSITIONTOINCR
ELSE
  SETVAR MYDIGITS "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  SETVAR NEXTPOINTER POS ( STR ( MYCOUNTER , MYDIGITS , 1 ) + 1
  SETVAR NEXTVALUE STR ( MYDIGITS , NEXTPOINTER , 1 )
  SETVAR MYCOUNTER STR ( MYCOUNTER , 1 , POSITIONTOINCR - 1 ) + NEXTVALUE
&
                   + STR ( MYCOUNTER , POSITIONTOINCR + 1 , 4 )
ENDIF

2) and do this...
:SETVAR MYCOUNTER "9999"
:while mycounter < "99ZZ" DO
:  INCR36
:  SHOWVAR MYCOUNTER
:ENDWHILE


K Tracy Pierce
Systems Programmer
Golden Gate Bridge, Hwy & Trnsp Dist
San Francisco, CA  94129-0601

ATOM RSS1 RSS2