[Download-List] Re: Download alternating color rows
David L. Rotman
ROTMAND at cedarville.edu
Mon Sep 29 17:05:04 EDT 2003
Phil--
I don't know of any way to do this directly. The @ variables are likely
to get reset during an EVAL, as each EVAL does its own SELECT.
Here is one way to get it done:
1. Subroutine RUNNING.COUNTER (at end of message)
2. Dictionary entry RUN.COUNTER on your file being DOWNLOADed
001: I
002: SUBR('RUNNING.COUNTER', at ID)
003: MD0
004: RUNýCOUNTER
005: 6R
006: S
3. HTML.ROW qualifier added to your DOWNLOAD statement
HTML.ROW EVAL \
"IF MOD(RUN.COUNTER,2) = 0 THEN 'BGCOLOR=RED' ELSE 'BGCOLOR=BLUE'"
Dave Rotman
=============subroutine RUNNING.COUNTER==============
SUBROUTINE RUNNING.COUNTER(RETURN.VALUE,PASSED.AT.ID)
*
* INFO/BASIC SUBROUTINE
* 11/14/89
* DLR
* TITLE ----- RUNNING.COUNTER(RETURN.VALUE)
*
*
* MODULE :
* PURPOSE: PRINT A RUNNING COUNTER (SEQUENCE NUMBER) ON INFORM REPORTS
*
* Stamped: p2 rotmand, /disk1/collive, user #28919, 28 Aug 98, 08:42AM.
* Minor logic changes
*
* Last updated by LIVE (ROTMAN) at 16:45:49 on 11/14/1989.
*
*************************************************************************
*
COMMON /RUNCOUN/ RUNCOUN.COUNTER, RUNCOUN.PREV.KEY
NEW.KEY = PASSED.AT.ID
THIS.IS.THE.FIRST = ''
CALL FIRST.RECORD(THIS.IS.THE.FIRST,'RUNNING.COUNTER')
IF THIS.IS.THE.FIRST THEN
RUNCOUN.COUNTER = 1
END ELSE
IF NEW.KEY # RUNCOUN.PREV.KEY THEN
RUNCOUN.PREV.KEY = NEW.KEY
RUNCOUN.COUNTER += 1
END
END
RETURN.VALUE = RUNCOUN.COUNTER
RETURN
END
=============subroutine FIRST.RECORD==============
SUBROUTINE FIRST.RECORD(RETURN.VALUE,NAME.TO.CHECK)
*
* INFO/BASIC SUBROUTINE
* 2/12/88
* DWS
* TITLE ----- FIRST.RECORD
*
*
* PURPOSE: DETERMINE IF THIS IS THE FIRST RECORD IN THE SELECT LIST
* (USED BY OTHER I-DESC'S OR I-DESC SUBROUTINES)
*
* Last updated by LIVE (ROTMAN) at 10:56:08 on 08/02/1990.
* still a bug in 8.1 when a program calls ITYPE, although LIST works okay
* Last updated by LIVE (ROTMAN) at 09:40:33 on 06/01/1989.
* Work around a bug in some versions of Information 7.0.zz
* @TIME gets reset when ITYPE is invoked from a program.
* (@TIME remains constant for INFORM LIST/SELECT/etc.)
* Last updated by LIVE (SJOQUIST) at 11:07:15 on 02/12/1988.
*
********************************************************************
*
*
*
*************************************************************************
*
* This program is provided 'as is' for your use by ROTMAN & SJOQUIST.
* You are encouraged to verify the accuracy of program functions prior
* to use with actual data files.
*
* If you have questions about this program, or if you wish to obtain
* a list of programs available for purchase from ROTMAN & SJOQUIST,
* contact Dave Rotman or Doug Sjoquist:
*
* Rotman and Sjoquist
* c/o Cedarville College
* PO Box 601
* Cedarville, OH 45314
* (513) 766-2211
*
*************************************************************************
*
COMMON /FIRSTRC/ CURRENT.DATE, CURRENT.TIME, PROGRAM.NAMES
CHECK.DATE = @DATE
CHECK.TIME = @TIME
*
IF CURRENT.DATE # CHECK.DATE OR CURRENT.TIME # CHECK.TIME THEN
PROGRAM.NAMES = ''
END
CURRENT.DATE = CHECK.DATE
CURRENT.TIME = CHECK.TIME
IF NAME.TO.CHECK THEN
WORK.NAME.TO.CHECK = NAME.TO.CHECK
END ELSE
WORK.NAME.TO.CHECK = 'FIRST.RECORD'
END
*
*
* IF NULL PROGRAM NAME PASSED, DO NOT CHECK LIST, JUST THE TIME
*
LOCATE WORK.NAME.TO.CHECK IN PROGRAM.NAMES<1> SETTING POS ELSE
POS = 0
END
IF POS THEN
RETURN.VALUE = ''
END ELSE
RETURN.VALUE = 1
PROGRAM.NAMES<-1> = WORK.NAME.TO.CHECK
END
RETURN
END
Dave Rotman
Director of Computer Services
Cedarville University
251 N. Main Street
Cedarville, OH 45314
rotmand at cedarville.edu
voice 937-766-7905
fax 937-766-8819
>>> "Phil Walker" <phil.walker at infocusp.co.nz> 9/26/2003 4:59:24 PM >>>
David,
Please point me to the list if that is where this query should go.
Firstly, I also came across the issue with UV and was able to fix it * my
apologies for not recording it with you. I will next time.
Anyway, I have been experimenting with DOWNLOAD and was wondering is there a
way that I can produce html output which looks like line flow output. That
is every odd line is white and every even line or row is wheat. (Color could
be others). I tried using an EVAL on @NI setting the value but this did not
appear to work * not sure whether is was because @NI and for that matter @NB
are not supported @ variables or because as stated in the documentation,
these values are defined by the first row in the result set. With @NB you
could also highlight different level of break lines in different colors.
Anyway any ideas, or if you are willing where this is done in the code, so I
may look as to how it might work.
I would be interested in seeing some example of complicated output produced
by download such as incorporating css or xsl type handling.
Phil
Phil Walker
+64 21 336294
phil.walker at infocusp.co.nz
infocusp limited
\\ PO Box 77032, Auckland New Zealand
More information about the download-list
mailing list