Karen,
Here is the text from my v7.6 help file
"LISTOF
LISTOF
The aggregate
functions (AVG, COUNT, MAXIMUM, MINIMUM, STDEV, SUM, VARIANCE) used in
COMPUTE/SELECT commands now have a new member of their family called "LISTOF"
which creates a
text string of the values separated by the current comma delimiter character.
The LISTOF function can be used with the "SELECT ... INTO ..."
to populate a variable with a list of values which can then be used in a CHOOSE
command with the #LIST option. It can also be used in Forms, Reports or Labels
to look up values from multiple rows.
LISTOF returns a NOTE
type and notes are limited to 4K. "
This text does not reflect the latest enhancement which allows the receiving
varable to defined as variable character.
To the best of my knowledge it has always returned a "TEXT" value. Also, since
you are returning "integers" (defined in a text variable) implicit datatyping
should allow you to use that variabvle as a valid argument to "WHERE integercol
IN &textvarname"
Jim Bentley
American Celiac Society
[EMAIL PROTECTED]
tel: 1-504-737-3293
----- Original Message ----
From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
To: RBASE-L Mailing List <[email protected]>
Sent: Thursday, October 23, 2008 1:07:39 PM
Subject: [RBASE-L] - Re: Difference in LISTOF command
A text string is returned because it is text with commas in it, but help
doesn't say what the datatype of the listed items should be, which leads me to
believe they could be anything and apparently in 6.5 it could be integers.
In 7.6 I attempted to do a set var (set var vlist = (listof(blno)) from .....)
and it sometimes worked and sometimes did not. It often failed where the
Listof was going to return only one or two numbers so it wasn't a function of
the length.
Karen
Karen,
I happened to be looking at the LISTOF function of SELECT yesterday with my
SRPL oddity and the help does indicate that a text string is returned. Maybe
that's the clue...
I didn't like the way that SRPL was apparently forcing me to put my spaces in
the list (extracted in practice from a LISTOF result) so I went about it a
different way in the end. One of the (many) joys of R:Base is that there are
always other ways to these things.
Another oddity is that the same section of help has an example of replacing in
LISTOF text using SRPL with a space so I was even more puzzled. Thanks to Buddy
&Dennis for their enlightenment, though, since the space in the variable does
work.
Regards,
Alastair.