- Tracy Lamb
- PowerBuilder
- Tuesday, 3 August 2021 03:17 PM UTC
Hi friends,
I created a user event in my dw, and wrote a routine. Today, I've been trying to add a conditional loop, but can't save the changes due to error C0031: Syntax Error. The offending lines are the first IF statement and associated END IF .
//Loop through the attachments and print each one...
if lower(ls_forms[ li_y ]) = "attachments"
li_attachments = lds_form.RowCount()
if li_attachments = 0 then
MessageBox("Print Attachments", "No attachments to print.")
else
istr_parms = f_get_doc_directory(istr_parms)
ls_directory = istr_parms.string_arg[1]
SetNull(ls_null)
for li_this_row = 1 to li_attachments
ls_filename = this.GetItemString(li_this_row, "filename")
ls_filename = ls_directory + '\Workorder\' + string(il_workorder) + '\' + ls_filename
// Print
shellexecute(handle(this), "print", ls_filename, ls_null, ls_null, 0)
next
end if
end if
When I comment out this section, everything saves and run fine. I'm sure it's something obvious, but I'm not seeing it. Any suggestions?
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.