I stumbled across another question today.
I've created a function that creates a stem variable (entry_info) and returns it. But the caller doesn't receive the stem variable. Here's the code:
Code:
/**
* Program to read the contents of DOpus 5 source and destination
* listeners.
*
* Will later be improved to do some processiong with the entries.
*/
options results
address 'DOPUS.1'
'LISTER QUERY SOURCE'
src_handle = RESULT
'LISTER QUERY DEST'
dst_handle = RESULT
src_entries = getListerEntryInfos(src_handle)
dst_entries = getListerEntryInfos(dst_handle)
say src_entries.count /* Debug output */
exit
getListerEntryInfos: procedure
arg handle
'LISTER QUERY 'handle' ENTRIES STEM 'entries
n = entries.count-1
do i = 0 to n
'LISTER QUERY 'handle' ENTRY "'entries.i'" STEM 'entry_info.i
end
entry_info.count = entries.count
say entry_info.count /* Debug output */
return entry_info
When running the script it ouputs:
Code:
4
5
SRC_ENTRIES.COUNT
I would have expected it to print '4' again instead of 'SRC_ENTRIES.COUNT'.
Does anyone have any idea what the reason could be?