1. Tracy Lamb
  2. PowerBuilder
  3. Tuesday, 3 August 2021 15: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

Accepted Answer
Marco Meoni Accepted Answer Pending Moderation
  1. Tuesday, 3 August 2021 15:26 PM UTC
  2. PowerBuilder
  3. # Permalink

if lower(ls_forms[ li_y ]) = "attachments" THEN

 

Best,

.m

Comment
There are no comments made yet.
Tracy Lamb Accepted Answer Pending Moderation
  1. Tuesday, 3 August 2021 15:34 PM UTC
  2. PowerBuilder
  3. # 1

OMG! Thank you so much! I have no idea how I missed that... 

~~~Tracy

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.