- Tracy Lamb
- PowerBuilder
- Friday, 21 January 2022 02:51 PM UTC
Hi all,
This is probably a rookie question, but I can't seem to re-set a variable-length array...
Here's what I'm doing:
for ll_ThisRow = 1 to ll_RowCount
li_doc = 1
... other stuff ...
istr_documents[li_doc] = ls_filename
li_doc++
// If Include Attachment checked, add doc name to array
if cbx_attachments.checked then
... other stuff ...
li_doc++
end if
ls_mergeFiles = '"' + istr_documents[1] + '"'
li_docCount = UpperBound(istr_documents)
for li_doc = 2 to li_docCount
ls_mergeFiles = ls_mergeFiles + ' "' + istr_documents[li_doc] +'"'
next
... other stuff ...
SetNull(istr_documents[])
next
Everything works fine the first time through the loop, but the second time through I get the following error:
Error Number 46: Null object reference cannot be be assigned or passed to a variable of this type.
The offending line is in bold above.
I'm thinking I'm resetting the array wrong?
TIA, ~~~Tracy
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.