2

I have one major select list in a program

EXECUTE 'SELECT PRODUCTS WITH DEL.DATE <= "':EOM.DATE;'"' CAPTURING OUTPUT

I then want to covert the select list to an array, is there a Universe basic function to do this or do I need to write a function?

Bill Hileman
  • 2,798
  • 2
  • 17
  • 24
ScaryMinds
  • 335
  • 3
  • 11

1 Answers1

1

Use READLIST to read the contents of your active select list into a field delimited (@FM) dynamic array. This is a paradigm I employ when working with multiple select lists and the payloads aren't too large. You can also select into a different list other than the default of 0 but that gets a bit messy intellectually.

EXECUTE 'SELECT PRODUCTS WITH DEL.DATE <= "':EOM.DATE;'"' CAPTURING OUTPUT
READLIST PRODUCTS.LIST ELSE PRODUCTS.LIST = ''
PRODUCTS.COUNT = DCOUNT(PRODUCTS.LIST,@FM)
FOR X=1 TO PRODUCTS.COUNT
   ID.PRODUCTS = PRODUCTS.LIST<X>
   ;* Your per ID magic goes here
NEXT X

Good luck!

Van Amburg
  • 1,207
  • 9
  • 15
  • Thanks for the answer, had missed READLIST, vaguely thought the SELECT TO in one flavour of MV had the same effect, but definitely not according to the UV 10 manuals I'm looking at. – ScaryMinds Apr 04 '17 at 06:50