I'm having a very strange problem with the following lines of code.
I have two scripts that print almost the same reports. The more complex script runs fine. I'll call it script 2. I took script 2 and removed almost two thirds of the code to create script 1 which is attached below.
The above lines of code generate an error in script 1, yet, those exact lines of code run fine in script 2.
Error.PNG
I've used similar versions of this code before with no problems. I'm at a loss as to what is happening.
Code:
dim p as p p.WO_Paper_Choice = "Pre-Printed BAF" a5_load_settings("WO_Paper_Choice",p) flag_WO_Paper_Choice = p.WO_Paper_Choice
The above lines of code generate an error in script 1, yet, those exact lines of code run fine in script 2.
Error.PNG
I've used similar versions of this code before with no problems. I'm at a loss as to what is happening.
Code:
''save the record parentform.Commit() xbasic_wait_for_idle() DIM SHARED vCurTransNo AS c vCurTransNo = parentform:Transno.value p = topparent.this DELETE Parameter1 Parameter1 = eval("P:BROWSE2:Disc.value") dim flag_WO_Paper_Choice as C dim p as p p.WO_Paper_Choice = "Pre-Printed BAF" a5_load_settings("WO_Paper_Choice",p) flag_WO_Paper_Choice = p.WO_Paper_Choice ok_button_label = "&OK" cancel_button_label = "&Cancel" varC_result = ui_dlg_box("Select Which Form to Print",<<%dlg% {xmargin=5,5}{font=arial,9}{ysize=.3}; {region} Use Which Form: (flag_WO_Paper_Choice:Pre-Printed BAF!WO_Form_Changed) (flag_WO_Paper_Choice:Blank Paper BAF!WO_Form_Changed) (flag_WO_Paper_Choice:Blank Paper SRQ!WO_Form_Changed) {endregion};;; {region} <*15,1.5=ok_button_label!OK> <15,1.5=cancel_button_label!CANCEL> {endregion}; %dlg%,<<%code% IF a_dlg_button = "WO_Form_Changed" THEN a_dlg_button = "" p.WO_Paper_Choice = flag_WO_Paper_Choice a5_save_settings("WO_Paper_Choice",p) END IF %code%) IF varC_result <> "OK" THEN end END IF filter = "Transno = [Var->vCurTransNo] .and. Wosquawk->Itemno = [varC->parameter1]" query.filter = replace_parameters(filter,local_variables()) query.order = "" SELECT CASE flag_WO_Paper_Choice = "Pre-Printed BAF" :Report.Preview("WOdiscrepancyReport",query.filter,query.order) CASE flag_WO_Paper_Choice = "Blank Paper BAF" :Report.Preview("WOdiscrepRpt_Blank",query.filter,query.order) CASE flag_WO_Paper_Choice = "Blank Paper SRQ" :Report.Preview("WOdiscrepRpt_Blank_SRQ",query.filter,query.order) END SELECT END
Comment