:: krowemoh

Friday | 27 DEC 2024
Posts Links Other About Now

previous
next

TIL - BASIC EXECUTE PASSLIST

2023-03-11

TIL that the EXECUTE statement starts up a brand new environment and by default doesn't have access to the parent environment. So I was trying to do a select and then inside a basic program I was doing an execute. This for some reason wasn't picking up my select list.

I then read the manual and realized that this was by design and that by default the active list isn't used by the execute statement.

There is the PASSLIST option which will pass along the active list to the execute statement.

An example:

In TCL:

SELECT INVENTORY-FILE WITH LINE = "12"

Inside the BASIC program:

EXECUTE 'LIST INVENTORY-FILE @ID SUPPLIER' PASSLIST

This way you can do a selection and then run the execute against that selection.