HDR*PowerBuilder0600U7RAPIDS functions libraryFRE*NOD* , Ct ENT*06002JAf_get_odbc_connection.funENT*0600bz-b?_f_get_odbc_connection.srfENT*0600Vj{-b?0f_get_measurement_for_unit.srfENT*0600w JAf_get_sequence.funENT*0600YJAf_get_measurement_for_unit.funENT*0600r{-b?=f_get_sequence.srfENT*0600<T{-b?:f_dw_get_objects_attrib.srfENT*0600JAf_get_sql.funENT*0600 JAf_dw_get_objects_attrib.funENT*0600{-b?#f_get_sql.srfENT*0600(`|-b?6f_dw_get_attributes.srfENT*0600JAf_get_string.funENT*0600JAf_dw_get_attributes.funENT*0600{-b?f_get_string.srfENT*0600|-b?Tf_delete_leg_ent.srfENT*0600JAf_get_token.funENT*0600uJAf_delete_leg_ent.funENT*0600|-b?f_get_token.srfENT*0600 }-b?Tf_delete_geo_loc.srfENT*0600 JAf_get_toolbar_profile.funENT*0600*JAf_delete_geo_loc.funENT*0600%|-b?Lf_get_toolbar_profile.srfENT*0600x kl@f_del_streams.srfENT*0600.JAf_get_unit_sql.funENT*0600@d JAf_del_streams.funENT*0600}-b?6f_get_unit_sql.srfENT*0600L}-b?*f_del_split_factor.srfENT*0600DPJAf_global_replace.funENT*0600VJAf_del_split_factor.funENT*0600}-b?@f_global_replace.srfENT*0600 kl@%f_del_speciation_profile.srfENT*0600ZJAf_highlight_button.funENT*0600lJAf_del_speciation_profile.funENT*0600~-b?Lf_highlight_button.srfENT*0600 j@f_del_sources.srfENT*0600pJAf_highlight_row.funENT*0600 JAf_del_sources.funENT*0600~-b?af_highlight_row.srfENT*0600x-b?*"f_del_scc_ams_speciation_code.srfENT*0600JAf_increment_array.funENT*0600JA"f_del_scc_ams_speciation_code.funENT*0600-b?f_increment_array.srfENT*0600|kl@f_del_ref_code.srfENT*0600 JAf_listobjects.funENT*0600H JAf_del_ref_code.funENT*0600-b?>f_listobjects.srfENT*0600h%-b?f_del_ref_activities.srfENT*0600 JAf_look_up.funENT*0600 JAf_del_ref_activities.funENT*0600-b?%f_look_up.srfENT*0600P -b?3f_del_recs.srfENT*0600QJAf_menu_behave.funENT*0600vJAf_del_recs.funENT*0600l0-b?*f_menu_behave.srfENT*0600.i kl@f_del_processes.srfENT*0600JAf_menu_off.funENT*0600KAf_del_processes.funENT*0600 -b?@f_menu_off.srfENT*0600--b?j$f_del_process_specific_schedule.srfENT*0600^KAf_menu_on.funENT*0600t -b?If_menu_on.srfENT*0600 KAf_oracle_connection.funENT*06002-b?1f_oracle_connection.srfENT*0600KAf_msgstring.funENT*0600"h-b?f_msgstring.srfENT*0600 KAf_getridfromid.funENT*06006@-b?f_getridfromid.srfNOD*4 8B ENT*0600 -b? f_del_material.srfENT*0600 KAf_del_material.funENT*0600B-b?$f_del_location_coordinates.srfENT*0600KAf_del_location_coordinates.funENT*0600 #kl@*%f_del_location_coordinate_groups.srfENT*0600S KA%f_del_location_coordinate_groups.funENT*0600-b?l%f_del_legal_entity_relations_rec.srfENT*0600L KA%f_del_legal_entity_relations_rec.funENT*0600-b?N!f_del_legal_entity_relations.srfENT*0600KA!f_del_legal_entity_relations.funENT*0600i-b?f_del_legal_entity.srfENT*0600| KAf_del_legal_entity.funENT*0600r< kl@Nf_del_legal_entities.srfENT*0600f KAf_del_legal_entities.funENT*0600\8(kl@%f_del_leg_ent_rel.srfENT*0600Pf KAf_del_leg_ent_rel.funENT*0600FB-b?7f_del_group_member.srfENT*0600: KAf_del_group_member.funENT*06000k-b?$f_del_geo_locs.srfENT*0600$ KAf_del_geo_locs.funENT*0600-b?f_del_form.srfENT*0600; KAf_del_form.funENT*0600W -b?"f_del_emission_factor.srfENT*0600 KAf_del_emission_factor.funENT*0600 kl@ f_del_doc_lookup.srfENT*0600 KAf_del_doc_lookup.funENT*0600 jl@f_del_doc.srfENT*0600 KAf_del_doc.funENT*0600 .kl@f_del_devices.srfENT*06008KAf_del_devices.funENT*06003kl@f_del_contacts.srfENT*0600 KAf_del_contacts.funENT*0600f-b?f_del_contact_reasons.srfENT*0600KAf_del_contact_reasons.funENT*0600zfl@f_del_connections.srfENT*0600pKAf_del_connections.funENT*0600f8kl@f_del_cal_protocol.srfENT*0600Z KAf_del_cal_protocol.funENT*0600P=>kl@f_del_app.srfENT*0600D KAf_del_app.funENT*0600:Bkl@f_del_activities.srfENT*0600.\ KAf_del_activities.funENT*0600"' -b?*f_dddw_search.srfENT*0600SKAf_dddw_search.funENT*0600  -b?5f_db_error.srfENT*0600y KAf_db_error.funENT*0600M-b?If_date_range.srfENT*0600KAf_date_range.funENT*0600S-b?5f_create_view.srfENT*0600KAf_create_view.funENT*0600q-b?[f_copy_record.srfENT*0600KAf_copy_record.funENT*0600K-b?Yf_compare_date_time.srfENT*0600KAf_compare_date_time.funENT*0600z-b?8f_check_matrl_group.srfENT*0600KAf_check_matrl_group.funENT*0600-b?+f_check_dup_act.srfENT*0600 KAf_check_dup_act.funENT*0600|-b?f_check_dates_nt.srfENT*0600 KAf_check_dates_nt.funENT*0600z~-b?f_check_dates.srfENT*0600p KAf_check_dates.funENT*0600j-b?<f_boolean_to_string.srfENT*0600dKAf_boolean_to_string.funENT*0600X -b?4f_block_text.srfENT*0600N~KAf_block_text.funNOD*(% A8ENT*0600D(LAf_paste_record.funENT*0600$-b?bf_paste_record.srfENT*0600H*-LAf_print_master_dw.funENT*0600\/-b?6f_print_master_dw.srfENT*0600T-LAf_printdw.funENT*0600.-b?)f_printdw.srfENT*0600h:LAf_put_scroll_bars.funENT*0600S-b?8f_put_scroll_bars.srfENT*0600vLAf_qc_act_data_1.funENT*0600-b?>f_qc_act_data_1.srfENT*0600!LAf_qc_act_data_2.funENT*0600V'-b?}f_qc_act_data_2.srfENT*0600LAf_qc_act_data_3.funENT*0600{-b?Xf_qc_act_data_3.srfENT*0600WLAf_retrieve_codes.funENT*0600a-b?mf_retrieve_codes.srfENT*0600 LAf_retrieve_connections.funENT*0600E-b?tf_retrieve_connections.srfENT*0600LAf_retrieve_county_city.funENT*0600-b?Ff_retrieve_county_city.srfENT*0600LAf_retrieve_date.funENT*0600-b?Xf_retrieve_date.srfENT*0600LAf_retrieve_group_types.funENT*0600-b?-f_retrieve_group_types.srfENT*0600LAf_retrieve_locations.funENT*0600-b?Gf_retrieve_locations.srfENT*06007 LAf_retrieve_metric_codes.funENT*0600$-b?=f_retrieve_metric_codes.srfENT*0600P LAf_retrieve_unit_codes.funENT*06008-b?#f_retrieve_unit_codes.srfENT*0600LAf_sas_config.funENT*0600\-b?3f_sas_config.srfENT*0600 LAf_save_toolbar_profile.funENT*0600-b?=f_save_toolbar_profile.srfENT*0600FLAf_security_grant.funENT*0600-b?5f_security_grant.srfENT*0600NLAf_security_revoke.funENT*06004-b?8f_security_revoke.srfENT*06003LAf_set_value_amt.funENT*0600#-b?Af_set_value_amt.srfENT*0600 LAf_shift_highlight.funENT*0600P-b?-f_shift_highlight.srfENT*06004 LAf_validate_act.funENT*0600 -b?0f_validate_act.srfENT*06008l LAf_validate_code.funENT*0600! -b?;f_validate_code.srfENT*0600JLAf_validate_dev_pro.funENT*0600 -b?9f_validate_dev_pro.srfENT*0600NLAf_validate_geo_loc.funENT*0600 -b?;f_validate_geo_loc.srfENT*0600`LAf_validate_legal_relation.funENT*0600 -b?-f_validate_legal_relation.srfENT*0600BLAf_validate_location.funENT*0600d-b?_f_validate_location.srfENT*0600FMAf_validate_pro_schedule.funENT*0600v -b?1f_validate_pro_schedule.srfENT*0600 MAf_validate_src.funENT*0600t .-b?.f_validate_src.srfENT*0600X MAf_window_close.funENT*0600 -b?[f_window_close.srfENT*0600>TMAf_window_count.funENT*0600-b?qf_window_count.srfENT*0600pMAf_write_line.funENT*0600 -b?,f_write_line.srfENT*0600NMAgf_build_fatal_message.funNOD*Y 8ENT*0600 -b?5gf_build_fatal_message.srfENT*0600*pMAgf_db_message.funENT*0600 -b?6gf_db_message.srfNOD*f hENT*0600J-b?,f_act_dddw_retrieve.srfENT*0600@KAf_act_dddw_retrieve.funENT*0600"KAf_arraystring.funENT*0600-b?f_arraystring.srfENT*0600&ELAf_arraysearch.funENT*0600-b?f_arraysearch.srfENT*0600:LA!f_array_breakarrayintoblocks.funENT*0600> eq@!f_array_breakarrayintoblocks.srfDAT*B_@])b?KA_@_@d_@q,`@`@6j@j@qDk@k@aPl@l@adm@m@ap@@@@A@@A@@A^@^@qryjtn@n@ap@p@alor f_act_dddw_retrievefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowwindowf_retrieve_codes2 < dw_objwin_objlDAT*8evelcode_valuef_act_dddw_retrieveP   QCdatawindow.Cwindow.SS x function_objectf_act_dddw_retrievestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowwindow on@ectxtuctu,ip@env6ai@edesDai@sagePwc@lisdtr@ewitpiDAT*F_@])b?LA_@_@T_@!'`@`@A1j@j@A?k@k@AKl@l@_m@m@ak@@{@@A@@A@@^@^@ayjin@n@+`@F@F@@ f_paste_recordfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindows_rec_holderpointerf_listobjects2 + DAT*R pdw_objpstr_recordf_paste_record=   BCdatawindow.RCs_rec_holder. x function_objectf_paste_recordstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindows_rec_holderpointer, on@ecteaayin'tr@rem1nt@iron?il@cripKes@dat_ld@tviekvi@emcDAT*R_@])b?LA_@_@d_@*`@`@4j@j@aBk@k@aNl@l@bm@m@qn@@Q~@@@@A@@A^@^@qryjtn@n@a@@a@@q+o f_print_master_dwfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowfontfamilyfontpitchf_listobjects2 T DAT*LFunction to retrieve all dddw in activity dwglobal type f_act_dddw_retrieve from function_object end type forward prototypes global subroutine f_act_dddw_retrieve (datawindow dw_obj, window win_obj, string level, string code_value) end prototypes global subroutine f_act_dddw_retrieve (datawindow dw_obj, window win_obj, string level, string code_value);string ls_col_name ls_col_name = dw_obj.GetColumnName() choose case ls_col_name case "code", "material_code", "value_unit_code", & DAT* "primary_material_code", "weekly_schedule_code", & "daily_schedule_code", "data_code" f_retrieve_codes(win_obj.Title, dw_obj, ls_col_name, "code") // case "metric_code" // f_retrieve_metric_codes(win_obj, dw_obj, level, code_value) case "method_type", "value_type", "mode_type", "reference_type" f_retrieve_codes(win_obj.Title, dw_obj, ls_col_name, "type") end choose end subroutine DAT*P_@])b?KA _@_@d_@a%`@`@/j@j@A=k@k@aIl@l@]m@m@i@@y@@a@@a@@A^@^@qryjt f_block_textfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2  origwidthf_block_text$  SSI x DAT*6 function_objectf_block_textstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject on@ecttoing%ma@cipi/nm@mail=pt@mailIta@owch]ew@treico@tionyob@ @ h@@ @ ~8DAT*T dwprintjobstartpospagesizeleftmargincur_rowpage_numf_print_master_dwq   &19ICdatawindow.IIIIIRI x function_objectf_print_master_dwstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowfontfamilyfontpitch,@*@DAT*V_@^)b?LA_@_@T_@!"`@`@A,j@j@A:k@k@AFl@l@Zm@m@af@@v@@A@@A@@^@^@n n@n@@@@@@ f_printdwfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowfontfamilyfontpitchf_listobjects2 D dwDAT*Zprintjobstartpospagesizeleftmarginpage_numf_printdwd   &1ICdatawindow.IIIIRI x function_objectf_printdwstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowfontfamilyfontpitch, on@ectstwst"il@pien,en@ilfi:io@ilmeFDAT*ZReturns a string formatted into the specified width.global type f_block_text from function_object end type forward prototypes global function string f_block_text (string orig, int width) end prototypes global function string f_block_text (string orig, int width);//////////////////////////////////////////////////////////////////////// // // Function : F_Block_Text // // Purpose : Receives a string and the width of the block for the string // to formatted into. ReturnDAT*\s the string formatted in the // specified width. Uses carriage control/line feed (~r~n) // as the line separator. // // Date : September 9, 1992 // // Arguments : string orig - original string to be formatted // integer width - width of the format block // // Returns : string result - the reformatted string // // Log : // // DATE WHO WHAT // ------ ----- ---------------------DAT*^---------------- // ////////////////////////////////////////////////////////////////////////// string ls_crlf = "~r~n" string ls_token, ls_result, ls_curr_chr integer li_curr_pos, li_ascii_val, li_posi ls_result = "" do while len ( orig ) > 0 li_curr_pos = width + 1 // start at the right border and work back ls_curr_chr = mid ( orig, li_curr_pos, 1 ) // looking for a white space character li_ascii_val = asc(ls_curr_chr) DAT*` // (ASCII value 32) do while ( asc ( ls_curr_chr ) > 32 ) and ( li_curr_pos >= 1 ) li_curr_pos = li_curr_pos - 1 ls_curr_chr = mid ( orig, li_curr_pos, 1 ) li_ascii_val = asc ( ls_curr_chr ) loop if li_curr_pos <= 1 then li_curr_pos = len ( orig ) // no white space found ? ls_token = left ( orig, li_curr_pos - 1 ) // break at the white space char li_posi = pos ( ls_token, ls_crlf ) // check for a ls_crlf in the new DAT*bline if li_posi > 0 then // if ls_crlf found then break the string at the ls_crlf ls_token = left ( orig, li_posi - 1 ) // and put the right side back in the orig = mid ( orig, li_posi + 2 ) // original string else orig = mid ( orig, li_curr_pos + 1 ) end if if len ( ls_result ) > 0 then ls_result = ls_result + ls_crlf + ls_token // add in the new separator else ls_result = ls_token enDAT*8d if loop return ls_result end function DAT*f_@\)b?KA _@_@t_@a,`@`@a6j@j@aDk@k@aPl@l@adm@m@qp@@a@@A@@A@@^@^@aor f_boolean_to_stringfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2 " bparmf_boolean_to_string SB x DAT*4function_objectf_boolean_to_stringstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject@j@,k@@J6@m@D@@P@@d@^@ap @n@@ @ @+e @@ 2DAT*t_@^)b?LA_@_@T_@!*`@`@A4j@j@ABk@k@ANl@l@bm@m@an@@~@@A@@A@@^@^@R p@p@ f_put_scroll_barsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindow2 " win_objf_put_scroll_bars  QCwindow.DAT*lReturns a string value based on the specified boolean value.global type f_boolean_to_string from function_object end type forward prototypes global function string f_boolean_to_string (boolean bparm) end prototypes global function string f_boolean_to_string (boolean bparm);/////////////////////////////////////////////////////////////////////// // // Function: F_Boolean_To_String // // Purpose: Returns the passed boolean value as a string // // Date: September 7, 1992 DAT*n// // Scope: Public // // Arguments: boolean bparm - the boolean value to be converted // // Returns: String "True" for a true boolean value or // "False" for a false boolean value // // Log : // // DATE WHO WHAT // -------- ----- ------------------------------------------- // Powersoft Company initial version //////////////////////////////////////////////////////////////////////// if bparm then return "True"DAT*1 else return "False" end if end function DAT*r_@\)b?KA_@_@_@&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@@@@@^@^@aor n@n@ f_check_datesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowf_check_dates_nt2 S fcurdwcur_rowfirst_datesecond_datefirDAT*2st_textsecond_textf_check_datesc  ".9BCdatawindow.LSSSS x function_objectf_check_datesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@j@&k@@M0@m@a>A@@J@@^@^@AjDAT*\ x function_objectf_put_scroll_barsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindow@!Aj@*k@@F4@m@aB@@N@@b@^@n @n@~@@ @ h@@ @ @ DAT*x_@^)b?LA_@_@_@(`@`@2j@j@@k@k@Ll@l@`m@m@l@@|@@@@A@@A^@^@qryjtq@q@ain elor+o@x f_qc_act_data_1function_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcaselect format_type , lookup_name , material_flag , meas_cDAT*^ode , value_length_amt , value_type_flag from rap_metrics where code =' ' HLALLAf_db_error,select code from rap_units where meas_code =' ' ,/E=codecursor$ LAhLALAf_qc_act_data_3f_DAT*|Function to validate datesglobal type f_check_dates from function_object end type forward prototypes global function boolean f_check_dates (datawindow fcurdw, long cur_row, string first_date, string second_date, string first_text, string second_text) end prototypes global function boolean f_check_dates (datawindow fcurdw, long cur_row, string first_date, string second_date, string first_text, string second_text);// f_check_dates // parameters // 1 - datawindowname (datawindow) // DAT*~2 - name of first date field (string) // 3 - name of second date field (string) // displays message // returns boolean true or false, true = dates are correct sequence // datetime bdate datetime edate string date1_type string date2_type //long crow ////////////////////////////////////////////////////////////////////////////////////// //added this fix, since the Oracle "date" data type is represented //as "datetime" in pb datawindows MDY 10/98 date1_type = fcurdw.describe(firstDAT*_date + ".ColType") date2_type = fcurdw.describe(first_date + ".ColType") if upper(date1_type) = "DATE" and upper(date2_type) = "DATE" then return f_check_dates_nt(fcurdw,cur_row,first_date,second_date,first_text,second_text) end if ////////////////////////////////////////////////////////////////////////////////////// //crow = fcurdw.getrow() bdate = fcurdw.getitemdatetime(cur_row, first_date) edate = fcurdw.getitemdatetime(cur_row, second_date) if isnull(bdate) and not isnull(edate)DAT* then messagebox("Error", first_text + " must exist if " + Second_text + " exists", exclamation!) fcurdw.ScrollToRow(cur_row) return false end if if not (isnull(bdate) or isnull(edate)) then if edate < bdate then messagebox("Error", first_text + " must be before " + Second_text, exclamation!) fcurdw.ScrollToRow(cur_row) return false end if end if return true end function DAT*_@\)b?KA_@_@_@)`@`@3j@j@Ak@k@Ml@l@qam@m@am@@A}@@@@A@@^@^@A0 n@n@ f_check_dates_ntfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowf_check_dates2 V fcurdwcur_rowfirst_datesecond_datefirDAT*0st_textsecond_textf_check_dates_ntc  ".9BCdatawindow.LSSSS x function_objectf_check_dates_ntstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow on@ectp_stru)re@ent3t@fileAn@messMnd@ildaem@evieDAT*_@^)b?LA_@_@T_@!(`@`@A2j@j@A@k@k@ALl@l@`m@m@al@@|@@A@@A@@A^@^@qryjts@s@ain eq@q@q(+ o.@P f_qc_act_data_2function_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdynamicstagingareasqlsa,metricmapcursorDAT*`LAtransactionsqlcaf_db_errorLAt LAselect rap_units_a.conversion_factor_amt , rap_units_b.conversion_factor_amt from rap_units rap_units_a , rap_units rap_units_b , rap_metrics where ( rap_units_a.code =' ' ) and ( rap_metrics.meas_code =rap_units_a.meas_code ) and ( rap_metrics.meas_code =rap_units_b.meas_code ) and ( rap_metrics.code =' DAT*_@^)b?LA_@_@t_@(`@`@2j@j@@k@k@Ll@l@`m@m@l@@|@@@@@@Q^@^@_ajtq@q@ s@s@ach  f_qc_act_data_3function_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlca,select valid_value_name from rap_metDAT*Function to validate datesglobal type f_check_dates_nt from function_object end type forward prototypes global function boolean f_check_dates_nt (datawindow fcurdw, long cur_row, string first_date, string second_date, string first_text, string second_text) end prototypes global function boolean f_check_dates_nt (datawindow fcurdw, long cur_row, string first_date, string second_date, string first_text, string second_text);// f_check_dates // parameters // 1 - datawindowname (datawindoDAT*w) // 2 - name of first date field (string) // 3 - name of second date field (string) // displays message // returns boolean true or false, true = dates are correct sequence // date bdate date edate string date1_type string date2_type //long crow ////////////////////////////////////////////////////////////////////////////////////// //added this fix, since the Oracle "date" data type is represented //as "datetime" in pb datawindows MDY 10/98 date1_type = fcurdw.describe(firsDAT*t_date + ".ColType") date2_type = fcurdw.describe(first_date + ".ColType") if upper(date1_type) = "DATETIME" and upper(date2_type) = "DATETIME" then return f_check_dates(fcurdw,cur_row,first_date,second_date,first_text,second_text) end if ////////////////////////////////////////////////////////////////////////////////////// //crow = fcurdw.getrow() bdate = fcurdw.getitemdate(cur_row, first_date) edate = fcurdw.getitemdate(cur_row, second_date) if isnull(bdate) and not isnull(edate) tDAT*hen messagebox("Error", first_text + " must exist if " + Second_text + " exists", exclamation!) fcurdw.ScrollToRow(cur_row) return false end if if not (isnull(bdate) or isnull(edate)) then if edate < bdate then messagebox("Error", first_text + " must be before " + Second_text, exclamation!) fcurdw.ScrollToRow(cur_row) return false end if end if return true end function DAT*_@\)b?KA_@_@d_@(`@`@q2j@j@@k@k@Ll@l@`m@m@l@@|@@@@A@@^@^@anejin@n@atrt f_check_dup_actfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowf_get_activity_rid2 0 pdw_objpl_ridps_levelf_check_dup_aDAT*&ct<  BCdatawindow.LS x function_objectf_check_dup_actstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@aqj@(k@@P2@m@!@@@L@@`@^@qljt@F@|q@@ @o n@DAT*fric_lookups where metric_code =' ' CFvaluecursor( $LAn_lLAf_db_error8LAdynamicstagingareasqlsao,codecursor LALALA   DAT*_@_)b?LA_@_@_@)`@`@3j@j@Ak@k@Ml@l@am@m@m@@}@@@@@@^@^@ n@n@q@q@ f_retrieve_codesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowtransactionsqlca2 ? win_titledw_objfld_nameDAT*hdw_fld_namef_retrieve_codesI  "QSCdatawindow.SS x function_objectf_retrieve_codesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowtransaction@j@)k@@L3@m@A@@M@@a@^@mjt@q@DAT*_@_)b?LA_@_@_@/`@`@9j@j@Gk@k@Sl@l@gm@m@s@@@@@@@@^@^@aP; n@n@q@q@O p f_retrieve_connectionsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowctransactionsqlca,select from_device_rid , capture_efficiencDAT*Function to check duplicate activity recordglobal type f_check_dup_act from function_object end type forward prototypes global function boolean f_check_dup_act (datawindow pdw_obj, long pl_rid, string ps_level) end prototypes global function boolean f_check_dup_act (datawindow pdw_obj, long pl_rid, string ps_level);datetime ldt_start, ldt_end string ls_metric, ls_value_type, ls_material, ls_data, ls_ref long ll_cur_row, ll_rid, ll_act_rid ll_cur_row = pdw_obj.GetRow() ldt_start = DAT*pdw_obj.GetItemDateTime(ll_cur_row, 'start_date_time') ldt_end = pdw_obj.GetItemDateTime(ll_cur_row, 'end_date_time') ls_metric = pdw_obj.GetItemString(ll_cur_row, 'metric_code') ls_value_type = pdw_obj.GetItemString(ll_cur_row, 'value_type') ls_material = pdw_obj.GetItemString(ll_cur_row, 'material_code') ls_data = pdw_obj.GetItemString(ll_cur_row, 'data_code') ls_ref = pdw_obj.GetItemString(ll_cur_row, 'reference_code') ll_rid = f_get_activity_rid(pl_rid, ps_level, ldt_start, ldt_end, &DAT* ls_metric, ls_value_type, ls_material, ls_data, ls_ref) ll_act_rid = pdw_obj.GetItemNumber(ll_cur_row, 'rid') if ll_rid > 0 and (IsNull(ll_act_rid) or ll_rid <> ll_act_rid) then MessageBox('Activity', 'Start Date Time, End Date Time, Metric Code, ' + & 'Value Type, Material Code, Data Code, and Reference Code ' + & 'must be unique in table rap_activities') return FALSE elseif ll_rid < 0 then return FALSE end if return TRUE end function DAT*_@\)b?KA_@_@t_@a,`@`@q6j@j@!Dk@k@!Pl@l@!dm@m@!p@@@@@@@@A^@^@qryjtF@F@aq@q@alo r+o f_check_matrl_groupfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectpointertransactionsqlcaSelect count ( child_ref_rid ) from rap_group_members wheDAT*$re parent_ref_rid =0 LMKA\$KAf_db_error$ \ ` 2 , pl_material_ridf_check_matrl_group IL x function_objectf_check_matrl_groupstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectpDAT*jy_perc , name from rap_connections where to_device_rid =0 bcfromconnectcursorXPTLALALA,select to_device_rid , capture_efficiency_perc , name from rap_connections where from_device_rid =0 bc$toconnectcursor8.LADAT*_@_)b?LA_@_@_@/`@`@9j@j@Gk@k@Sl@l@gm@m@s@@@@@@A@@^@^@ n@n@q@q@ f_retrieve_county_cityfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowtransactionsqlca2 E win_titledw_objflDAT*ld_namedw_fld_namef_retrieve_county_cityI  "QSCdatawindow.SS x function_objectf_retrieve_county_citystructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowtransaction@j@/k@@S9@m@G@@S@@g@^@aDAT*Function to check if the material has any group members.global type f_check_matrl_group from function_object end type forward prototypes global function integer f_check_matrl_group (long pl_material_rid) end prototypes global function integer f_check_matrl_group (long pl_material_rid);// check to see whether the material selected has a group member. // // Argument(s): val long pl_material_rid rid of the geographic // location selected DAT*// // Return: 0 Yes! it has a group member // 1 No! it does not have a group member // -1 database error SetPointer( Hourglass!) // Declare local variable(s) int li_group_count // check to see if the material has a group member Select count(child_ref_rid) into :li_group_count from rap_group_members where parent_ref_rid = :pl_material_rid using sqlca ; if f_db_error(SQLCA, "Fail on counting group member records on " + & "rap_group_DAT*members table. Contact your technical support.") = 1 then return -1 end if // one or more group member(s) if li_group_count > 0 then MessageBox("Material", "Can not delete the current " + & "record until related records are first deleted.~n" + & "No changes made to database.") // at least one child, can't delete it return (0) else return (1) end if end function DAT*_@\)b?KA_@_@_@,`@`@6j@j@Dk@k@Pl@l@dm@m@p@@@@a@@a@@^@^@aijiq@q@ f_compare_date_timefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiongs_database2 1 p_transpdt_datetimef_compare_date_timDAT*"e0  SCtransaction.W x function_objectf_compare_date_timestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@Qaj@,k@@J6@m@!D@@P@@d@^@p @n@`@@ @i n@onDAT*_@_)b?LA_@_@_@(`@`@2j@j@@k@k@Ll@l@`m@m@l@@|@@@@A@@A^@^@qryjtq@q@aine f_retrieve_datefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiongs_database2 3 p_transps_datetime_columnf_retrieve_dateDAT*n0  SCtransaction.S x function_objectf_retrieve_datestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@j@(k@@S2@m@@@@L@@`@^@l @n@|q@@ ,@i n@on DAT*returns a string used to compare a date time column with the value of a date time literalglobal type f_compare_date_time from function_object end type forward prototypes global function string f_compare_date_time (transaction p_trans, datetime pdt_datetime) end prototypes global function string f_compare_date_time (transaction p_trans, datetime pdt_datetime);// This function returns a string that is used in a SELECT clause to compare // the contents of a date time column with the value oDAT*Uf a date time literal. // This function is DBMS dependent. string s_result, ls_datetime ls_datetime = String(pdt_datetime, "yyyy-mm-dd hh:mm:ss") if gs_database = 'ORACLE' then s_result = "to_date('" + ls_datetime + "', 'yyyy-mm-dd hh24:mi:ss')" else s_result = "'" + ls_datetime + "'" end if RETURN s_result end function DAT*_@[)b?KA_@_@T_@Q&`@`@a0j@j@a>k@k@!Jl@l@q^m@m@!j@@z@@@@@@^@^@ n@n@+`@F@F@mii f_copy_recordfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindows_rec_holderpointerf_listobjects2 * DAT* pdw_objpstr_recordf_copy_record=   QCdatawindow.RCs_rec_holder. x function_objectf_copy_recordstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindows_rec_holderpointer,@j@&k@@J0@m@>@@J@@^@^@jjn@q@DAT*_@_)b?LA_@_@t_@q/`@`@q9j@j@aGk@k@Sl@l@gm@m@s@@A@@@@A@@A^@^@qryjtp@p@an@n@aq@q@q+o f_retrieve_group_typesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransactionsqlca2 9 DAT*pp_winp_dwp_metric_levelf_retrieve_group_typesC   QCwindow.Cdatawindow.S x function_objectf_retrieve_group_typesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransaction,@j@/k@@L9@m@G@@S@@g@DAT*_@_)b?LA_@_@_@-`@`@7j@j@Ek@k@Ql@l@em@m@q@@@@@@A@@^@^@*p@p@n@n@q@q@t f_retrieve_locationsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransactionsqlca2 O p_DAT*zwinp_dwp_columnp_sqlp_cityp_statep_nationf_retrieve_locationsw   ")1QCwindow.Cdatawindow.SSLLL x function_objectf_retrieve_locationsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransaction,@qqj@-k@@S7DAT*_@`)b?LA _@_@_@0`@`@:j@j@Hk@k@Tl@l@hm@m@t@@@@q@@a@@^@^@qmaJtp@p@Qn@n@q@q@atip f_retrieve_metric_codesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransactionsqlca2 W DAT*|win_objdw_objlevel_typesourcedeviceprocessstreamf_retrieve_metric_codesw   ")08QCwindow.Cdatawindow.SSSSS x function_objectf_retrieve_metric_codesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransaction, @0DAT*_@`)b?LA_@_@_@.`@`@8j@j@Fk@k@Rl@l@fm@m@r@@@@q@@a@@^@^@aevjep@p@an@n@aq@q@inr f_retrieve_unit_codesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransactionsqlcaselect meas_code from rap_metrics where code DAT*~=' ' .1LA`LLA L P 2 = p_winp_dwp_sqlp_metric_codef_retrieve_unit_codesP   LCwindow.Cdatawindow.SS x function_objectf_retrieve_unit_codesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistvDAT*Function to get the values from all datawindow columns and store the values in a structure.global type f_copy_record from function_object end type forward prototypes global subroutine f_copy_record (datawindow pdw_obj, ref s_rec_holder pstr_record) end prototypes global subroutine f_copy_record (datawindow pdw_obj, ref s_rec_holder pstr_record); ////////////////////////////////////////////////////////////////////////// // // Function: f_copy_record // // Purpose: // // Global funcDAT*tion f_copy_record is to get the values from all // datawindow columns and store the values in a structure. // IMPORTANT - This function does not support compute fields and groups. // // Scope: public // // Arguments: // pdw_obj (datawindow/value) Contains the active datawindow // object. // // Returns : none // // DATE NAME REVISION // ---- ------------------------------------------------------------ // 8/3/94 SWJ INITIAL VERSION ///////////////////////DAT*////////////////////////////////////////////////// // Location variable declaration string ls_empty[], ls_detail_list[] string ls_obj_type, ls_data_type integer li_detail_count, li_cur_obj, & li_str_count = 1, li_long_count = 1, li_date_count = 1, & li_dt_count = 1, li_time_count = 1, li_dec_count = 1, & li_other_count = 1 long ll_cur_row, ll_empty[] date ld_empty[] datetime ldt_empty[] time lt_empty[] decimal ldec_empty[] SetPointer(HourGlass!) // Reset unboundeDAT*d arrays pstr_record.string_arg[] = ls_empty[] pstr_record.long_arg[] = ll_empty[] pstr_record.date_arg[] = ld_empty[] pstr_record.datetime_arg[] = ldt_empty[] pstr_record.time_arg[] = lt_empty[] pstr_record.decimal_arg[] = ldec_empty[] // Get the data object name for the active datawindow pstr_record.dw_data_object = pdw_obj.DataObject // Get a list of all the datawindow objects in the detail band. // Ls_detail_list[] will contain the name of all objects on datawindow // detail banDAT*d. Note that these are returned in creation order, not // by position on the datawindow. li_detail_count = f_listobjects(pdw_obj, ls_detail_list, "*", "detail") // Get the current row ll_cur_row = pdw_obj.GetRow() if ll_cur_row = 0 then MessageBox('Copy Record', 'No row is current') return elseif ll_cur_row = -1 then MessageBox('Copy Record', 'Error - GetRow() in wf_copy_record') return end if // For each object for li_cur_obj = 1 to li_detail_count // For each object, DAT*get the type of the object ls_obj_type = pdw_obj.Describe(ls_detail_list[li_cur_obj] + ".type") // Only get the data type when the object type is column if ls_obj_type = 'column' then ls_data_type = & Left(pdw_obj.Describe(ls_detail_list[li_cur_obj] + & ".coltype"), 5) // Get the data value of the object and store it in a instance // structure choose case ls_data_type case 'char(' pstr_record.string_arg[li_str_count] = & pdw_obj.GetItemString(ll_cur_DAT*row, ls_detail_list[li_cur_obj]) li_str_count = li_str_count + 1 case 'decim' pstr_record.decimal_arg[li_dec_count] = & pdw_obj.GetItemNumber(ll_cur_row, ls_detail_list[li_cur_obj]) li_dec_count = li_dec_count + 1 case 'numbe' pstr_record.long_arg[li_long_count] = & pdw_obj.GetItemNumber(ll_cur_row, ls_detail_list[li_cur_obj]) li_long_count = li_long_count + 1 case 'date' pstr_record.date_arg[li_date_count] = & pdw_obj.GetItemDaDAT*te(ll_cur_row, ls_detail_list[li_cur_obj]) li_date_count = li_date_count + 1 case 'datet' pstr_record.datetime_arg[li_dt_count] = & pdw_obj.GetItemDateTime(ll_cur_row, ls_detail_list[li_cur_obj]) li_dt_count = li_dt_count + 1 case 'time' pstr_record.time_arg[li_time_count] = & pdw_obj.GetItemTime(ll_cur_row, ls_detail_list[li_cur_obj]) li_time_count = li_time_count + 1 case 'real' // 3/98-mlk added real col type pstr_record.decimal_aDAT*rg[li_dec_count] = & pdw_obj.GetItemNumber(ll_cur_row, ls_detail_list[li_cur_obj]) li_dec_count = li_dec_count + 1 case else // 3/98-mlk was over writing string_arg //pstr_record.string_arg[li_other_count] = '' //li_other_count = li_other_count + 1 pstr_record.string_arg[li_str_count] = '' li_str_count = li_str_count + 1 end choose end if next // next object end subroutine DAT*_@[)b?KA_@_@_@&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@@@A@@^@^@pjnq@q@  f_create_viewfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcaf_db_error2 0 ps_view_nameps_sql_stmntf_DAT*create_view$ BSS x function_objectf_create_viewstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectvistr&lr@ient0nt@lfil>on@lmesJin@hild^te@eevijne@ninfzec@ansa mi@ging h@@ DAT*_@`)b?LA_@_@_@%`@`@/j@j@=k@k@Il@l@]m@m@i@@y@@A@@A@@^@^@a t f_sas_configfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectgs_inifile2  ps_modeps_output_fileps_log_fileps_nameps_geinidirps_newconfigps_DAT*sasdirps_userdirps_sasexeps_keyf_sas_config +3?LVakBSSSSSRSRSRSRSRS x function_objectf_sas_configstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject@j@%k@@R/@m@=@DAT*Creates a view, given the view name and SQL statementglobal type f_create_view from function_object end type forward prototypes global function boolean f_create_view (string ps_view_name, string ps_sql_stmnt) end prototypes global function boolean f_create_view (string ps_view_name, string ps_sql_stmnt);// Creates a view, given the view name and SQL statement to create the view string ls_sql_stmnt // First, drop the old view, if one already exists ls_sql_stmnt = 'DROP VIEW ' + psDAT*]_view_name EXECUTE IMMEDIATE :ls_sql_stmnt; // Create the view ls_sql_stmnt = 'CREATE VIEW ' + ps_view_name + ' ' + ps_sql_stmnt EXECUTE IMMEDIATE :ls_sql_stmnt; if f_db_error(SQLCA, "Fail on creating view " + ps_view_name + ". Contact " + & "your technical support") = 1 then return FALSE else return TRUE end if end function DAT*_@[)b?KA_@_@d_@%`@`@a/j@j@q=k@k@qIl@l@]m@m@ai@@y@@@@A@@^@^@pjnq@q@  f_date_rangefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcaf_compare_date_time2 3 ps_activitypldt_froDAT*mpldt_tof_date_range1 SSWW x function_objectf_date_rangestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectsture%ie@nvir/lf@escr=lm@gedIhi@istv]ee@itemini@poweyan@ion @aDAT*_@`)b?LA_@_@_@A/`@`@9j@j@Gk@k@Sl@l@gm@m@s@@@@q@@a@@^@^@aijep@p@ h@@ !r f_save_toolbar_profilefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowgs_inifilerapids2 7 window_nameDAT*window_parmf_save_toolbar_profile+  QSCwindow. x function_objectf_save_toolbar_profilestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowrapids on@ectiguctu/ip@env9ai@edesGai@sageSwc@lisgtr@ewitsio@opoe@n+c DAT*Returns a date range expression for activity to include in a where clauseglobal type f_date_range from function_object end type forward prototypes global function string f_date_range (string ps_activity, datetime pldt_from, datetime pldt_to) end prototypes global function string f_date_range (string ps_activity, datetime pldt_from, datetime pldt_to);// This function returns a string used as part of a WHERE clause in a select statement // to retrieve all activity records within a specifieDAT*Wd date range. string ls_date_range ls_date_range = '( ( ' + ps_activity + '.end_date_time IS NULL OR ' + ps_activity + & ".end_date_time >= " + f_compare_date_time(SQLCA, pldt_from) + " ) AND ( " + & ps_activity + ".start_date_time <= " + f_compare_date_time(SQLCA, pldt_to) + " ) )" RETURN ls_date_range end function DAT*_@[)b?KA_@_@_@#`@`@-j@j@;k@k@Gl@l@[m@m@g@@w@@@@A@@^@^@ q@q@p@ mi ieanone f_db_errorfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionf_boolean_to_stringw_db_errorgs_databasef_oracle_connDAT*ection2 0 at_error_objectas_error_msgf_db_error0  ICtransaction.S x function_objectf_db_errorstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionw_db_error on@ectrcruct#ci@ten-ma@lede;ma@ssagGow@dli[tDAT*_@a)b?LA_@_@_@)`@`@3j@j@Ak@k@Ml@l@am@m@m@@}@@q@@a@@A^@^@qryjtq@q@ain elor f_security_grantfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcagf_db_message2 5 ps_object_nameps_userDAT*_namef_security_grant$ BSS x function_objectf_security_grantstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@Aj@)k@@S3@m@A@@M@@a@^@amje@p@}@ @!r @DAT* _@a)b?LA_@_@d_@!*`@`@4j@j@Bk@k@Nl@l@bm@m@n@@~@@@@@@A^@^@qryjtq@q@ain elor f_security_revokefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcagf_db_message2 6 ps_object_nameps_useDAT*r_namef_security_revoke$ BSS x function_objectf_security_revokestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@j@*k@@M4@m@B@@N@@b@^@qnjt@q@~ @ te@stro h@@DAT*Displays a standard error window for database errors.global type f_db_error from function_object end type forward prototypes global function integer f_db_error (transaction at_error_object, string as_error_msg) end prototypes global function integer f_db_error (transaction at_error_object, string as_error_msg);/////////////////////////////////////////////////////////////////////////// // // Function: f_db_error // // Purpose: // // Function f_db_error is passed a transaction objectDAT* (i.e. SQLCA). If // the transaction object's sqlcode identifies an error, the function // then displays a window containing an error message passed from the // application in addition to the error message pertaining to the // specific RDBMS currently in use. // // The window also allows the user to print the message // // // Arguments: // at_error_object : transaction object (i.e. SQLCA ) // as_error_msg : string (application specific message) // // Returns : inteDAT*ger // // DATE NAME REVISION // ---- ------------------------------------------------------------ // Powersoft Corporation INITIAL VERSION // 7/27/95 SWJ Added a function call to check for a lost // lost connection in Oracle. ///////////////////////////////////////////////////////////////////////// string ls_string if at_error_object.sqlcode = 0 then return 0 else ls_string = as_error_msg + "~r~n~r~n" ls_string = ls_string + "Transaction Error Code : " + strinDAT*g(at_error_object.sqlcode) + "~r~n" ls_string = ls_string + "Database Error Code : " + string(at_error_object.sqldbcode)+ "~r~n" ls_string = ls_string + "DBMS : " + at_error_object.dbms+ "~r~n" ls_string = ls_string + "Database : " + at_error_object.database+ "~r~n" ls_string = ls_string + "User ID : " + at_error_object.userid+ "~r~n" ls_string = ls_string + "DBParm : " + at_error_object.dbparm+ "~r~n" ls_string = ls_strDAT*ing + "Login ID : " + at_error_object.logid+ "~r~n" ls_string = ls_string + "ServerName : " + at_error_object.servername+ "~r~n" ls_string = ls_string + "AutoCommit : " + f_boolean_to_string(at_error_object.autocommit)+ "~r~n" ls_string = ls_string + "Database Error Message : " + at_error_object.sqlerrtext + "~r~n" openwithparm(w_db_error,ls_string) if gs_database = 'ORACLE' then f_oracle_connection(at_error_object.sqldbcode) end if retuDAT*"rn 1 end if end function DAT*_@[)b?KA_@_@_@&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@@@A@@^@^@ n@n@ f_dddw_searchfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 = dw_parentdw_childcolnameselectedrowf_dddw_searchZ DAT* #LCdatawindow.Cdatawindowchild.SRL x function_objectf_dddw_searchstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@qaj@&k@@M0@m@>@@J@@^@^@Aj @q@zs@@ @DAT*_@a)b?LA_@_@d_@q(`@`@2j@j@a@k@k@Ll@l@`m@m@l@@|@@@@A@@A^@^@qryjtn@n@a f_set_value_amtfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 ? dw_objvalval_fldval_amt_fldrow_numf_set_value_amtV DAT*  'BCdatawindow.SSSL x function_objectf_set_value_amtstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@!j@(k@@N2@m@@@@L@@`@^@qljt@q@| @ te@stroDAT*2_@a)b?LA_@_@t_@a*`@`@4j@j@QBk@k@aNl@l@!bm@m@n@@~@@A@@A@@^@^@%@n@n@ f_shift_highlightfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 A clicked_rowdw_objectlast_clicked_rowf_shift_highlight< DAT*$Function to find the nearest match in dddwglobal type f_dddw_search from function_object end type forward prototypes global function long f_dddw_search (datawindow dw_parent, datawindowchild dw_child, string colname, ref long selectedrow) end prototypes global function long f_dddw_search (datawindow dw_parent, datawindowchild dw_child, string colname, ref long selectedrow);////////////////////////////////////////////////////////////////////////// // // Function: f_dddw_search // // PuDAT*&rpose: To find the matched data in dddw. // // Scope: Public // // Parameters: // dw_parent (datawindow/value) - Contains the handle of the datawindow // which has the dropdowndatawindow // dw_child (datawindowchild/value) - Contains the handle of the // dropdowndatawindow // colname (string/value) - Contains the name of the column which has // the dropdowndatawindow as its edit style // selectedrow (long/reference) - Contains the row number for the former // selected DAT*(row // // Returns: Long - The row number that matches the closest to what is // typed in // // Log: // 5/??/94 J?W Initial version // 5/31/94 SWJ Commented the line for highlighting the matched row, // Added return value. // 06/05/94, JBWilcox, Do not highlight row if letters discontinue to match // Do not unhighlight if selectedrow is 0 ////////////////////////////////////////////////////////////////////////// string filt long found_row int num_charsDAT** filt = dw_parent.gettext() if Len (filt) > 0 then // Do case-insensitive search found_row = Find (dw_child, "Lower(" + colname + ")>=~"" + Lower(filt) + "~"", & 1, 99999) if found_row > 0 then if lower(filt) <> lower(left(dw_child.getitemstring(found_row, colname), len(filt))) then found_row = 0 end if end if if found_row > 0 then ScrollToRow (dw_child, found_row) // SetRedraw (dw_child, false) SelectRow (dw_child, selectedrow, FALSE)DAT*, // Comment the following line out. Highlighting the row will be // performed by using postevent function in editchanged event of // the datawindow. - swj, 5/94 // SelectRow (dw_child, found_row, TRUE) // SetRedraw (dw_child, true) else // Filter function did not find any matching row //Beep(1) end if else // Filter length is 0, so unhighlight former selected row if selectedrow > 0 then SelectRow (dw_child, selectedrow, FALSE) end if end if selectedrow = fDAT*Yound_row // Remember number of highlighted row return selectedRow end function DAT*0_@Z)b?KA_@_@t_@q)`@`@a3j@j@QAk@k@qMl@l@qam@m@m@@}@@A@@A@@^@^@AY q@q@s@s@0  @ f_del_activitiesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsan,act_cur4_DAT*KAKA\KADelete from Rap_Activities Where Rap_Activities.Rid =0 56KAf_db_error  $ \ `  2 2 nparentridtransbdeletef_del_activities>  ILRCtransaction.B xDAT*  QLCdatawindow.L x function_objectf_shift_highlightstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow on@ecte_stru*re@ent4t@fileBn@messNnd@ildbem@evienec@info~ct@awin ca@owt @@DAT*6_@a)b?LA_@_@d_@'`@`@1j@j@?k@k@Kl@l@_m@m@k@@{@@@@A@@^@^@qz n@n@8w f_validate_actfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowf_check_datesf_qc_act_data_12 b dw_objrow_numDAT*level_typesource_codedevice_codeprocess_codestream_codef_validate_actp  ".:GBCdatawindow.LSSSSS x function_objectf_validate_actstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@aj@'k@@N1@m@?DAT*H_@b)b?LA_@_@_@(`@`@2j@j@@k@k@Ll@l@`m@m@al@@Q|@@@@@@^@^@k@s@s@ q@q@ @ t@0 f_validate_codefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdynamicstagingareasqlsa,cursor1DAT*<Delete from rap_activitiesglobal type f_del_activities from function_object end type forward prototypes global function integer f_del_activities (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_activities (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, uDAT*>sually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long nRid string szSelection DAT*@ // Base the selection on the value of nParentRid if nParentRid < 0 then nParentRid = -nParentRid szSelection = "Select Rid from Rap_Activities where Ref_Rid = ?" else szSelection = "Select Rid from Rap_Activities where Rid = ?" end if // Prepare the cursor DECLARE act_cur DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMIC act_cur USING :nParentRid; // Process each record DO WHILE Trans.sqlcode = 0 FETCH act_cur into :nRid; // ProDAT*Bcess the children if Trans.sqlcode = 0 then nInd = 0 // No Children if nInd >= 0 then nCount = nCount + nInd end if end if // Process the current record if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Activities Where Rap_Activities.Rid = :nRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 LOOP // Notify the user if something bad happened if Trans.sqlcode <> 0DAT* AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Activities") nCount = -1 end if Close act_cur; f_db_error(Trans, "f_del_Activities - Close failed") return nCount end function DAT*F_@Z)b?KA_@_@d_@a"`@`@q,j@j@:k@k@Fl@l@Zm@m@f@@v@@@@@@q^@^@qew cq@q@as@s@aan otarK +e_@ f_del_appfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,app_curDAT*KAKATKAf_del_docsqlcaDelete from rap_applications Where rid =0 ()KAf_db_error   T X  2 + nparentridtransbdeletef_del_app=  LLCtransaction.BDAT*LAtransactionsqlcaarLA(N`LAf_db_error  ( ` d 2 0 codeattr_nametab_namef_validate_code1  BSSS x function_objectf_validate_codestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchDAT*L_@b)b?LA_@_@_@+`@`@5j@j@Ck@k@Ol@l@cm@m@ao@@@@@@A@@^@^@ n@n@ f_validate_dev_profunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 * dw_objrow_numf_validate_dev_pro/  DAT*BCdatawindow.L x function_objectf_validate_dev_prostructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@j@+k@@L5@m@aCQ@@O@@c@^@o@@s@ @ @t @@ @ @DAT*^_@b)b?LA_@_@_@+`@`@5j@j@Ck@k@Ol@l@cm@m@o@@@@A@@A@@A^@^@qryjtn@n@a f_validate_geo_locfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 * dw_objrow_numf_validate_geo_loc/  DAT*RDelete from rap_applicationsglobal type f_del_app from function_object end type forward prototypes global function long f_del_app (long nparentrid, transaction trans, boolean bdelete) end prototypes global function long f_del_app (long nparentrid, transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, usually sqlca // bDelete - Set toDAT*T true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes all document lookups for a given document. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functioDAT*Vns long ll_rid string ls_sql if nParentRid < 0 then nParentRid = -nParentRid ls_sql = 'select rid from rap_applications where source_rid = ?' else ls_sql = 'select rid from rap_applications where rid = ?' end if // Prepare the cursor declare app_cur dynamic cursor for sqlsa; prepare sqlsa from :ls_sql using trans; open dynamic app_cur using :nParentRid; // Process each record do while trans.sqlcode = 0 fetch app_cur into :ll_rid; // Process the children if trans.sqlDAT*Xcode = 0 then nInd = f_del_doc(-ll_rid, 'app', trans, bDelete) if nInd >= 0 then nCount = nCount + nInd end if // Process the current record if trans.sqlcode = 0 and bDelete then Delete from rap_applications Where rid = :ll_rid; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 loop // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_app") nCount = -1 endDAT*e if close app_cur; f_db_error(trans, 'f_del_app - Close failed') return nCount end function DAT*\_@Z)b?KA_@_@_@+`@`@5j@j@aCk@k@Ol@l@cm@m@o@@@@@@A@@^@^@Ah q@q@s@s@ |<@G@ f_del_cal_protocolfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,cur_calcsDAT*KAKA`KAf_del_method_metricsDelete from Rap_Calculation_Protocols Where Rap_Calculation_Protocols.Rid =0 KLKAf_db_error  ( ` d  2 4 nparentridtransbdeletef_del_cal_protocol> DAT*BCdatawindow.L x function_objectf_validate_geo_locstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow on@ect_dros+ai@ipie5me@ailfCti@ailmOaw@wchicwi@treeoon@ionibj@data @nt 8@ @ @DAT*b_@b)b?LA"_@_@_@2`@`@<j@j@Jk@k@Vl@l@jm@m@v@@@@a@@a@@A^@^@qryjtn@n@a f_validate_legal_relationfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 1 dw_objrow_numf_validate_legal_relation/ DAT* BCdatawindow.L x function_objectf_validate_legal_relationstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow on@ect_gocs2ai@ipie<me@ailfJti@ailmVaw@wchijwi@treevon@ionibj@data @i n@on Ks@DAT*tNOT USED. Function to validate if location entered exists in the rap_geographic_locations tableglobal type f_validate_location from function_object end type forward prototypes global function boolean f_validate_location (string p_value, string p_column, long p_city, long p_state, long p_nation) end prototypes global function boolean f_validate_location (string p_value, string p_column, long p_city, long p_state, long p_nation);string ls_sql long ls_var1, ls_var2 string ls_name integer DAT*hDelete from rap_cal_protocolsglobal type f_del_cal_protocol from function_object end type forward prototypes global function long f_del_cal_protocol (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function long f_del_cal_protocol (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to useDAT*j, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long nRid string szSelectionDAT*l // Base the selection on the value of nParentRid if nParentRid < 0 then nParentRid = -nParentRid szSelection = "Select Rid from Rap_Calculation_Protocols where Rid = ?" else szSelection = "Select Rid from Rap_Calculation_Protocols where Rid = ?" end if // Prepare the cursor DECLARE cur_calcs DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMIC cur_calcs USING :nParentRid; // Process each record DO WHILE Trans.sqlcode = 0 FETCH cur_caDAT*nlcs into :nRid; // Process the children if Trans.sqlcode = 0 then nInd = f_del_Method_Metrics(-nRid, Trans, bDelete) if nInd >= 0 then nCount = nCount + nInd end if end if // Process the current record if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Calculation_Protocols Where Rap_Calculation_Protocols.Rid = :nRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 DAT* LOOP // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Cal_Protocol") nCount = -1 end if Close cur_calcs; f_db_error(Trans, "f_del_Cal_Protocol - Close failed") return nCount end function DAT*r_@Z)b?KA_@_@_@*`@`@a4j@j@aBk@k@Nl@l@bm@m@n@@~@@@@A@@^@^@W q@q@|*'0 f_del_connectionsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_Connections Where From_Device_Rid =0 OR To_Device_Rid =0 >?RSDAT*KATKADelete from Rap_Connections Where From_Device_Rid =0 OR To_Device_Rid =0 34GHKAf_db_error T X  2 3 nparentridtransbdeletef_del_connections>  ILRCtransaction.B x funcDAT*cnt = 0 if isnull(p_value) or len(trim(p_value)) < 1 then return true end if if gs_database = 'ORACLE' then // ls_sql = "SELECT DISTINCT rap_geographic_locations_d.name " + & // "from rap_geographic_locations rap_geographic_locations_a, " + & // " rap_geographic_locations rap_geographic_locations_b, " + & // " rap_geographic_locations rap_geographic_locations_c, " + & // " rap_geographic_locations rap_geographic_locations_d " + & // " where rap_geographic_locationDAT*xFunction to validate input for Process Schedules.global type f_validate_pro_schedule from function_object end type forward prototypes global function boolean f_validate_pro_schedule (datawindow dw_obj, long row_num) end prototypes global function boolean f_validate_pro_schedule (datawindow dw_obj, long row_num);string ls_year, ls_begin_month, ls_end_month string ls_begin_day, ls_end_day, ls_begin_hr, ls_end_hr ls_year = dw_obj.GetItemString(row_num, "year") if IsNull(ls_year) or ls_DAT*year = '' then MessageBox("DataWindow Error", "Sorry! Year is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("year") dw_obj.ScrollToRow(row_num) return FALSE end if ls_begin_month = dw_obj.GetItemString(row_num, "begin_month_no") if IsNull(ls_begin_month) or ls_begin_month = '' then MessageBox("DataWindow Error", "Sorry! Start Month is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("begin_monDAT*|Delete from rap_connectionsglobal type f_del_connections from function_object end type forward prototypes global function integer f_del_connections (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_connections (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to usDAT*~e, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions if nParentRid < 0 then nPaDAT*rentRid = -nParentRid // Process the current record Select Count(*) into :nInd From Rap_Connections Where From_Device_Rid = :nParentRid OR To_Device_Rid = :nParentRid USING Trans; if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Connections Where From_Device_Rid = :nParentRid OR To_Device_Rid = :nParentRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nInd // Notify the user if something bad haDAT*ppened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Connections") nCount = -1 end if return nCount end function DAT*_@Z)b?KA_@_@_@.`@`@8j@j@Fk@k@Rl@l@fm@m@r@@@@@@A@@^@^@Oq@q@0 f_del_contact_reasonsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_Contact_Reasons Where Contact_Rid =0 >?DAT*KA@KADelete from Rap_Contact_Reasons Where Contact_Rid =0 34|KAf_db_error @ D  2 7 nparentridtransbdeletef_del_contact_reasons>  ILRCtransaction.B x function_objectf_del_contact_reasonsstructDAT*_@c)b?MA_@_@T_@!'`@`@A1j@j@A?k@k@AKl@l@_m@m@ak@@{@@A@@A@@^@^@2n@n@ f_validate_srcfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 & dw_objrow_numf_validate_src/  DAT*BCdatawindow.L x function_objectf_validate_srcstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow on@ect_pched'ur@ilre1vi@ent?sc@ionKe@wind_st@itemkte@nnec{ow@ject w@otot h@@ @ @ DAT*_@c)b?MA_@_@d_@a'`@`@a1j@j@Q?k@k@!Kl@l@q_m@m@ak@@{@@a@@a@@^@^@0  y! eq@    ' f_window_closefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectgi_geo_numgi_source_numgi_DAT*Delete from rap_contact_reasonsglobal type f_del_contact_reasons from function_object end type forward prototypes global function int f_del_contact_reasons (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function int f_del_contact_reasons (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction objeDAT*ct to use, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes all contact reasons for a given contact. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long DAT*nInd = 0 // Return indicator for functions if nParentRid < 0 then nParentRid = -nParentRid // Process the current record Select Count(*) into :nInd From Rap_Contact_Reasons Where Contact_Rid = :nParentRid USING Trans; if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Contact_Reasons Where Contact_Rid = :nParentRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nInd // Notify the user if something bad happened iDAT*f Trans.sqlcode <> 0 then f_db_error(Trans, "f_del_Contact_Reasons") nCount = -1 end if return nCount end function DAT*_@Z)b?KA_@_@_@'`@`@1j@j@?k@k@Kl@l@_m@m@k@@{@@@@A@@^@^@Oq@q@s@s@< o$den/@ f_del_contactsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsal,cur_contactsDAT*KAKA(N`KAf_del_contact_reasonsDelete from Rap_Contacts Where Rap_Contacts.Rid =0 12KAf_db_error  ( ` d  2 0 nparentridtransbdeletef_del_contacts>  DAT*device_numgi_process_numgl_cur_rowgl_geo_ridgl_source_ridgl_device_ridgd_process_rid2  win_namef_window_close QS x function_objectf_window_closestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject on@ect_struc'ec@nte1m@iled?m@essaKDAT*Keeps track of the number of windows which refer to the gl_geo_rid, gl_source_rid, gl_device_rid, gl_process_rid.global type f_window_count from function_object end type forward prototypes global subroutine f_window_count (string win_name) end prototypes global subroutine f_window_count (string win_name);choose case win_name case 'geo' gi_geo_num = gi_geo_num + 1 case 'source' if gi_geo_num > 0 then gi_geo_num = gi_geo_num + 1 end if gi_source_num = gi_source_num + 1 DAT* case 'device' gi_source_num = gi_source_num + 1 gi_device_num = gi_device_num + 1 case 'process' gi_source_num = gi_source_num + 1 gi_device_num = gi_device_num + 1 gi_process_num = gi_process_num + 1 case 'connection' gi_source_num = gi_source_num + 1 gi_device_num = gi_device_num + 1 case 'stream' gi_source_num = gi_source_num + 1 gi_device_num = gi_device_num + 1 gi_process_num = gi_process_num + 1 // gi_stream_num = gi_stream_num + 1 end choose end subrDAT*_@d)b?MA _@_@_@a%`@`@a/j@j@q=k@k@aIl@l@q]m@m@qi@@y@@@@@@^@^@qS f_write_linefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2 ; pi_file_numps_fileps_headerps_textf_write_line> DAT*Delete from rap_contactsglobal type f_del_contacts from function_object end type forward prototypes global function integer f_del_contacts (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_contacts (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, usually sDAT*qlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long nRid string szSelection // BaseDAT* the selection on the value of nParentRid if nParentRid < 0 then nParentRid = -nParentRid szSelection = "Select Rid from Rap_Contacts where Ref_Rid = ?" else szSelection = "Select Rid from Rap_Contacts where Rid = ?" end if // Prepare the cursor DECLARE cur_contacts DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMIC cur_contacts USING :nParentRid; // Process each record DO WHILE Trans.sqlcode = 0 FETCH cur_contacts into :nRid; //DAT* Process the children if Trans.sqlcode = 0 then nInd = f_del_Contact_Reasons(-nRid, Trans, bDelete) if nInd >= 0 then nCount = nCount + nInd end if end if // Process the current record if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Contacts Where Rap_Contacts.Rid = :nRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 LOOP // Notify the user if something bad happDAT*ened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Contacts") nCount = -1 end if Close cur_contacts; f_db_error(Trans, "f_del_Contacts - Close failed") return nCount end function DAT*_@Y)b?KA_@_@_@&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@@@A@@a^@^@aemjeq@q@as@s@qct ycsg@@0n 1 @ f_del_devicesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectiDAT*oninfopowerobjecttransactiondynamicstagingareasqlsa,cur_devicesKAKA\KAf_del_group_memberf_del_processesf_del_contactsf_del_location_coordinate_groupsf_del_activitiesf_del_connectionsf_del_leg_ent_relf_del_doc_lookupsqlcaDelete from Rap_Devices Where Rap_Devices.Rid =0 _/0ilj7DAT*&BISSS x function_objectf_write_linestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject@j@%k@@K/@m@=@@I@@]@^@qijt@roy@ @o n@on @ DAT*_@d)b?MA_@_@_@/`@`@9j@j@Gk@k@Sl@l@gm@m@s@@@@@@@@A^@^@qryjtq@q@a gf_build_fatal_messagefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction2 4 p_transaction_objectgf_build_fatal_message# DAT* SCtransaction. x function_objectgf_build_fatal_messagestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectneuctu/ip@env9ai@edesGai@sageSwc@lisgtr@ewitsio@opoe@n+c te@stro h@@ @ DAT*generic function to handle embedded sql error messagesglobal type gf_db_message from function_object end type forward prototypes global function int gf_db_message (transaction p_transaction_object, string p_error_type) end prototypes global function int gf_db_message (transaction p_transaction_object, string p_error_type);// this function displays database error messages based on the type // of error choose case (p_error_type) case "disconnect", "rollback", "commit", "select_one" DAT* if p_transaction_object.sqlcode <> 0 then gs_error_message=gf_build_fatal_message(p_transaction_object) open(w_error_message) end if case "connect" if p_transaction_object.sqlcode <> 0 then if p_transaction_object.sqldbcode = 1017 then messagebox("Connection Error", "Invalid Password", exclamation!) return 1017 else gs_error_message=gf_build_fatal_message(p_transaction_object) open(w_error_message) end if DAT*_@N)b?JA_@_@k_@.`@`@8j@j@Fk@k@Rl@l@fm@m@r@@@@@@@@a^@^@qdojdq@q@a f_get_odbc_connectionfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction2 ; p_transps_dsnps_uidps_pwdf_get_odbc_connectionM DAT*J  SCtransaction.RSRSRS x function_objectf_get_odbc_connectionstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectia_pro.tu@ailr8nv@mentFes@tionRge@awinfis@witerit@onnepo@bjec io@DAT*Delete from rap_devicesglobal type f_del_devices from function_object end type forward prototypes global function integer f_del_devices (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_devices (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, usually sqlcaDAT* // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long nRid string szSelection // Base theDAT* selection on the value of nParentRid if nParentRid < 0 then nParentRid = -nParentRid szSelection = "Select Rid from Rap_Devices where Source_Rid = ?" else szSelection = "Select Rid from Rap_Devices where Rid = ?" end if // Prepare the cursor DECLARE cur_devices DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMIC cur_devices USING :nParentRid; // Process each record DO WHILE Trans.sqlcode = 0 FETCH cur_devices into :nRid; // ProcesDAT*s the children if Trans.sqlcode = 0 then nInd = f_del_group_member(nRid, Trans, bDelete) if nInd >= 0 then nCount = nCount + nInd nInd = f_del_Processes(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_Contacts(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_location_coordinate_groups(-nRid, Trans, bDelete) end if if nInd >= 0 DAT*then nCount = nCount + nInd nInd = f_del_Activities(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_Connections(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_leg_ent_rel(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_doc_lookup(-nRid, '', Trans, bDelete) end if if nInd >DAT*= 0 then nCount = nCount + nInd end if // Process the current record if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Devices Where Rap_Devices.Rid = :nRid; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 LOOP // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Devices") nCount = -1 end if Close cur_devices; f_db_error(Trans, "f_dDAT*<el_Devices - Close failed") return nCount end function DAT*_@Y)b?KA_@_@_@"`@`@,j@j@:k@k@Fl@l@Zm@m@f@@v@@A@@A@@^@^@AY q@q@s@s@0  @ @ f_del_docfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,doc_curDAT*KAKATKAf_del_doc_lookupsqlcaDelete from rap_documents Where rid =0 %&KAf_db_error   T X  2 4 pl_ridps_parentptranspb_deletef_del_docJ   DAT*_@N)b?JA_@_@l_@'`@`@1j@j@?k@k@Kl@l@_m@m@k@@{@@@@@@A^@^@qryjtromq@q@alo rp+o|@ f_get_sequencefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectgs_databasetransactionsqlcaselect rid_storage_seq.nextval from sys.dual DAT*LJA r4JAf_db_errorselect rid from rid_storage for update of rid {JA0JAupdate rid_storage set rid =0 @ JA 4 8    @D 2  f_get_sequence DAT*_@N)b?JA#_@_@m_@3`@`@=j@j@Kk@k@Wl@l@km@m@w@@@@@@@@^@^@! q@q@p^ x  f_get_measurement_for_unitfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcaSELECT rap_units.meas_code FROM rap_units WHERE rap_units.code =' ' DAT*N@CJAPJAf_sqlcheck P T 2 / as_unitcodef_get_measurement_for_unit SS x function_objectf_get_measurement_for_unitstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionDAT*_@O)b?JA_@_@Dn_@q"`@`@a,j@j@a:k@k@aFl@l@aZm@m@af@@av@@@@@@^@^@Ald p@p@n@n@q@q@ f_get_sqlfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransactionsqlca2 & p_winp_dwp_DAT*Delete from rap_documentsglobal type f_del_doc from function_object end type forward prototypes global function long f_del_doc (long pl_rid, string ps_parent, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_doc (long pl_rid, string ps_parent, transaction ptrans, boolean pb_delete);// Function to perform delete on rap_documents tables. // Three arguments are required: // pl_rid - The unique RID of the record to delete // ps_parent - String to indicate DAT*its parent type // ptrans - The transaction object to use, usually sqlca // pb_delete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes the document record from // rap_documents table and its children record from tables // rap_document_lookups if DAT*any. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long ll_rid string ls_sql if pl_rid < 0 then pl_rid = -pl_rid if ps_parent = 'form' then ls_sql = 'select rid from rap_documents where form_rid = ?' elseif ps_parent = 'app' then ls_sql = 'select rid from rap_documents where application_rid = ?' else MessageBox('f_del_doc', 'Invalid parent type - ' + pDAT*s_parent) return -1 end if else ls_sql = 'select rid from rap_documents where rid = ?' end if // Prepare the cursor declare doc_cur dynamic cursor for sqlsa; prepare sqlsa from :ls_sql using ptrans; open dynamic doc_cur using :pl_rid; // Process each record do while ptrans.sqlcode = 0 fetch doc_cur into :ll_rid; // Process the children if ptrans.sqlcode = 0 then nInd = f_del_doc_lookup(ll_rid, 'doc', ptrans, pb_delete) if nInd >= 0 then nCount = nCount + nInd endDAT* if // Process the current record if ptrans.sqlcode = 0 and pb_delete then Delete from rap_documents Where rid = :ll_rid; end if // Update the counter if ptrans.sqlcode = 0 then nCount = nCount + 1 loop // Notify the user if something bad happened if pTrans.sqlcode <> 0 AND pTrans.sqlcode <> 100 then f_db_error(ptrans, "f_del_doc") nCount = -1 end if close doc_cur; f_db_error(ptrans, 'f_del_doc - Close failed') return nCount end function DAT*_@Y)b?KA_@_@_@)`@`@3j@j@Ak@k@aMl@l@aam@m@m@@}@@@@@@^@^@AK q@q@s@s@2 S @@ f_del_doc_lookupfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,doclook_curDAT*KAKAj`KAsqlcaDelete from rap_document_lookups Where rid =0 ,-KAf_db_error  ( ` d  2 ; pl_ridps_parentptranspb_deletef_del_doc_lookupJ   DAT*\columnf_get_sqlC   SCwindow.Cdatawindow.S x function_objectf_get_sqlstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransaction,#@j@"k@@W,@m@:@@F@@Z@^@!f @q@v @DAT*_@O)b?JA _@_@do_@a0`@`@q:j@j@Hk@k@Tl@l@hm@m@t@@@@A@@A@@A^@^@qryjtn@n@ainelor f_dw_get_objects_attribfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowf_get_tokenf_dw_get_attributes2 d dw_aDAT*^rgobj_listobj_typebandattributesf_dw_get_objects_attribod XY  %.3ICdatawindow.RS[]SSS x function_objectf_dw_get_objects_attribstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@qaj@0k@@F:@mDAT*_@O)b?JA_@_@tp_@q%`@`@a/j@j@q=k@k@qIl@l@]m@m@i@@y@@@@@@^@^@*#`@p@ v@v@al f_get_stringfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectstr_parmsw_get_stringmessage2 G as_DAT*Delete from rap_document_lookupsglobal type f_del_doc_lookup from function_object end type forward prototypes global function long f_del_doc_lookup (long pl_rid, string ps_parent, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_doc_lookup (long pl_rid, string ps_parent, transaction ptrans, boolean pb_delete);// Function to perform cascading delete. Three arguments are // required: // pl_rid - The unique RID of the record to delete // ps_parent - StringDAT* to indicate its parent type // ptrans - The transaction object to use, usually sqlca // pb_delete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes all document lookups for a given document. //////////////////////////////////////////////////////////DAT*////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long ll_rid string ls_sql if pl_rid < 0 then pl_rid = -pl_rid ls_sql = 'select rid from rap_document_lookups where ref_rid = ?' else if ps_parent = 'doc' then ls_sql = 'select rid from rap_document_lookups where document_rid = ?' else ls_sql = 'select rid from rap_document_lookups where rid = ?' end if end if // Prepare the cursor declare doclook_cur dynamic cDAT*ursor for sqlsa; prepare sqlsa from :ls_sql using ptrans; open dynamic doclook_cur using :pl_rid; // Process each record do while ptrans.sqlcode = 0 fetch doclook_cur into :ll_rid; // Process the current record if ptrans.sqlcode = 0 and pb_delete then Delete from rap_document_lookups Where rid = :ll_rid; end if // Update the counter if ptrans.sqlcode = 0 then nCount = nCount + 1 loop // Notify the user if something bad happened if pTrans.sqlcode <> 0 AND pDAT*Trans.sqlcode <> 100 then f_db_error(ptrans, "f_del_doc_lookup") nCount = -1 end if close doclook_cur; f_db_error(ptrans, 'f_del_doc_lookup - Close failed') return nCount end function DAT*_@Y)b?KA_@_@t_@a.`@`@a8j@j@qFk@k@Rl@l@fm@m@r@@@@A@@A@@^@^@a`U q@q@X f_del_emission_factorfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_emission_factors Where profile_code =' ' @CDAT*KAD KADelete from Rap_emission_factors Where profile_code =' ' 58KASelect Count ( *) From Rap_emission_factors Where process_rid =0 and profile_code =' ' ?@SVPKAXKADelete from Rap_emission_factors Where process_rid =0 and profile_code =' DAT*`titleai_max_lenas_char_caseas_current_valuef_get_string> )SSISS x function_objectf_get_stringstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectstr_parmsw_get_stringmessage, on@ectbj_att%ur@ilre/vi@ent=sc@ionIe@wind]st@iteDAT*_@O)b?JA_@_@dq_@,`@`@Q6j@j@Dk@k@Pl@l@dm@m@p@@@@@@A@@^@^@ n@n@ f_dw_get_attributesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowf_global_replace2 5 dw_argobjectattributesf_dw_get_aDAT*bttributes<  SCdatawindow.SS x function_objectf_dw_get_attributesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@qaj@,k@@I6@m@D@@P@@d@^@p*@#`@p@@ @v@aDAT*_@O)b?JA _@_@r_@$`@`@.j@j@<k@k@aHl@l@\m@m@qh@@x@@@@@@^@^@ f_get_tokenfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2 % sourceseparatorf_get_token% SRSS xDAT*d function_objectf_get_tokenstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject on@ecttttes$ma@cipi.nm@mail<pt@mailHta@owch\ew@trehco@tionxob@dat @ @ @ DAT*Delete rap_emission_factor recordsglobal type f_del_emission_factor from function_object end type forward prototypes global function long f_del_emission_factor (long pl_parent_rid, string ps_code, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_emission_factor (long pl_parent_rid, string ps_code, transaction ptrans, boolean pb_delete);// Function to perform cascading delete. Three arguments are // required: // pl_parent_rid - The unique or parent rid ofDAT*  the record to delete // ps_code - The primary key of the record to delete // ptrans - The transaction object to use, usually sqlca // pb_delete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes all contact reasons for a given contact. long ll_cntDAT*  = 0 // Number of records processed long ll_ind = 0 // Return indicator for functions // Determine its parent based on the value of ps_code or pl_parent_rid // If the parent is rap_speciation_profile if pl_parent_rid = 0 then // Process the current record Select Count(*) into :ll_ind From Rap_emission_factors Where profile_code = :ps_code USING ptrans; if ptrans.sqlcode = 0 AND pb_delete then Delete from Rap_emission_factors Where profile_code = :pDAT*s_code USING ptrans; end if // Otherwise, if the parent is rap_processes elseif pl_parent_rid > 0 then if ps_code <> '' then // Process the current record Select Count(*) into :ll_ind From Rap_emission_factors Where process_rid = :pl_parent_rid and profile_code = :ps_code USING ptrans; if ptrans.sqlcode = 0 AND pb_delete then Delete from Rap_emission_factors Where process_rid = :pl_parent_rid and profile_code = :ps_code DAT* USING ptrans; end if else // Process the current record Select Count(*) into :ll_ind From Rap_emission_factors Where process_rid = :pl_parent_rid USING ptrans; if ptrans.sqlcode = 0 AND pb_delete then Delete from Rap_emission_factors Where process_rid = :pl_parent_rid USING ptrans; end if end if end if // Update the counter if ptrans.sqlcode = 0 then ll_cnt = ll_ind // Notify the user if something bad happenedDAT* if ptrans.sqlcode <> 0 then f_db_error(ptrans, "f_del_emission_factor") ll_cnt = -1 end if return ll_cnt end function DAT*_@Y)b?KA_@_@_@#`@`@-j@j@a;k@k@Gl@l@[m@m@g@@w@@@@q@@a^@^@qwijrq@q@a`ct ffwecano0 f_del_formfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From rap_forms Where rid =0 ,-DAT*KA$KAsqlcaf_del_docDelete from rap_forms Where rid =0 !"pKAf_db_error $ (  2 + pl_ridptranspb_deletef_del_form=  LLCtransaction.B x function_objectf_del_formstructuremailrecipientenvironmentmaDAT*_@P)b?JA_@_@s_@)`@`@3j@j@Ak@k@Ml@l@am@m@m@@}@@@@@@A^@^@qryjtF@F@aq@q@alo r+o f_delete_leg_entfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectpointertransactionsqlcaSelect count ( rid ) from rap_legal_entities where parent_riDAT*fd =0 ?@JA`LJAf_db_error L P 2 $ pl_leg_ridf_delete_leg_ent IL x function_objectf_delete_leg_entstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectpointertransaction DAT*(_@P)b?JA_@_@t_@.`@`@8j@j@Fk@k@Rl@l@fm@m@r@@@@@@@@^@^@qd p@p@ld h@\X !o f_get_toolbar_profilefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowgs_inifilerapids2 6 window_nameDAT*Delete from rap_formsglobal type f_del_form from function_object end type forward prototypes global function long f_del_form (long pl_rid, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_form (long pl_rid, transaction ptrans, boolean pb_delete);// Function to perform delete on rap_forms tables. // Three arguments are required: // pl_rid - The unique RID of the record to delete // ptrans - The transaction object to use, usually sqlca // pb_delete - SeDAT* t to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes the form record from // rap_forms table and its children record from tables // rap_documents, rap_document_lookups if any. //////////////////////////////////////////////////////////////////// long ll_cDAT*"nt = 0 // Number of records processed long ll_ind = 0 // Return indicator for functions if pl_rid < 0 then pl_rid = -pl_rid // Process the current record Select Count(*) into :ll_ind From rap_forms Where rid = :pl_rid USING ptrans; if ptrans.sqlcode = 0 AND ll_ind > 0 then ll_ind = f_del_doc(-pl_rid, 'form', sqlca, pb_delete) if ll_ind >= 0 then ll_cnt = ll_cnt + ll_ind end if if ptrans.sqlcode = 0 and pb_delete then Delete from rap_forms Where ridDAT*  = :pl_rid USING ptrans; end if // Update the counter if ptrans.sqlcode = 0 then ll_cnt = ll_cnt + 1 // Notify the user if something bad happened if ptrans.sqlcode <> 0 then f_db_error(ptrans, "f_del_forms") ll_cnt = -1 end if return ll_cnt end function DAT*&_@X)b?KA_@_@_@'`@`@1j@j@?k@k@Kl@l@_m@m@k@@{@@@@@@^@^@AS q@q@t z@0;0 f_del_geo_locsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From rap_geographic_locations WherDAT*e rid =0 ;<KA8KAsqlcaf_del_group_memberf_del_location_coordinate_groupsf_del_activitiesDelete from rap_geographic_locations Where rid =0 01KAf_db_error 8 <  2 / pl_ridptranspb_deletef_del_geo_locs=  DAT*pwindow_parmf_get_toolbar_profile+  QSCwindow. x function_objectf_get_toolbar_profilestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowrapids@j@.k@@M8@m@F@@R@@f@^@qrjt@F@q@@ DAT*,_@P)b?JA_@_@u_@)`@`@3j@j@Ak@k@Ml@l@am@m@m@@}@@@@@@A^@^@qryjtF@F@aq@q@alo r+oD` f_delete_geo_locfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectpointertransactionsqlcaSelect count ( rid ) from rap_geographic_locations where parDAT*rent_rid =0 EFJAPJAf_db_errorSelect count ( child_ref_rid ) from rap_group_members where parent_ref_rid =0 LMJA$JASelect count ( rid ) From rap_sources where ( geographic_county_rid =0 or geographic_incorp_rid =0 ) EFab`DAT*>_@P)b?JA_@_@v_@'`@`@1j@j@?k@k@Kl@l@_m@m@k@@{@@@@@@^@^@Ag p@p@n@n@q@q@H" f_get_unit_sqlfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransactionsqlca2 " p_winp_DAT*2Delete from rap_geographic_locationsglobal type f_del_geo_locs from function_object end type forward prototypes global function long f_del_geo_locs (long pl_rid, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_geo_locs (long pl_rid, transaction ptrans, boolean pb_delete);// Function to perform delete on rap_geographic_locations tables. // Three arguments are required: // pl_rid - The unique RID of the record to delete // ptrans - The transaction objecDAT*4t to use, usually sqlca // pb_delete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes the geographic location record from // rap_geographic_locations table and rap_group_members table if this // record is a group member of the other geo record. /DAT*6/////////////////////////////////////////////////////////////////// long ll_cnt = 0 // Number of records processed long ll_ind = 0 // Return indicator for functions if pl_rid < 0 then pl_rid = -pl_rid // Process the current record Select Count(*) into :ll_ind From rap_geographic_locations Where rid = :pl_rid USING ptrans; if ptrans.sqlcode = 0 AND ll_ind > 0 then ll_ind = f_del_group_member(pl_rid, sqlca, pb_delete) if ll_ind >= 0 then ll_cnt = ll_cnt + ll_ind DAT*8 ll_ind = f_del_location_coordinate_groups(-pl_rid, sqlca, pb_delete) end if if ll_ind >= 0 then ll_cnt = ll_cnt + ll_ind ll_ind = f_del_activities(-pl_rid, sqlca, pb_delete) end if if ll_ind >= 0 then ll_cnt = ll_cnt + ll_ind end if if ptrans.sqlcode = 0 and pb_delete then Delete from rap_geographic_locations Where rid = :pl_rid USING ptrans; end if // Update the counter if ptrans.sqlcode = 0 then ll_cnt = ll_cnt + 1 // Notify the user if sometDAT*hing bad happened if ptrans.sqlcode <> 0 then f_db_error(ptrans, "f_del_geo_locs") ll_cnt = -1 end if return ll_cnt end function DAT*<_@X)b?KA_@_@_@+`@`@5j@j@Ck@k@Ol@l@cm@m@o@@@@@@A@@^@^@P q@q@P,` f_del_group_memberfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From rap_group_members Where child_ref_rid =0 >?DAT*KA@KADelete from rap_group_members Where child_ref_rid =0 34|KAf_db_errorSelect Count ( *) From rap_group_members Where parent_ref_rid =0 ?@>KA|DKADelete from rap_group_members Where parent_ref_rid =0 45DAT*tdwf_get_unit_sql6   SCwindow.Cdatawindow. x function_objectf_get_unit_sqlstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransaction,@j@'k@@M1@m@?@@K@@_@^@qkjt@F@{q@@DAT*B_@P)b?JA_@_@dw_@a&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@@@A@@^@^@A  q@q@s@s@0 P@(3@ f_del_streamsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,stream_curwDAT*vJAJA\JAf_del_activitiesf_del_doc_lookupDelete from Rap_Streams Where Rap_Streams.Rid =0 /0JAf_db_error  $ \ `  2 / nparentridtransbdeletef_del_streams> DAT*T_@P)b?JA _@_@x_@)`@`@3j@j@Ak@k@Ml@l@am@m@m@@}@@A@@A@@^@^@A* f_global_replacefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2 6 sourcelook_forreplace_withf_global_replace1 DAT*HDelete child group member from rap_group_members table.global type f_del_group_member from function_object end type forward prototypes global function long f_del_group_member (long pl_rid, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_group_member (long pl_rid, transaction ptrans, boolean pb_delete);// Function to perform delete on rap_group_members tables. // Three arguments are required: // pl_rid - The unique RID of the record to delete // ptransDAT*J - The transaction object to use, usually sqlca // pb_delete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes the group child record from // rap_group_members table. //////////////////////////////////////////////////////////////////// long ll_cnt DAT*L= 0 // Number of records processed long ll_ind = 0 // Return indicator for functions // Process the current record Select Count(*) into :ll_ind From rap_group_members Where child_ref_rid = :pl_rid USING ptrans; if ptrans.sqlcode = 0 AND pb_delete then Delete from rap_group_members Where child_ref_rid = :pl_rid USING ptrans; end if // Update the counter if ptrans.sqlcode = 0 then ll_cnt = ll_ind // Notify the user if something bad happened if ptrDAT*Nans.sqlcode < 0 then f_db_error(ptrans, "f_del_group_member") ll_cnt = -1 end if Select Count(*) into :ll_ind From rap_group_members Where parent_ref_rid = :pl_rid USING ptrans; if ptrans.sqlcode = 0 AND pb_delete then Delete from rap_group_members Where parent_ref_rid = :pl_rid USING ptrans; end if // Update the counter if ptrans.sqlcode = 0 then ll_cnt = ll_cnt + ll_ind // Notify the user if something bad happened if ptrans.sqlcode < 0 theDAT*jn f_db_error(ptrans, "f_del_group_member") ll_cnt = -1 end if return ll_cnt end function DAT*R_@W)b?KA_@_@_@*`@`@4j@j@Bk@k@Nl@l@bm@m@n@@~@@@@A@@a^@^@amjiq@q@as@s@abj rct @'@ f_del_leg_ent_relfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,leg_curDAT*KAKA\\KAsqlcaDelete from rap_legal_entity_relations Where legal_entity_rid =0 ?@KAf_db_error  $ \ `  2 3 nparentridtransbdeletef_del_leg_ent_rel>  DAT*xSSSS x function_objectf_global_replacestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject@aj@)k@@J3@m@A@@M@@a@^@Am @q@}s@@ @ @@ @ DAT*X_@Q)b?JA_@_@y_@+`@`@5j@j@Ck@k@Ol@l@cm@m@o@@@@@@A@@A^@^@qryjtq@q@aine0 f_del_split_factorfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_speciation_split_factors Where profile_code =' ' HK\DAT*zJALJADelete from Rap_speciation_split_factors Where profile_code =' ' =@JAf_db_error L P  2 4 ps_codeptranspb_deletef_del_split_factor=  LSCtransaction.B x function_objectf_del_spDAT*j_@Q)b?JA_@_@z_@+`@`@5j@j@QCk@k@Ol@l@cm@m@o@@@@@@@@^@^@A _ @@@@ f_highlight_buttonfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectrectanglecommandbutton2 5 p_rectanglep_cbp_actionf_highlight_buDAT*^Delete from rap_legal_entity_relationglobal type f_del_leg_ent_rel from function_object end type forward prototypes global function integer f_del_leg_ent_rel (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_leg_ent_rel (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction obDAT*`ject to use, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes all legal entity relations for a given legal entity. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records prDAT*bocessed long nInd = 0 // Return indicator for functions long ll_rid string ls_sql if nParentRid < 0 then nParentRid = -nParentRid ls_sql = 'select legal_entity_rid from rap_legal_entity_relations where ref_rid = ?' else ls_sql = 'select legal_entity_rid from rap_legal_entity_relations where legal_entity_rid = ?' end if // Prepare the cursor declare leg_cur dynamic cursor for sqlsa; prepare sqlsa from :ls_sql using trans; open dynamic leg_cur using :nParentRid; // ProcessDAT*d each record do while trans.sqlcode = 0 fetch leg_cur into :ll_rid; // Process the current record if trans.sqlcode = 0 and bDelete then Delete from rap_legal_entity_relations Where legal_entity_rid = :ll_rid; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 loop // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_leg_ent_rel") nCount = -1 end if close leDAT*`g_cur; f_db_error(trans, 'f_del_leg_ent_rel - Close failed') return nCount end function DAT*h_@W)b?KA_@_@_@-`@`@7j@j@aEk@k@qQl@l@em@m@q@@@@@@q@@^@^@AK q@q@s@s@2  @HS@ f_del_legal_entitiesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,cur_legal_DAT*entitiesKAKAlKAf_del_legal_entity_relationssqlcaDelete from Rap_Legal_Entities Where Rap_Legal_Entities.Rid =0 => KAf_db_error  4 l p   2 6 nparentridtransbdeletef_del_legal_enDAT*ttonI   QCrectangle.Ccommandbutton.S x function_objectf_highlight_buttonstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectrectanglecommandbutton@j@+k@@O5@m@C@@O@@c@^@qojt@q@@n+cDAT*n_@Q)b?JA!_@_@{_@1`@`@;j@j@Ik@k@Ul@l@im@m@u@@@@@@@@A^@^@qryjtq@q@as@s@alo r+o H f_del_speciation_profilefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsaDAT*,cur_calcsJAJAJAmmJAf_del_split_factorf_del_scc_ams_speciation_codef_del_emission_factorDelete from Rap_speciation_profiles Where Rap_speciation_profiles.code =' ' HKlJAf_db_error  , d DAT*_@Q)b?JA_@_@|_@(`@`@2j@j@@k@k@Ll@l@`m@m@l@@|@@@@@@q^@^@aitjnn@n@ro f_highlight_rowfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowf_shift_highlight2 3 dw_objectlast_clicked_rowf_highlightDAT*tFunction to cascade delete associated with RID from rap_legal_entity_relationsglobal type f_del_legal_entities from function_object end type forward prototypes global function integer f_del_legal_entities (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_legal_entities (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of tDAT*vhe record to delete // Trans - The transaction object to use, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // DAT*xReturn indicator for functions long nRid string szSelection // Base the selection on the value of nParentRid if nParentRid < 0 then // nParentRid = -nParentRid // szSelection = "Select Rid from Rap_Legal_Entities where Source_Rid = ?" else szSelection = "Select Rid from Rap_Legal_Entities where Rid = ?" end if // Prepare the cursor DECLARE cur_legal_entities DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMIC cur_legal_entities USING :nParentDAT*zRid; // Process each record DO WHILE Trans.sqlcode = 0 FETCH cur_legal_entities into :nRid; // Process the children if Trans.sqlcode = 0 then nInd = f_del_legal_entity_relations(-nRid, Trans, bDelete) if nInd >= 0 then nCount = nCount + nInd end if end if // Process the current record if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Legal_Entities Where Rap_Legal_Entities.Rid = :nRid; end if // Update the couDAT*dnter if Trans.sqlcode = 0 then nCount = nCount + 1 LOOP // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Legal_Entities") nCount = -1 end if Close cur_legal_entities; f_db_error(Trans, "f_del_Legal_Entities - Close failed") return nCount end function DAT*~_@W)b?KA_@_@_@+`@`@a5j@j@aCk@k@qOl@l@cm@m@o@@@@@@@@^@^@qP q@q@p vLSo0 f_del_legal_entityfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From rap_legal_entities Where DAT*rid =0 56KA4KAsqlcaf_del_leg_ent_relf_del_contactsf_del_activitiesDelete from rap_legal_entities Where rid =0 *+KAf_db_error 4 8  2 3 pl_ridptranspb_deletef_del_legal_entity=  LLCtransactiDAT*_row/  LCdatawindow.L x function_objectf_highlight_rowstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow sc@s_spodncti(st@ure2en@viro@fi@scriLme@eda`il@stvilev@tem|in@ower ns@ono @d@DAT*_@ j@JA_@_@d}_@a&`@`@a0j@j@a>k@k@qJl@l@^m@m@j@@z@@@@@@^@^@aDz q@q@`X]s܉igia  @K0 f_del_sourcesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Rid From RDAT*ap_Sources Where Rid =0 '(JA$JAf_del_group_memberf_del_contactsf_del_location_coordinate_groupsf_del_devicesf_del_activitiesf_del_appf_del_leg_ent_relDelete from Rap_Sources Where Rid =0 #$JAf_db_error $ (  2 / nparentridtransbdeletef_DAT*_@R)b?JA _@_@~_@*`@`@4j@j@Bk@k@aNl@l@bm@m@n@@~@@A@@A@@^@^@J f_increment_arrayfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2 P ps_arraypl_incrementpi_ubf_increment_arrayow D5DAT*Delete from rap_legal_entitiesglobal type f_del_legal_entity from function_object end type forward prototypes global function long f_del_legal_entity (long pl_rid, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_legal_entity (long pl_rid, transaction ptrans, boolean pb_delete);// Function to perform delete on rap_legal_entities tables. // Three arguments are required: // pl_rid - The unique RID of the record to delete // ptrans - The transaction objecDAT*t to use, usually sqlca // pb_delete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes the legal record from // rap_legal_entities table and its children record from tables // rap_contacts, rap_contact_reasons, rap_activities and // rap_legal_entiDAT*ty_relations if any. //////////////////////////////////////////////////////////////////// long ll_cnt = 0 // Number of records processed long ll_ind = 0 // Return indicator for functions if pl_rid < 0 then pl_rid = -pl_rid // Process the current record Select Count(*) into :ll_ind From rap_legal_entities Where rid = :pl_rid USING ptrans; if ptrans.sqlcode = 0 AND ll_ind > 0 then ll_ind = f_del_leg_ent_rel(pl_rid, sqlca, pb_delete) if ll_ind >= 0 then ll_cnt = lDAT*l_cnt + ll_ind ll_ind = f_del_contacts(-pl_rid, sqlca, pb_delete) end if if ll_ind >= 0 then ll_cnt = ll_cnt + ll_ind ll_ind = f_del_activities(-pl_rid, sqlca, pb_delete) end if if ll_ind >= 0 then ll_cnt = ll_cnt + ll_ind end if if ptrans.sqlcode = 0 and pb_delete then Delete from rap_legal_entities Where rid = :pl_rid USING ptrans; end if // Update the counter if ptrans.sqlcode = 0 then ll_cnt = ll_cnt + 1 // Notify the user if something badDAT* happened if ptrans.sqlcode <> 0 then f_db_error(ptrans, "f_del_legal_entities") ll_cnt = -1 end if return ll_cnt end function DAT*_@W)b?KA%_@_@_@5`@`@?j@j@Mk@k@Yl@l@mm@m@y@@@@A@@A@@a^@^@qwijrq@q@actf0 f_del_legal_entity_relationsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_Legal_Entity_Relations Where Legal_Entity_Rid =0 iJKDAT*KA_rTKADelete from Rap_Legal_Entity_Relations Where Legal_Entity_Rid =0 ?@KAf_db_error T X  2 > nparentridtransbdeletef_del_legal_entity_relations>  ILRCtransaction.B x functDAT* *QRS[]LRI x function_objectf_increment_arraystructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject on@ectceruct*ci@ten4ma@ledeBma@ssagNow@dlibt@iewinti@fop~t@acti te@stro @d@ @DAT*_@R)b?JA&_@_@_@6`@`@@j@j@Nk@k@Zl@l@nm@m@z@@@@@@@@^@^@Jq@q@10 f_del_scc_ams_speciation_codefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_scc_ams_speciation_codes Where profile_code =' ' HKDAT*JA_rTJADelete from Rap_scc_ams_speciation_codes Where profile_code =' ' =@JAf_db_error T X  2 ? ps_codeptranspb_deletef_del_scc_ams_speciation_code=  LSCtransaction.B x functDAT*Function to cascade delete associated RID info from rap_legal_entity_relationsglobal type f_del_legal_entity_relations from function_object end type forward prototypes global function int f_del_legal_entity_relations (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function int f_del_legal_entity_relations (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - TheDAT* unique RID of the record to delete // Trans - The transaction object to use, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed longDAT* nInd = 0 // Return indicator for functions if nParentRid < 0 then nParentRid = -nParentRid // Process the current record Select Count(*) into :nInd From Rap_Legal_Entity_Relations Where Legal_Entity_Rid = :nParentRid USING Trans; if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Legal_Entity_Relations Where Legal_Entity_Rid = :nParentRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nInd // Notify the user if sDAT*omething bad happened if Trans.sqlcode <> 0 then f_db_error(Trans, "f_del_Legal_Entity_Relations") nCount = -1 end if return nCount end function DAT*_@V)b?KA)_@_@_@9`@`@Cj@j@Qk@k@]l@l@qm@m@}@@@@A@@A@@A^@^@qryjtq@q@aine0 f_del_legal_entity_relations_recfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_Legal_Entity_Relations Where Legal_Entity_Rid =0 and ReDAT*f_Rid =0 and Code =' ' and Begin_Relation_Date ='2005-01-31' JKYZehn_^KApKADelete from Rap_Legal_Entity_Relations Where Legal_Entity_Rid =0 and Ref_Rid =0 and Code =' ' and Begin_Relation_Date ='2005-01-31' ?@NOZ]wjKAf_db_error^p   j| 2 _ DAT*_@R)b?JA_@_@_@&`@`@0j@j@a>k@k@aJl@l@^m@m@j@@z@@@@@@^@^@qZ n@n@ f_listobjectsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 P dw_argobj_listobj_typebandf_listobjects DAT*DL  %.ICdatawindow.RS[]SS x function_objectf_listobjectsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow&@j@&k@@Z0@m@>@@J@@^@^@jJ@q@z@DAT*_@R)b?JA_@_@_@'`@`@1j@j@?k@k@Kl@l@_m@m@k@@{@@A@@A@@^@^@A q@q@As@s@ @@'@ f_del_ref_codefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,refcode_curDAT*JAJA\JAf_del_ref_activitiesDelete from Rap_reference_codes Where code =' ' ,/JAf_db_error  $ \ `  2 - ps_codetransbdeletef_del_ref_code>  ISRCtrDAT*function to delete selected record from rap_legal_entity_relations table from Legal button on Source screen.global type f_del_legal_entity_relations_rec from function_object end type forward prototypes global function int f_del_legal_entity_relations_rec (long nparentrid, long nrefrid, string szcode, date dbeginreldate, ref transaction trans, boolean bdelete) end prototypes global function int f_del_legal_entity_relations_rec (long nparentrid, long nrefrid, string szcode, date dbeginreldaDAT*te, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the functDAT*ion returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions if nParentRid < 0 then nParentRid = -nParentRid // Process the current record Select Count(*) into :nInd From Rap_Legal_Entity_Relations Where Legal_Entity_Rid = :nParentRid and Ref_Rid = :nRefRid and Code = :szCode and Begin_Relation_Date = :dBeginRelDate USING Trans; if TransDAT*.sqlcode = 0 AND bDelete then Delete from Rap_Legal_Entity_Relations Where Legal_Entity_Rid = :nParentRid and Ref_Rid = :nRefRid and Code = :szCode and Begin_Relation_Date = :dBeginRelDate USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nInd // Notify the user if something bad happened if Trans.sqlcode <> 0 then f_db_error(Trans, "f_del_Legal_Entity_Relations") nCount = -1 end if return nCount DAT* end function DAT*_@V)b?KA)_@_@_@9`@`@aCj@j@AQk@k@]l@l@qm@m@}@@@@@@@@^@^@q q@q@s@s@: o\Ig@ f_del_location_coordinate_groupsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,cur_locgrpDAT*sKAKApopKAf_del_location_coordinatesDelete from rap_location_coordinate_groups Where rap_location_coordinate_groups.Rid =0 =UV KAf_db_error  8 p t  $ 2 B nparentridtransbdeletef_del_DAT*_@R)b?JA_@_@_@"`@`@,j@j@:k@k@Fl@l@Zm@m@f@@v@@@@@@^@^@A n@n@A%`@F@F@Ap@ @ f_look_upfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowstr_lookuppointerw_look_upgs_code_value2 DAT* K pdw_objps_fld_nameps_win_nameps_sql_stmntps_cur_codef_look_upV  (5BCdatawindow.SSSS x function_objectf_look_upstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowstr_lookuppointerw_look_up@ on@ectamecia"st@ure,en@DAT*_@S)b?JA_@_@_@q-`@`@7j@j@Ek@k@Ql@l@em@m@q@@@@@@@@^@^@qryjtq@q@as@s@alo r+o@ f_del_ref_activitiesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareasqlsa,act_curDAT*JAJA `JADelete from Rap_Activities Where reference_code =' ' 14JAf_db_error  ( ` d  2 3 ps_codetransbdeletef_del_ref_activities>  ISRCtransaction.BDAT*_@S)b?JA_@_@_@&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@@@@@A^@^@qryjt"p@`in e3@p+ o@ q@q@r5 f_menu_behavefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectw_mdi_mainm_mainDAT*Delete from rap_location_coordinate_groupsglobal type f_del_location_coordinate_groups from function_object end type forward prototypes global function integer f_del_location_coordinate_groups (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_location_coordinate_groups (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of tDAT*he record to delete // Trans - The transaction object to use, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // DAT*Return indicator for functions long nRid string szSelection // Base the selection on the value of nParentRid if nParentRid < 0 then nParentRid = -nParentRid szSelection = "Select Rid from Rap_Location_Coordinate_Groups " & + "where Ref_Rid = ?" else szSelection = "Select Rid from Rap_Location_Coordinate_Groups " & + "where Rid = ?" end if // Prepare the cursor DECLARE cur_locgrps DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMICDAT* cur_locgrps USING :nParentRid; // Process each record DO WHILE Trans.sqlcode = 0 FETCH cur_locgrps into :nRid; // Process the children if Trans.sqlcode = 0 then nInd = f_del_location_coordinates(nRid, Trans, bDelete) if nInd >= 0 then nCount = nCount + nInd end if end if // Process the current record if Trans.sqlcode = 0 AND bDelete then Delete from rap_location_coordinate_groups Where rap_location_coordinate_groups.Rid DAT*= :nRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 LOOP // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_location_coordinate_groups") nCount = -1 end if Close cur_locgrps; f_db_error(Trans, "f_del_location_coordinate_groups - Close failed") return nCount end function DAT*_@V)b?KA#_@_@t_@a3`@`@a=j@j@qKk@k@Wl@l@km@m@w@@@@A@@A@@^@^@AH q@q@xP0 f_del_location_coordinatesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_Location_Coordinates Where Group_Rid =0 ABDAT* KAHKADelete from Rap_Location_Coordinates Where Group_Rid =0 67KAf_db_error  H L  2 < nparentridtransbdeletef_del_location_coordinates>  ILRCtransaction.B x function_objectf_del_locatDAT*_menugs_databasegs_inifiletransactionsqlcaf_menu_offf_menu_on2 6 statestyle_stateenlarge_statef_menu_behave1 QSSS x function_objectf_menu_behavestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectw_mdi_mainm_main_menutransaction,@qj@&DAT*_@S)b?JA#_@_@D_@#`@`@-j@j@A;k@k@Gl@l@[m@m@g@@w@@@@@@^@^@0 q@q@ KX _w'j=^yQ $ f_del_recsfunction_objectstructuremaiDAT*lrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcaf_del_geo_locsf_del_sourcesf_del_devicesf_del_activitiesf_del_processesf_del_streamsf_del_contactsf_del_contact_reasonsf_del_location_coordinate_groupsf_del_location_coordinatesf_del_connectionsf_del_legal_entityf_del_leg_ent_relf_del_legal_entitiesf_del_process_specific_schedulef_del_materialf_del_formf_del_appf_del_docf_del_doc_lookupDAT*Delete from rap_location_coordinatesglobal type f_del_location_coordinates from function_object end type forward prototypes global function int f_del_location_coordinates (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function int f_del_location_coordinates (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - DAT*The transaction object to use, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions DAT* if nParentRid < 0 then nParentRid = -nParentRid // Process the current record Select Count(*) into :nInd From Rap_Location_Coordinates Where Group_Rid = :nParentRid USING Trans; if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Location_Coordinates Where Group_Rid = :nParentRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nInd // Notify the user if something bad happened if Trans.sqlcode <> 0 then f_db_error(DAT*`Trans, "f_del_Location_Coordinates") nCount = -1 end if return nCount end function DAT*_@V)b?KA_@_@_@'`@`@1j@j@?k@k@Kl@l@_m@m@k@@{@@A@@A@@^@^@qJ q@q@h nH~oI0 f_del_materialfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From rap_materials Where rid =0 01DAT*KA0,KAsqlcaf_del_group_memberf_del_doc_lookupDelete from rap_materials Where rid =0 %&KAf_db_error , 0  2 / pl_ridptranspb_deletef_del_material=  LLCtransaction.B x function_DAT*_@S)b?JA_@_@d_@a#`@`@a-j@j@A;k@k@AGl@l@[m@m@ag@@w@@A@@A@@a^@^@qwijr3@`ct f f_menu_offfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectm_main_menu2  f_menu_off Q x function_DAT*objectf_menu_offstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectm_main_menu le@entiioject#m@ecip-on@mai;ip@maiGat@dowc[ie@mtrgc@ctiowro@ttr co@nate nn@ons l_@ty x @ DAT*_@T)b?KA_@_@_@(`@`@2j@j@@k@k@Ll@l@`m@m@l@@|@@@@@@^@^@4*q@q@s@s@? DG_wkgin_ds@ f_del_processesfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttraDAT*Delete from rap_materials table.global type f_del_material from function_object end type forward prototypes global function long f_del_material (long pl_rid, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_material (long pl_rid, transaction ptrans, boolean pb_delete);// Function to perform delete on rap_materials tables. // Three arguments are required: // pl_rid - The unique RID of the record to delete // ptrans - The transaction object to use, usualDAT*ly sqlca // pb_delete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes the material record with no child // record. //////////////////////////////////////////////////////////////////// long ll_cnt = 0 // Number of records processed long ll_ind =DAT* 0 // Return indicator for functions // Process the current record Select Count(*) into :ll_ind From rap_materials Where rid = :pl_rid USING ptrans; if ptrans.sqlcode = 0 AND pb_delete then ll_ind = f_del_group_member(pl_rid, sqlca, pb_delete) if ll_ind >= 0 then ll_cnt = ll_cnt + ll_ind ll_ind = f_del_doc_lookup(-pl_rid, '', sqlca, pb_delete) if ll_ind >= 0 then ll_cnt = ll_cnt + ll_ind end if if ll_ind >= 0 then Delete from rap_materials Where rid DAT**= :pl_rid USING ptrans; end if end if // Update the counter if ptrans.sqlcode = 0 then ll_cnt = ll_cnt + 1 // Notify the user if something bad happened if ptrans.sqlcode <> 0 then f_db_error(ptrans, "f_del_material") ll_cnt = -1 end if return ll_cnt end function DAT*_@U)b?KA_@_@d_@Q-`@`@Q7j@j@Ek@k@Ql@l@em@m@q@@@@@@A@@A^@^@qryjtq@q@aine0 f_del_method_metricsfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_Method_Metrics Where Protocol_Rid =0 >?DAT*KA@KADelete from Rap_Method_Metrics Where Protocol_Rid =0 34|KAf_db_error @ D  2 6 nparentridtransbdeletef_del_method_metrics>  ILRCtransaction.B x function_objectf_del_method_metricsstructurDAT*nsactiondynamicstagingareasqlsa,process_curJAJA\JAf_del_group_memberf_del_activitiesf_del_streamsf_del_process_specific_schedulef_del_speciation_profilef_del_emission_factorf_del_doc_lookupDelete from Rap_Processes Where Rap_Processes.Rid =0 34`*KAf_db_errorDAT*_@T)b?KA_@_@_@"`@`@,j@j@:k@k@Fl@l@Zm@m@f@@v@@@@@@a^@^@qiej3@`ow e f_menu_onfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectm_main_menu2  f_menu_on Q x function_obDAT*jectf_menu_onstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectm_main_menu pr@s_spedfunc"t@ctur,pi@envi:il@descFil@ageZch@listfre@witevon@pow ra@tion @ @ @ DAT*Delete from rap_method_metricsglobal type f_del_method_metrics from function_object end type forward prototypes global function int f_del_method_metrics (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function int f_del_method_metrics (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The RID of the record to delete // Trans - The transaction object to use, DAT*usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes all contact reasons for a given contact. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 DAT* // Return indicator for functions if nParentRid < 0 then nParentRid = -nParentRid // Process the current record Select Count(*) into :nInd From Rap_Method_Metrics Where Protocol_Rid = :nParentRid USING Trans; if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Method_Metrics Where Protocol_Rid = :nParentRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nInd // Notify the user if something bad happened if Trans.sqlDAT*xcode <> 0 then f_db_error(Trans, "f_del_Method_Metrics") nCount = -1 end if return nCount end function DAT* _@V)b?KA(_@_@_@8`@`@aBj@j@qPk@k@\l@l@pm@m@|@@@@@@@@^@^@q{ q@q@H,S` f_del_process_specific_schedulefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionSelect Count ( *) From Rap_Process_Specific_Schedules Where process_rid =0 kIJscDAT*KAeX KADelete from Rap_Process_Specific_Schedules Where process_rid =0 >?KASelect Count ( *) From Rap_Process_Specific_Schedules Where Rid =0 ABXKAME\KADelete from Rap_Process_Specific_Schedules Where Rid =0 67DAT*_@T)b?KA _@_@T_@!,`@`@A6j@j@ADk@k@APl@l@dm@m@ap@@@@A@@A@@^@^@6* f_oracle_connectionfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2 * pl_error_codef_oracle_connection QL xDAT* function_objectf_oracle_connectionstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject on@ectsture,en@viro6fi@scriDme@edaPil@stvidev@tempin@owerai@nuw ra@tion @ @ DAT*_@U)b?KA _@_@d_@a$`@`@.j@j@<k@k@Hl@l@a\m@m@h@@x@@a@@A@@^@^@" f_msgstringfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2  aa_valuef_msgstring SA x function_objeDAT*ctf_msgstringstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject on@ectonion$ma@cipi.nm@mail<pt@mailHta@owch\ew@trehco@tionxob@tt @@ @ @ @80DAT*Function to delete RID based record from rap_process_specific_schedules from Process Master/Detail Window.global type f_del_process_specific_schedule from function_object end type forward prototypes global function int f_del_process_specific_schedule (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function int f_del_process_specific_schedule (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments aDAT*re // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, usually sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 DAT* // Number of records processed long nInd = 0 // Return indicator for functions // Base the selection on the value of nParentRid if nParentRid < 0 then nParentRid = -nParentRid // Process the current record Select Count(*) into :nInd From Rap_Process_Specific_Schedules Where process_rid = :nParentRid USING Trans; if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Process_Specific_Schedules Where process_rid = :nParentRid USING Trans; eDAT*nd if else // Process the current record Select Count(*) into :nInd From Rap_Process_Specific_Schedules Where Rid = :nParentRid USING Trans; if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Process_Specific_Schedules Where Rid = :nParentRid USING Trans; end if end if // Update the counter if Trans.sqlcode = 0 then nCount = nInd // Notify the user if something bad happened if Trans.sqlcode <> 0 then f_db_error(Trans, "f_del_ProDAT*Ucess_Specific_Schedules") nCount = -1 end if return nCount end function DAT* _@U)b?KA_@_@_@'`@`@1j@j@?k@k@Kl@l@_m@m@k@@{@@q@@A@@A^@^@qryjtq@q@ain eXlorc f_getridfromidfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionsqlcaselect rid from rap_sources where id =' ' &)qDAT*KA,KAselect rid from rap_devices where id =' ' &)hKAKAselect rid from rap_processes where id =' ' (+: KAx@KAselect rid from rap_streams where id =' ' &)DAT*$_@])b?KA _@_@_@&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@A@@A@@^@^@a f_arraystringfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2 @ ncas_stringarrayf_arraystring 4 DAT*:SS[] x function_objectf_arraystringstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject@qj@&k@@P0@m@a>@@J@@^@^@qjjt@n@zp@@ te@stro h@@ @ DAT*(_@])b?LA _@_@_@&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@@@A@@A^@^@qryjt f_arraysearchfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2 T as_comparestringvelas_stringarrayf_arraysearch H&DAT*N (ISS[] x function_objectf_arraysearchstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject on@ectinruct&ci@ten0ma@lede>ma@ssagJow@dli^t@iewijti@fopz@n+c te@stro a@@ es@ DAT*,_@d)b?MA_@_@_@&`@`@0j@j@>k@k@Jl@l@^m@m@j@@z@@@@@@A^@^@qryjtq@q@ainelorp@i @ gf_db_messagefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiongs_error_messagegf_build_fatal_messagew_error_message2DAT* 8 p_transaction_objectp_error_typegf_db_message0  ICtransaction.S x function_objectgf_db_messagestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionw_error_message on@ectatessa&re@lrec0ir@ntm>cr@onmJd@indo^tvDAT*0Delete rap_processes recordglobal type f_del_processes from function_object end type forward prototypes global function integer f_del_processes (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_processes (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, usuDAT*2ally sqlca // bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long nRid string szSelection /DAT*4/ Base the selection on the value of nParentRid if nParentRid < 0 then nParentRid = -nParentRid szSelection = "Select Rid from Rap_Processes where Device_Rid = ?" else szSelection = "Select Rid from Rap_Processes where Rid = ?" end if // Prepare the cursor DECLARE process_cur DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMIC process_cur USING :nParentRid; // Process each record DO WHILE Trans.sqlcode = 0 FETCH process_cur into :nRid; DAT*6 // Process the children if Trans.sqlcode = 0 then nInd = f_del_group_member(nRid, Trans, bDelete) if nInd >= 0 then nCount = nCount + nInd nInd = f_del_Activities(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_Streams(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_process_specific_schedule(-nRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd DAT*8 nInd = f_del_speciation_profile(nRid, '', Trans, bDelete) end if if nInd = 0 then nCount = nCount + nInd nInd = f_del_emission_factor(nRid, '', Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_doc_lookup(-nRid, '', Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd end if end if // Process the current record if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Processes Where Rap_ProcDAT*esses.Rid = :nRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 LOOP // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Processes") nCount = -1 end if Close process_cur; f_db_error(Trans, "f_del_Processes - Close failed") return nCount end function DAT*<_@{m@LA %_@_@d_@a5`@`@q?j@j@Mk@k@qYl@l@qmm@m@y@@@@@@A@@A^@^@qryjt f_array_breakarrayintoblocksfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2  al_blocklimitaa_inarrayraa_outarrayf_array_breakaDAT*Prrayintoblocks0ht6 $<0LLA[]RA[] x function_objectf_array_breakarrayintoblocksstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject on@ectrcruct5ci@ten?ma@ledeMma@ssagYow@dlimt@iewiyDAT*@_@c)b?MA_@_@_@'`@`@1j@j@?k@k@Kl@l@_m@m@k@@{@@a@@a@@A^@^@qryjtro min elor+o f_window_countfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectgi_geo_numgi_source_numgi_device_numgi_process_num2  DAT* win_namef_window_count QS x function_objectf_window_countstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject me@se1gurce'vi@umg1nu@_cur?o_@gl_sKgl@ice__ce@idk@Y{@ @ h@@ @DAT*D_@c)b?LA_@_@d_@a,`@`@a6j@j@Dk@k@Pl@l@dm@m@p@@@@@@@@A^@^@qryjtroms@s@alo r$q@q@a0ea none'@ f_validate_locationfunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectgs_databasedynamicstagingareasqlsa,cursor1DAT*LAtransactionsqlca@LALALALAf_db_error  8 p    2 E p_valuep_columnp_cityp_statep_nationf_validate_locationK DAT*H_@c)b?MA _@_@_@A0`@`@:j@j@Hk@k@Tl@l@hm@m@t@@@@@@@@^@^@ n@n@ f_validate_pro_schedulefunction_objectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow2 / dw_objrow_numf_validate_pro_schedule/ DAT* BCdatawindow.L x function_objectf_validate_pro_schedulestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindow@aaj@0k@@P:@m@H@@T@@h@^@qtjt@ros@@ @q@a n@on Ks@DAT* @ @ @  $68|$6 $6($6-80810-80810-808106  . H b|d- p_transps_dsnps_uidps_pwdls_dbmsdDAT* L x function_objectf_get_sequencestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ect_cctio'e@reci1ro@tma?ri@nmaKda@ndow_vi@emtkm@ecti{er@ctt w@wna cs@ngar es@@ DAT*@j@3k@@K=@m@K@@W@@k@^@qwjt@roq@@ @o @ @ @  ,T,81d@81d806DAT*RDelete records based on name of current data windowglobal type f_del_recs from function_object end type forward prototypes global function long f_del_recs (long nrid, string szname, boolean bdelete) end prototypes global function long f_del_recs (long nrid, string szname, boolean bdelete);long nCnt // Perform the delete based on the current data window if IsNull(nRid) OR nRid = 0 then // MessageBox("Delete", "There is no record to delete") nCnt = 0 else choose case szName DAT*T case "d_geo_loc", "d_geo_member" nCnt = f_del_geo_locs(nRid, sqlca, bDelete) case "d_source", "d_cit_member" nCnt = f_del_sources(nRid, sqlca, bDelete) case "d_device", "d_src_member" nCnt = f_del_devices(nRid, sqlca, bDelete) case "d_activity", "d_activity_freeform" nCnt = f_del_activities(nRid, sqlca, bDelete) case "d_process", "d_dev_member" nCnt = f_del_processes(nRid, sqlca, bDelete) case "d_stream_from", "d_stream_to" nCnt = f_del_streams(nRDAT*Vid, sqlca, bDelete) case "d_contact" nCnt = f_del_contacts(nRid, sqlca, bDelete) case "d_contact_reasons" nCnt = f_del_contact_reasons(nRid, sqlca, bDelete) case "d_loc_coord_group" nCnt = f_del_location_coordinate_groups(nRid, sqlca, bDelete) case "d_loc_coord" nCnt = f_del_location_coordinates(nRid, sqlca, bDelete) case "d_connect_from", "d_connect_to" nCnt = f_del_connections(nRid, sqlca, bDelete) // case "d_cal_protocol" // nCnt = f_del_calDAT*X_protocol(nRid, sqlca, bDelete) // case "d_method_metric" // nCnt = f_del_method_metrics(nRid, sqlca, bDelete) case "d_legal_entity", "d_legal_member" nCnt = f_del_legal_entity(nRid, sqlca, bDelete) case "d_src_leg_ent_rel", "d_src_leg_ent_rel_freeform" nCnt = f_del_leg_ent_rel(nRid, sqlca, bDelete) case "d_legal_entity_types_leg" nCnt = f_del_legal_entities(nRid, sqlca, bDelete) case "d_legal_entity_relations" // NOTE: unable to call function from this level DAT*Zbecause // primary key is not a single field but multiple fields // nCnt = f_del_legal_entity_relations_rec(nRid, sqlca, bDelete) case "d_process_schedules" nCnt = f_del_process_specific_schedule(nRid, sqlca, bDelete) case "d_material_display" nCnt = f_del_material(nRid, sqlca, bDelete) case "d_form", "d_form_freeform" nCnt = f_del_form(nRid, sqlca, bDelete) case "d_application", "d_application_freeform" nCnt = f_del_app(nRid, sqlca, bDelete) case "d_DAT*<doc", "d_doc_freeform" nCnt = f_del_doc(nRid, '', sqlca, bDelete) case "d_doc_lookup" nCnt = f_del_doc_lookup(nRid, '', sqlca, bDelete) case else nCnt = 0 MessageBox("f_del_recs", "Delete not implemented for " & + szName) end choose end if return nCnt end function DAT* @ sub ac@ster de@y @ser_le@ckgco@ )81<$68$z%88z&8<z&@88s0,)88)86.v d- p_winp_dwp_columndwcls_sqlsqlcax DAT*@aHa@@T@@h@^@At @p@n@@ @ h@@ @ @  8)$88,081<8.z%)4988<"8>z%)D988<"!  DAT*mite@nnecyow@ject w@e() e@n @et @nConte@cal  @ $1 6($1 }0$1 68$1 6*@8,@$6 !$"D#h$&dT as_titleDAT* @ @ @ 6808 088 z%68 08z%8 z&8)86L!d) dw_argobjectattributescommandP   !   ,.describejDAT*-@8}1<`-680-11<Y@8--<Y@86&:J\`d sourceseparatorpretP    2  f_get_token2   DAT*on@ectnctur)pi@envi3il@descAil@ageMch@listare@witemon@pow}@ @ @d@ @ @nConte@  :F@@8,P,882z%81<v11<8mDAT*jglobal type f_del_ref_activities from function_object end type forward prototypes global function integer f_del_ref_activities (string ps_code, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_ref_activities (string ps_code, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // ps_code - The attribute of the record to delete // Trans - The transaction object to use, usually sqlca // bDeDAT*llete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed string ls_sql ls_sql = "Select count(Rid) from Rap_Activities where reference_code = ?" // PrepareDAT*n the cursor DECLARE act_cur DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :ls_sql USING Trans; OPEN DYNAMIC act_cur USING :ps_code; FETCH act_cur into :nCount; if trans.sqlcode = 0 and nCount > 0 and bDelete then Delete from Rap_Activities Where reference_code = :ps_code USING Trans; end if // Notify the user if something bad happened if Trans.sqlcode = -1 then f_db_error(Trans, "f_del_ref_Activities") nCount = -1 end if Close act_cur; f_db_error(Trans, "f_delDAT*C_ref_Activities - Close failed") return nCount end function DAT*@o @ @ @nConte@ ,,668080@8,66808,0@8,668001d@8},668901d@8},668B01d@8},668ODAT*JAJA P T  $ (     2 8 pl_geo_loc_ridps_geo_loc_typef_delete_geo_loc$ ILS x function_objectf_delete_geo_locstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectDAT* @o @ @ @ser_le@ckgco@ 8)$81<8,)881<@$68H8nz%@880,)88)860` d$ p_winp_dwdwcls_DAT* ILRCtransaction.B x function_objectf_del_streamsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea@j@&k@@K0@m@>@@J@@^@^@Aj @p@zn@@ @ h@@ DAT*"}<@8}1<<<@8<R@8}B6 BVd< sourcelook_forreplace_withstart_poslen_look_ford   %/ 2  fDAT*$lit_factorstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectepstr+lr@ient5nt@lfilCon@lmesOin@hildcte@eevione@ninfec@n+c te@stro h@@ @ @ DAT*~global type f_del_ref_code from function_object end type forward prototypes global function integer f_del_ref_code (string ps_code, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_ref_code (string ps_code, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // ps_code - The unique key of the record to delete // Trans - The transaction object to use, usually sqlca // bDelete - Set to truDAT*e for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions string szSelection, ls_code szSelection = "Select code from rap_reDAT*ference_codes where code = ?" // Prepare the cursor DECLARE refcode_cur DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMIC refcode_cur USING :ps_code; // Process each record DO WHILE Trans.sqlcode = 0 FETCH refcode_cur into :ls_code; // Process the children if Trans.sqlcode = 0 then nInd = f_del_ref_Activities(ls_code, Trans, bDelete) if nInd >= 0 then nCount = nCount + nInd end if end if // Process the DAT*@current record if Trans.sqlcode = 0 AND bDelete then Delete from Rap_reference_codes Where code = :ls_code USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 LOOP // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_ref_code") nCount = -1 end if Close refcode_Cur; f_db_error(Trans, "f_del_ref_code - Close failed") return nCountDAT*( te@stro @@ @ @ser_le@ 6 8 9}$1#<R$1<R),84<$1 <Y}DL$1 <Y})\808d0h9})x8*zDAT**  lp 2 H pl_parent_ridps_codeptranspb_deletef_del_speciation_profileJ  %LLSCtransaction.B x function_objectf_del_speciation_profilestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea@DAT*4 @ @ 6 )8161:*@l@l8v8&:*@l@l8),89)@89)H8&19)P89)X8 6Rr &dC dw_oDAT*6del_sources>  ILRCtransaction.B x function_objectf_del_sourcesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@j@&k@@L0@m@>@@J@@^@^@ajjn@n@z@rect an@tonDAT* >-<R}--< 80d3 ps_arrayo pl_incrementpi_ub< -t ct- End2  f_increment_array on2  0,DAT*Delete rap_scc_ams_speciation_codes recordglobal type f_del_scc_ams_speciation_code from function_object end type forward prototypes global function long f_del_scc_ams_speciation_code (string ps_code, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_scc_ams_speciation_code (string ps_code, transaction ptrans, boolean pb_delete);// Function to perform cascading delete. Three arguments are // required: // ps_code - The primary key of the record to delete DAT*// ptrans - The transaction object to use, usually sqlca // pb_delete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes all contact reasons for a given contact. long ll_cnt = 0 // Number of records processed long ll_ind = 0 // Return indicator DAT*for functions if IsNull(ps_code) or ps_code = '' then ps_code = '-' + ps_code // Process the current record Select Count(*) into :ll_ind From Rap_scc_ams_speciation_codes Where profile_code = :ps_code USING ptrans; if ptrans.sqlcode = 0 AND pb_delete then Delete from Rap_scc_ams_speciation_codes Where profile_code = :ps_code USING ptrans; end if // Update the counter if ptrans.sqlcode = 0 then ll_cnt = ll_ind // Notify the user if something bad hapDAT*pened if ptrans.sqlcode <> 0 then f_db_error(ptrans, "f_del_scc_ams_speciation_code") ll_cnt = -1 end if return ll_cnt end function DAT*>ion_objectf_del_scc_ams_speciation_codestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionglobin@incry  str6ay@long@en@ef iNub@INTEZnd@li_bner@d(pszi_@ pi_cr@t p _u@ 'En br@ne @et @ DAT*B @ @ @ @ 8)$88,<@8}1<<<<Y@88.z%)4988<"8>z%)D988<"!Z  1<R}- < 6DAT*Fansaction.B x function_objectf_del_ref_codestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea on@ectctruct'ci@ten1ma@lede?ma@ssagKow@dli_t@iewikti@fop{d@indo te@stro h@@ @ @DAT*Lviro:fi@scriFme@edaZil@stvifev@temvin@ower ns@oni ba@ @ @- 10an@Show p@ion en@ )88$@81Yo@o8:F@@846HDAT*R x function_objectf_del_ref_activitiesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea@j@-k@@F7@m@E@@Q@@e@^@Aq @n@`@@ @ @@ @ @- 10DAT*Xk@@Q0@m@>@@J@@^@^@qjjt@q@zs@@ @o h@@ @ @- 10an@Show p@ f",$:U@2,9)08,@$T$d9},1o@o88lt,68o08x0DAT*2 ' nridsznamebdeletef_del_recs1  LLSB x function_objectf_del_recsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectacties#m@ecip-on@mai;ip@maiGat@dowc[ie@mtrgc@ctioDAT*Delete Rap_Sourcesglobal type f_del_sources from function_object end type forward prototypes global function integer f_del_sources (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_sources (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, usually sqlca // DAT*bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions if nParentRid < 0 then nParentRid = -nParentRidDAT* // Do we have a valid rid? Select Rid into :nInd From Rap_Sources Where Rid = :nParentRid USING Trans; // Process the children if Trans.sqlcode = 0 AND nInd > 0 then nInd = f_del_group_member(nParentRid, Trans, bDelete) if nInd >= 0 then nCount = nCount + nInd nInd = f_del_Contacts(-nParentRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_location_coordinate_groups(-nParentRid, Trans, bDelete) endDAT* if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_devices(-nParentRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_Activities(-nParentRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_app(-nParentRid, Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd nInd = f_del_leg_ent_rel(-nParentRid, Trans,DAT* bDelete) end if if nInd >= 0 then nCount = nCount + nInd end if if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Sources Where Rid = :nParentRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Sources") nCount = -1 end if return nCount end function DAT*  7,$ $09},8$H$P9},X$`$|9},$$9},$$9},$$9},$$9}, $ $(9},0$8$@9},H$\$d9},l$t$|9},$$DAT*   $ \ ` `d 2 1 nparentridtransbdeletef_del_processes>  ILRCtransaction.B x function_objectf_del_processesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea on@ectsture(DAT*>6,$ $09},8$H$P9},X$`$|9},$$9},$$9},$$9},$$9}, $$$,9},4$<$D9},L$d$l9},t$|$9},$$DAT*11W!1 1!"1p1W!"1(#1'!"1.12!" d pl_error_codecase19( 2  f_oracle_connection2  DAT*Vo(@(8 d aa_value NULL2  f_msgstring2  DAT*TKAKAf_sqlcheck , 0    :@ x |     2 * as_datalevelas_idf_getridfromid$ LSS x function_objectf_getridfromidstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreevDAT*Zemailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@j@-k@@K7@m@E@@Q@@e@^@qqjt@q@ @X te@stro @ @ @  1DAT* KAf_db_error  X \  X\     2 A nparentridtransbdeletef_del_process_specific_schedule>  ILRCtransaction.B x function_objectf_del_process_specific_schedulestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemDAT*Delete rap_speciation_profiles recordglobal type f_del_speciation_profile from function_object end type forward prototypes global function long f_del_speciation_profile (long pl_parent_rid, string ps_code, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_speciation_profile (long pl_parent_rid, string ps_code, transaction ptrans, boolean pb_delete);// Function to perform cascading delete. Three arguments are // required: // pl_parent_rid - The parent rid DAT*of the record to delete // ps_code - The primary key of the record to delete // ptrans - The transaction object to use, usually sqlca // pb_delete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. long ll_cnt = 0 // Number of records processed long ll_ind = 0 // ReturDAT*n indicator for functions string ls_sel, ls_code // Base the selection on the value of pl_parent_rid or ps_code if pl_parent_rid = 0 then ls_sel = "Select code from Rap_speciation_profiles where code = ?" else ls_sel = "select code from rap_speciation_profiles where process_rid = ?" end if // Prepare the cursor DECLARE cur_calcs DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :ls_sel USING ptrans; if pl_parent_rid = 0 then OPEN DYNAMIC cur_calcs USING :ps_code; else OPEN DYNAMICDAT* cur_calcs USING :pl_parent_rid; end if // Process each record DO WHILE ptrans.sqlcode = 0 FETCH cur_calcs into :ls_code; // Process the children if ptrans.sqlcode = 0 then ll_ind = f_del_split_factor(ls_code, ptrans, pb_delete) if ll_ind >= 0 then ll_cnt = ll_cnt + ll_ind ll_ind = f_del_scc_ams_speciation_code(ls_code, ptrans, pb_delete) if ll_ind >= 0 then ll_cnt = ll_cnt + ll_ind ll_ind = f_del_emission_factor(pl_parent_rid, ls_code, ptrans, pb_deDAT*lete) if ll_ind >= 0 then ll_cnt = ll_cnt + ll_ind end if end if end if end if // Process the current record if ptrans.sqlcode = 0 AND pb_delete then Delete from Rap_speciation_profiles Where Rap_speciation_profiles.code = :ls_code USING ptrans; end if // Update the counter if ptrans.sqlcode = 0 then ll_cnt = ll_cnt + 1 LOOP // Notify the user if something bad happened if pTrans.sqlcode <> 0 AND pTrans.sqlcode <> DAT*100 then f_db_error(ptrans, "f_del_speciation_profile") ll_cnt = -1 end if Close cur_calcs; f_db_error(ptrans, "f_del_speciation_profile - Close failed") return ll_cnt end function DAT*objectf_del_materialstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction(@aj@'k@@\1@m@?@@K@@_@^@qk @q@{@+c @stro @ @ @ DAT*ion_coordinatesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@j@3k@@K=@m@K@@W@@k@^@qw @q@ @n @o @ @ @ DAT*location_coordinate_groups>  ILRCtransaction.B x function_objectf_del_location_coordinate_groupsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea#@aaj@9k@@WC@m@Q@@]@@q@^@A} DAT* nparentridnrefridszcodedbeginreldatetransbdeletef_del_legal_entity_relations_rece " 0 6ILLSYRCtransaction.B x function_objectf_del_legal_entity_relations_recstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ecttioord9uc@maiCDAT*ion_objectf_del_legal_entity_relationsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectl_ty_r5ec@uctu?ip@envMai@edesYai@sagemwc@lisytr@ewitio@opo tr@ctio @ 7s@ @ DAT*Delete rap_speciation_split_factors recordglobal type f_del_split_factor from function_object end type forward prototypes global function long f_del_split_factor (string ps_code, transaction ptrans, boolean pb_delete) end prototypes global function long f_del_split_factor (string ps_code, transaction ptrans, boolean pb_delete);// Function to perform cascading delete. Three arguments are // required: // ps_code - The primary key of the record to delete // ptrans - The transaction objecDAT*t to use, usually sqlca // pb_delete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. // This function deletes all contact reasons for a given contact. long ll_cnt = 0 // Number of records processed long ll_ind = 0 // Return indicator for functions if IsNull(ps_codDAT*e) or ps_code = '' then ps_code = '-' + ps_code // Process the current record Select Count(*) into :ll_ind From Rap_speciation_split_factors Where profile_code = :ps_code USING ptrans; if ptrans.sqlcode = 0 AND pb_delete then Delete from Rap_speciation_split_factors Where profile_code = :ps_code USING ptrans; end if // Update the counter if ptrans.sqlcode = 0 then ll_cnt = ll_ind // Notify the user if something bad happened if ptrans.sqlcode <> 0 theDAT*jn f_db_error(ptrans, "f_del_split_factor") ll_cnt = -1 end if return ll_cnt end function DAT*on.B x function_objectf_del_legal_entitystructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction%@j@+k@@Y5@m@C@@O@@c@^@qojr@q@@opo ct@stro @ @ @ DAT*tities>  ILRCtransaction.B x function_objectf_del_legal_entitiesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea@aj@-k@@O7@m@E@@Q@@e@^@qq @q@ @vDAT*ILRCtransaction.B x function_objectf_del_leg_ent_relstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea@j@*k@@Q4@m@B@@N@@b@^@An @q@~s@@ @ @@ @DAT*KA @ D  >D |   2 3 pl_ridptranspb_deletef_del_group_member=  LLCtransaction.B x function_objectf_del_group_memberstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactionDAT*LLCtransaction.B x function_objectf_del_geo_locsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@j@'k@@O1@m@?@@K@@_@^@k @q@{@ @1 @ @ @DAT*ilfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@j@#k@@K-@m@;@@G@@[@^@Ag @q@w @z @ @@ @ @ h1u(DAT*' 45HKKASelect Count ( *) From Rap_emission_factors Where process_rid =0 ?@\KAKADelete from Rap_emission_factors Where process_rid =0 s45PKAf_db_error  D H  PX   $   DAT*Delete Rap_Streamsglobal type f_del_streams from function_object end type forward prototypes global function integer f_del_streams (long nparentrid, ref transaction trans, boolean bdelete) end prototypes global function integer f_del_streams (long nparentrid, ref transaction trans, boolean bdelete);// Function to perform cascading delete. Three arguments are // required: // nParentRid - The unique RID of the record to delete // Trans - The transaction object to use, usually sqlca // DAT*bDelete - Set to true for delete, FALSE gives only the count // of records that would be deleted. // The function returns the number of records deleted, or -1 if // an error occurs. Check the value of sqlcode to determine the // error when the function returns -1. //////////////////////////////////////////////////////////////////// long nCount = 0 // Number of records processed long nInd = 0 // Return indicator for functions long nRid string szSelection // Base the seleDAT*ction on the value of nParentRid if nParentRid < 0 then nParentRid = -nParentRid szSelection = "Select Rid from Rap_Streams " & + "where From_Process_Rid = ? OR To_Process_Rid = ?" else szSelection = "Select Rid from Rap_Streams " & + "where Rid = ? OR Rid = ?" // Need to have two parms end if // Prepare the cursor DECLARE stream_cur DYNAMIC CURSOR FOR sqlsa; PREPARE sqlsa FROM :szSelection USING Trans; OPEN DYNAMIC stream_cur USING :nParentRid, :nParentRid; // DAT*Process each record DO WHILE Trans.sqlcode = 0 FETCH Stream_Cur into :nRid; // Process the children if Trans.sqlcode = 0 then nInd = f_del_Activities(-nRid, Trans, bDelete) if nInd >= 0 then nCount = nCount + nInd nInd = f_del_doc_lookup(-nRid, '', Trans, bDelete) end if if nInd >= 0 then nCount = nCount + nInd end if // Process the current record if Trans.sqlcode = 0 AND bDelete then Delete from Rap_Streams WhDAT*ere Rap_Streams.Rid = :nRid USING Trans; end if // Update the counter if Trans.sqlcode = 0 then nCount = nCount + 1 LOOP // Notify the user if something bad happened if Trans.sqlcode <> 0 AND Trans.sqlcode <> 100 then f_db_error(Trans, "f_del_Streams") nCount = -1 end if Close Stream_Cur; f_db_error(Trans, "f_del_Streams - Close failed") return nCount end function DAT*LLSCtransaction.B x function_objectf_del_doc_lookupstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea@aaj@)k@@R3@m@A@@M@@a@^@am @q@}@n_ @s - ed@  w@geDAT*8LLSCtransaction.B x function_objectf_del_docstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea@j@"k@@M,@m@:@@F@@Z@^@Af @q@vs@@ @ @@ @DAT*BKAf_db_error  $ \ ` jp 2 / nparentridtransbdeletef_del_devices>  ILRCtransaction.B x function_objectf_del_devicesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea@DAT*NILRCtransaction.B x function_objectf_del_contactsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea  R@rom s e So' ?@ect 1ap@ices? =@K@_@kde@vice{vi@- Cl @ h@@ @DAT*Turemailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectceruct.ci@ten8ma@ledeFma@ssagRow@dlift@iewirti@fopt@acti st@gare @@area @ @  1DAT*tion_objectf_del_connectionsstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@j@*k@@R4@m@B@@N@@b@^@n@q@~@ @o n@on; 4_@ty @ @ DAT* LLRCtransaction.B x function_objectf_del_cal_protocolstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea@aj@+k@@N5@m@C@@O@@c@^@o @q@@os @na DAT* x function_objectf_del_appstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea@j@"k@@O,@m@:@@F@@Z@^@Af @q@vs@@ @ @@ @ @- 10aDAT*Function to check to see whether the type of location selected has a child location.global type f_delete_geo_loc from function_object end type forward prototypes global function int f_delete_geo_loc (long pl_geo_loc_rid, string ps_geo_loc_type) end prototypes global function int f_delete_geo_loc (long pl_geo_loc_rid, string ps_geo_loc_type);// This function is a global function that will // check to see whether the type of location selected // has a child location or group member. // DAT*// Argument(s): val long pt_geo_loc_rid rid of the geographic // location selected // // Return: 0 Yes! it has a child location // 1 No! it does not have a child location // -1 database error SetPointer( Hourglass!) // declare local variable(s) int li_loc_count, li_group_count int li_source_count string ls_type // check to see if the geographic location have a child location Select counDAT* t(rid) into :li_loc_count from rap_geographic_locations where parent_rid = :pl_geo_loc_rid using sqlca ; if f_db_error(SQLCA, "Fail on counting geographic location records on " + & "rap_geographic_locations table. Contact your technical support.") = 1 then return -1 end if // check to see if the geographic location have a group member Select count(child_ref_rid) into :li_group_count from rap_group_members where parent_ref_rid = :pl_geo_loc_rid using sqlca ; if DAT* f_db_error(SQLCA, "Fail on counting group member records on " + & "rap_group_members table. Contact your technical support.") = 1 then return -1 end if //if sqlca.sqlcode <> 0 then //// SQL error // ROLLBACK ; // return (-1) //end if // one or more child location(s)/group member(s) if li_loc_count > 0 or li_group_count > 0 then MessageBox("Geographic Locations", "Can not delete the current " + & "record until its child geo location or group member records are first DAT*deleted.~n" + & "No changes made to database.") // at least one child, can't delete it return (0) else if ps_geo_loc_type = "COUNTY" or & ps_geo_loc_type = "CITY" then Select count(rid) into :li_source_count From rap_sources where (geographic_county_rid = :pl_geo_loc_rid or geographic_incorp_rid = :pl_geo_loc_rid); if f_db_error(SQLCA, "Fail on counting source records on " + & "rap_sources table. Contact your technicalDAT* support.") = 1 then return -1 end if // query successful if li_source_count > 0 then MessageBox("Geographic Locations", "Can not delete the current " + & "record until it source records are first deleted.~n" + & "No changes made to database.") // at least one source, can't delete it return (0) else return (1) end if else return (1) end if end if end function DAT* function_objectf_del_activitiesstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingarea@aqj@)k@@F3@m@A@@M@@a@^@qm c@q@}s@@ @r @+e @@ @- 10an@DAT* @@ @ @ )81>8z%8z&z(8$z&11),981)D8o@o9811:)X8-9)l8:j-1j-9)t8DAT*@iewigti@fopwd@indo te@stro @+e @@ @- 10an@ $1.18z%8z%0$(@(8z(88z&8;z%X$(@(8z(88z&8`z%|$z&88z&8z%DAT* h@@ @ @ 8z%8 z&z&8(z&,58z(8;z&z&8Ez&,58z(8Zz&6 d: ps_activitypldt_frompldt_tols_date_rangesqlcad q \@ & a4@ _ DAT*@ @ 8z%,8z%8 z&z&,,8"z%89z&8Ez&81<99 HRd5 ps_view_nameps_sql_stmntls_sql_stmntsqlcaP  ca ur" vi/@ \ DROP VIEW CDAT*Function to check to see whether the legal entity selected has a child legal entity.global type f_delete_leg_ent from function_object end type forward prototypes global function integer f_delete_leg_ent (long pl_leg_rid) end prototypes global function integer f_delete_leg_ent (long pl_leg_rid);// This function is a global function that will // check to see whether the legal entity selected // has a child legal entity. // // Argument(s): val long pt_leg_rid rid of the legal entity selDAT*ected // // Return: 0 Yes! it has a child legal entity // 1 No! it does not have a child legal entity // -1 database error SetPointer( Hourglass!) // declare local variable(s) int li_leg_count // check to see if the legal entity have a child legal entity Select count(rid) into :li_leg_count from rap_legal_entities where parent_rid = :pl_leg_rid using sqlca ; if f_db_error(SQLCA, "Fail on counting legal entity records on " + & "raDAT*p_legal_entities table. Contact your technical support.") = 1 then return -1 end if // one or more child records if li_leg_count > 0 then MessageBox("Legal Entities", "Can not delete the current " + & "record until its child legal entities are first deleted.~n" + & "No changes made to database.") // at least one child, can't delete it return (0) end if return 1 end function DAT*z @ ra@tion @ @ @- 10an@Show p@ ..:F@@8-|-(|-< |-T|-h |-||-$680808})DAT* @ @ 580)@)8,8d8#z%8-z&8Iz%8Iz&6, @ ` d d> p_transpdt_datetimes_resultls_datetimegs_databased   & 2@K yyyy-mm-dd hh:mDAT*ointertransaction@j@,k@@P6@m@D@@P@@d@^@apji@q@@indo ld@ @ @ @- 10an@  :F@@8,`,882z%81<v1DAT*on @ @ 0  )8 8)88 8@)P8 8X)t8 8|)8 8)8 8)8  8)8 6556666 6 8  DAT**Return the values of a series of datawindow attributesglobal type f_dw_get_attributes from function_object end type forward prototypes global function string f_dw_get_attributes (datawindow dw_arg, string object, string attributes) end prototypes global function string f_dw_get_attributes (datawindow dw_arg, string object, string attributes);//////////////////////////////////////////////////////////////////////// // // Function: F_Dw_Get_Attributes // Purpose: The following functiDAT*,on will return the values of datawindow attributes // by passing a comma separated list of attribute names. // Returned attributes are separated by "~n' characters // // // ARGUMENTS: // dw_arg datawindow control passed by value // object string passed by value // attributes a string passed by value // // Log: // // Who When What //----------------------------------------------------------------------- // Powersoft iniDAT*.tial version // ////////////////////////////////////////////////////////////////////////// string command // make up the command string template // first remove any extraneous spaces attributes = f_global_replace(attributes,' ','') // add a comma to the front of the list as we will do our //replacement process using comma's as a guide attributes = ',' + attributes // now replace all of the commas with the name of the objects we // are getting info for command = f_global_replace(attDAT*~ributes,","," "+object+".") // Now ask for the value and return them return dw_arg.describe(command) end function DAT*mec@info}ct@awin @i n@on @ @ 8z%)98 8z%)$988, 8,!66668)D8)L8#!8T08ZDAT*, @n@z@c@ @ @ @ @ 8z%)98 8z%)$988, 8,!66668)D8)L8#!8T08Zz%DAT*80,8 0d bparm  TrueFalse2  f_boolean_to_string 2  DAT*0 01j1<R}<1@8}1 <1<!1<Y}<1@8}~1<,}1<Yo@o8@8}1<1<Yo@o81<R@8"DAT*4o@opo6@ @I@!a a@@ es@ @- 10an@ v)868 8%"83"8C"8Y"8n"8"$668 08p88"8"8DAT*@}1}48<=z%8z&z'8 z%*6  Bvd> as_stringarray@ li_ili_ubls_arraystringP-$)/  ',2  f_arraystring2 DAT*>Gets a list of datawindow objects and requested attributesglobal type f_dw_get_objects_attrib from function_object end type forward prototypes global function integer f_dw_get_objects_attrib (datawindow dw_arg, ref string obj_list[], string obj_type, string band, string attributes) end prototypes global function integer f_dw_get_objects_attrib (datawindow dw_arg, ref string obj_list[], string obj_type, string band, string attributes);///////////////////////////////////////////////////////DAT*@///////////////// // // Function: F_Dw_Get_Objects_attrib // Purpose: The following function will parse the list of objects // contained in the dataobject associated with a // datawindow control, returning their names into a string // array passed by reference, and returning the number of // names in the array as the return value of the function. // The values of attributes can also be asked for by passing // a comma separated list of attributeDAT*B names. If attributes are // asked for they are returned as part of the array and are // separated from the object name by "~n' characters // // // You can control the objects returned by type and by // band. Specifying an "*" for either type or band means // that you want all occurences of objects across type or // band. For information on valid band and object type // names ( See the PowerBuilder's Advanced Datawindows // DAT*D Manual. ). // // Note: if this function will be used against columns, // all of your columns must have names!! // // Example1: This will return the names of all text objects // in the header band of dw_1 into mylist // (as well as their current text values), // and the number of names returned into obj_num. // // obj_num = f_parse_obj_string(dw_1,mylist, & // "text","header","text") // // Example2:DAT*F This will return the names of all column objects // in dw_1 into mylist (no attributes were asked for) // , and the number of names // returned into obj_num. // // obj_num = f_parse_obj_string(dw_1,mylist, & // "column","*","") // // Example3: This will return the names of all objects in // the summary band of dw_1 into mylist // (no attributes were asked for), and the // number of names returned intoDAT*H obj_num. // // obj_num = f_parse_obj_string(dw_1,mylist, & // "*","summary","") // // Example4: This will return the names of all objects in // dw_1 into mylist (and their x and y values), // and the number of names // returned into obj_num. // // obj_num = f_parse_obj_string(dw_1,mylist, & // "*","*","x,y") // // ARGUMENTS: // dw_arg datawindow control passed by value // obj_list strinDAT*Jg array passed by reference // obj_type a string passed by value // band a string passed by value // attributes a string passed by value // // Log: // // Who When What //----------------------------------------------------------------------- // Powersoft initial version // Powersoft 10/1/93 Added capability to return attributes // ////////////////////////////////////////////////////////////////////////// string obj_string, obj_holder,cDAT*Lommand int obj_count, count = 0,i // Get the list of objects obj_string = Describe(dw_arg,"datawindow.objects") obj_holder = f_get_token(obj_string,'~t') DO WHILE len(obj_holder) > 0 IF (Describe(dw_arg,obj_holder+".type") = obj_type or obj_type = "*") AND & (Describe(dw_arg,obj_holder+".band") = band or band = "*") THEN count++ obj_list[count] = obj_holder END IF obj_holder = f_get_token(obj_string,'~t') LOOP // Now get the attributes , if any if len(attributes) > 0DAT* then for i = 1 to count obj_list[i] = obj_list[i] + '~n'+f_dw_get_attributes(dw_arg,obj_list[i],attributes) next end if Return count end function DAT*B }1<1}X<=N1$ 8 f dK as_comparestringas_stringarray li_indexli_indexcount(P (-P4t= 2  f_arrayseDAT*Dti@fop@wi @es @d@ @  111H11d11- V| VZ- V,Hr!DAT*H{nf@wero te@stro h@@ @ @nd xc@ > 0or@ $7:F@@8$- $r8(0850@89)T818(08\0@8918(08n0@89DAT*X4@B@N@4b@n@~@ @ h@@ @ @nd xc@ > 0or@  8)$88,D18.08008} 8.08708}DAT*XReturns a Measurement Code for a given Unit Codeglobal type f_get_measurement_for_unit from function_object end type forward prototypes global function string f_get_measurement_for_unit (string as_unitCode) end prototypes global function string f_get_measurement_for_unit (string as_unitCode); //Function: f_get_meausrement_for_unit() /* Returns the measurement code for the given unit code. If a measurement code is not found, returns empty string. On error returns NULL. MDY 05DAT*t/26/98 */ long ll_rc string ls_measurementCode SELECT rap_units.meas_code INTO :ls_measurementCode FROM rap_units WHERE rap_units.code = :as_unitCode USING SQLCA; ll_rc = f_sqlCheck(SQLCA) if ll_rc < 0 then setNull(ls_measurementCode) elseif ll_rc = 100 then ls_measurementCode = '' end if return ls_measurementCode end function DAT*wi@chilZit@reevfnn@oninvje@ataw fa@fon @ @ @nd xc@ > 0or@ " 0)88)888@01"l18B08D08}8B08K08}DAT*  $:[@$1j <R9}h 9}($1<09}89}8N Rhd win_obj @8 [@    ( 0 8 2  f_put_scroll_barsDAT* qc_act_data_2HL      0 h l   2  act_valuemetric_codevalue_typematerial_codeunit_codelevel_typesource_codedevice_codeprocess_codestream_codeerr_msgfield_namef_qc_act_data_1 )7ALXdq}BSSSSSSSSSSRDAT* ' ) and ( rap_units_b.code =' ' ) 03NQLA\$LA  < t  $ \ ` 2  level_typesource_codedevice_codeprocess_codestream_codematerial_codeact_valuemetric_codeunit_codeerr_msgf_qc_act_data_2 +8DDAT*dreturns the ODBC data source name, user id, and password (if ODBC connection is currently used)global type f_get_odbc_connection from function_object end type forward prototypes global function string f_get_odbc_connection (transaction p_trans, ref string ps_dsn, ref string ps_uid, ref string ps_pwd) end prototypes global function string f_get_odbc_connection (transaction p_trans, ref string ps_dsn, ref string ps_uid, ref string ps_pwd);// get ODBC data source name, user ID, and password DAT*from the current transaction // object. If the current database connection type is not ODBC, // return blank spaces for function parameters. Return the DBMS type. string ls_dbms ls_dbms = p_trans.dbms if ls_dbms = 'ODBC' then ps_dsn = p_trans.database ps_uid = p_trans.userid ps_pwd = p_trans.dbpass end if if ps_dsn = '' then ps_dsn = ' ' end if if ps_uid = '' then ps_uid = ' ' end if if ps_pwd = '' then ps_pwd = ' ' end if return ls_dbms end function DAT*^ $4 l p       X   2 B lookup_nameact_valuemetric_codeerr_msgf_qc_act_data_3? *BSSSRS x function_objectf_qc_act_data_3structuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransactiondynamicstagingareaDAT*l } @ @s@a @ @ @nd xc@  )81<r68z%80z&84z&@8)t811)88,)8)8,)8)8. lrDAT*p LA0LA  PTl     $ *. 4   0 8 2 0 deviceriddwnamef_retrieve_connections/  QLCdatawindow. x function_objectf_retrieve_connectionsstructuremailreDAT*| s @n@q@@ @ing g@taba e_@ecti @nd xc@ )81<r68z%80z&84z&@81J|85,)8)8.l rd8 win_titledw_objfld_namedw_fld_namDAT* es@ty @ @ ,888z%8z&,8!8&z%8/z&z&8:z&66  4 8 L ~d8 p_transps_datetime_columns_resultgs_databaseP  # ,@= ORACLEnvl( , sysdate )DAT* ^@qsjt@q@@n+c te@stro g@taba e_@ecti @@0@ 8)81<l$$68,8Mz%@8,)86)80fl d, p_winp_dwp_metric_leveldwcsqlcadDAT*tGet the next available sequence number from rid_storage tableglobal type f_get_sequence from function_object end type forward prototypes global function long f_get_sequence () end prototypes global function long f_get_sequence ();// This function gets the current rid from rid_storage table, // increments it by 1 and stores the new number back to database. // The function returns the current rid number if it is successful; // otherwise, it returns -1. // This function is used for all DDAT*vBMS long ridNum if gs_database = 'ORACLE' then select rid_storage_seq.nextval into :ridnum from sys.dual; // If there is a database error (return value = 1), return -1; if f_db_error(SQLCA, "Fail on selecting the next available rid from " + & " rid_storage sequence.~nContact your technical support.") = 1 then return -1 end if elseif gs_database = 'ODBC' then select rid into :ridNum from rid_storage for update of rid; // If there isDAT*x a database error (return value = 1), return -1; if f_db_error(SQLCA, "Fail on selecting the next available rid from " + & "rid_storage table.~nContact your technical support.") = 1 then return -1 end if ridNum = ridNum + 1 update rid_storage set rid = :ridNum; // If there is a database error (return value = 1), rollback the // transaction and return -1; if f_db_error(SQLCA, "Fail on incrementing maximum value of rid in " + & "rid_storage table.~nCoDAT*ntact your technical support.") = 1 then rollback; return -1 end if else messagebox("Error", "f_get_sequence(); could not get next RID. Unknown DBMS.~nContact your technical support.") return -1 end if commit; return ridNum end function DAT* @m@EA@@Q@@e@^@qqjt@p@n@@ @o n@on es@ty @ @ontach@l su @ "  68":)481<<$68Dz%8Xz&8\z&@8  z% 8DAT* @:@1Hwi@.CdaTSL@<hie@mtrtc@ctioro@twi @ h@@ @ @ontach@l su @ 8) 81<l($6808Rz%@818)888)DAT* iewitemtreeviewitemconnectioninfopowerobjectwindowdatawindowtransaction, on@ect_mc_co.ur@ilre8vi@entFsc@ionRe@windfst@itemrte@nnecow@ject ta@owt @@ @ @ontach@l su @ $8"8()DDAT*: s_a.parent_rid (+) = rap_geographic_locations_b.rid " + & // " and rap_geographic_locations_b.parent_rid (+) = rap_geographic_locations_c.rid " + & // " and rap_geographic_locations_c.parent_rid (+) = rap_geographic_locations_d.rid " ls_sql = "SELECT DISTINCT Nation.name " + & "FROM rap_geographic_locations City, " + & " rap_geographic_locations County, " + & " rap_geographic_locations State, " + & " rap_geographic_locations Nation " + & "WHERE DAT*Function to get sql statement of dwglobal type f_get_sql from function_object end type forward prototypes global function string f_get_sql (window p_win, datawindow p_dw, string p_column) end prototypes global function string f_get_sql (window p_win, datawindow p_dw, string p_column);DataWindowChild dwc string ls_sql if p_dw.GetChild(p_column, dwc) = -1 then MessageBox(p_win.Title, "Application Error:~n"+ p_column + " - " + & "Not a DataWindowChild.~nContact your technical supporDAT*t.") return "error" end if dwc.SetTransObject(SQLCA) ls_sql = dwc.Describe("DataWindow.Table.Select") return ls_sql end function DAT*P th_no") dw_obj.ScrollToRow(row_num) return FALSE end if ls_end_month = dw_obj.GetItemString(row_num, "end_month_no") if IsNull(ls_end_month) or ls_end_month = '' then MessageBox("DataWindow Error", "Sorry! End Month is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("end_month_no") dw_obj.ScrollToRow(row_num) return FALSE end if if IsNull(dw_obj.GetItemNumber(row_num, "relative_activity_amt")) then MessageBox("DataWindow Error"DAT* @I@@]@^@aije@p@yn@@ @r @ @ h 8066- 66@8--8"z9 8066- 66@8--8"9 8%066DAT* te@stro h@@ @ @ontach@ $(80:80$:U@j8 0&($:U@800&8$:U@8@0&H$:U@8P0&T$:U@&8P0,668\06DAT* outine DAT*This function opens window w_get_string which prompts the user to enter a string variable. The function passes the current window title, the string length and the string character case to window w_get_string.global type f_get_string from function_object end type forward prototypes global function string f_get_string (string as_title, int ai_max_len, string as_char_case, string as_current_value) end prototypes global function string f_get_string (string as_title, int ai_max_len, string as_DAT*char_case, string as_current_value);/////////////////////////////////////////////////////////////////////////// // // Function: f_get_string // // Purpose: // // This function's primary purpose is to prompt the user for a string. // The function is passed a window title, a numeric value // representing the length of the string the function will be // prompting for, the character case (Upper, Lower, or Any case) and // the current value. // This function will open window w_get_stDAT*ring. // // Scope: public // // Parameters: // as_title : string // ai_max_len : integer // as_char_case : string // as_current_value : string // // Returns : string // // DATE NAME REVISION // ---- ------------------------------------------------------------ // Powersoft Corporation INITIAL VERSION // ////////////////////////////////////////////////////////////////////// str_parms parm parm.string_arg[1] = as_title parm.integer_arg[1] = ai_max_len DAT* parm.string_arg[2] = as_char_case parm.string_arg[3] = as_current_value openwithparm( w_get_string,parm ) return message.stringparm end function DAT*  @ @ d8z%8z&z&,,8089 ( 2 Td2 ps_object_nameps_user_namels_sql2sqlcaP  $ ,@ $ grant select on to grant2 ' f_security_grantgf_db_message(DAT*  @ @ d8z%8z&z&,,8!089 ( 2 Td2 ps_object_nameps_user_namels_sql2sqlcaP  ca ur$ vi,@ ( revoke select on from revoke2 ( f_security_revokegf_db_message(DAT*  end if case "open", "close" if p_transaction_object.sqlcode <> 0 then gs_error_message=gf_build_fatal_message(p_transaction_object) open(w_error_message) end if case "fetch", "select" if p_transaction_object.sqlcode = 100 then return 100 elseif p_transaction_object.sqlcode = -1 then gs_error_message=gf_build_fatal_message(p_transaction_object) open(w_error_message) end if case "insert", "update", "delete" if p_transacDAT*  @ @ @ 9}6%@%88M2)81<~9}8$084z%@8  : n z ~dO dw_objvalval_fldval_amt_fldrow_numlb_rtn_valuels_nullldec_value  ca urDAT*General string parserglobal type f_get_token from function_object end type forward prototypes global function string f_get_token (ref string source, string separator) end prototypes global function string f_get_token (ref string source, string separator);// String Function f_GET_TOKEN (ref string Source, string Separator) // The function Get_Token receive, as arguments, the string from which // the token is to be stripped off, from the left, and the separator // character. If the seDAT*parator character does not appear in the string, // it returns the entire string. Otherwise, it returns the token, not // including the separator character. In either case, the source string // is truncated on the left, by the length of the token and separator // character, if any. int p string ret p = Pos(source, separator) // Get the position of the separator if p = 0 then // if no separator, ret = source // return the whole source string and source = "" // mDAT*ake the original source of zero length else ret = Mid(source, 1, p - 1) // otherwise, return just the token and source = Right(source, Len(source) - p) // strip it & the separator end if return ret end function DAT*  @ @  1,9)8}\/<<9)8N}<<9)$8,:nd6 clicked_rowdw_objectlast_clicked_rowli_idxPDAT* @@K@@_@^@k@@n@{@ @t h@@ @ @  8)(88008A0:)@@8)p8)88)8)898)88"80DAT* ildlistviewitemtreeviewitemconnectioninfopowerobjectdynamicstagingareatransaction on@ect_atruc(ec@nte2m@iled@m@essaLdo@ldl`m@viewlct@nfo|t@wind te@stro @@ @ @ontach@ 8"1"DAT*  8)88$"8%0860:)@@8)X8)h88)|8)898)88$"8%080:)@@8)8)88)8)89DAT*  8)88$"8%0860:)@@8)X8)h88)|8)898)88$"8%080:)@@8)8)88)8)89DAT*  @ 8)88$"8%0860:)@@8)X8)h88)|8)898)88%080:)@@8)8)88)8)8DAT*Gets the toolbar attribute setting information from the application ini fileglobal type f_get_toolbar_profile from function_object end type forward prototypes global subroutine f_get_toolbar_profile (string window_name, window window_parm) end prototypes global subroutine f_get_toolbar_profile (string window_name, window window_parm);string bar_visible, bar_align, bar_showtext int bar_x, bar_y, bar_width, bar_height bar_visible = ProfileString (gs_iniFile,window_name,"toolbarvisible",DAT*& "yes") bar_align = ProfileString (gs_iniFile,window_name,"toolbaralignment",& "top") bar_x = ProfileInt (gs_iniFile,window_name,"toolbarx",& 100) bar_y = ProfileInt (gs_iniFile,window_name,"toolbary",& 100) bar_width = ProfileInt (gs_iniFile,window_name,"toolbarwidth",& 100) bar_height = ProfileInt (gs_iniFile,window_name,"toolbarheight",& 100) if bar_visible = "yes" then window_parm.toolbarvisible = true else window_paDAT*rm.toolbarvisible = false end if if bar_align = "bottom" then window_parm.toolbaralignment = alignatbottom! elseif bar_align = "left" then window_parm.toolbaralignment = alignatleft! elseif bar_align = "right" then window_parm.toolbaralignment = alignatright! elseif bar_align = "top" then window_parm.toolbaralignment = alignattop! elseif bar_align = "floating" then window_parm.toolbaralignment = floating! window_parm.toolbarx = bar_x window_parm.toolbary = bar_y window_parmDAT*C.toolbarwidth = bar_width window_parm.toolbarheight = bar_height end if // For a floating toolbar, set the title of the floating window to // be the same as the title of the frame window. Otherwise, the // title will default to "FrameBar" rapids.toolbarframetitle = window_parm.title + " Bar" end subroutine DAT*  (BSSLLL x function_objectf_validate_locationstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdynamicstagingareatransaction on@ect_l_rel,ct@mail6en@nmenDde@ptioPag@tawidli@ewitpwi@connp@obje do@stroDAT*  @ <8)88$"8%0860:)@@8)X8)h88)|8)898)88$"8%080:)@@8)8)88)8)DAT*   (8)88$"8%0860:)@@8)X8)h88)|8)898)88$"8%080:)@@8)8)88)8)89DAT*$ do@ldl_m@viewkct@nfo{t@wind @i n@on @  68D , 1<Y}8 , 1< , 1<Y},1<Y}8,1<Y},1<Y}8d,1<YDAT**  "68D , 1<R}8 , 1< , 1<R},1<R}8,1<R},1<R}8d,1<R},1<R},1<R}8",1<R},1DAT*Function to get sql statement for value unit code dddwglobal type f_get_unit_sql from function_object end type forward prototypes global function string f_get_unit_sql (window p_win, datawindow p_dw) end prototypes global function string f_get_unit_sql (window p_win, datawindow p_dw);DataWindowChild dwc string ls_sql if p_dw.GetChild("value_unit_code", dwc) = -1 then if p_dw.GetChild("unit_code", dwc) = -1 then MessageBox(p_win.Title, "Application Error:~nValue Unit Code - " +DAT* & "Not a DataWindowChild.~nContact your technical support.") return "error" end if end if dwc.SetTransObject(SQLCA) ls_sql = dwc.Describe("DataWindow.Table.Select") return ls_sql end function DAT*. 8z%8 "#Hz%6A@A81<8 z%8z&:)@@899  4 Hvd< pi_file_numps_fileps_headerps_textls_write_lined  & a. ( Error writing to thDAT*0 @ 8$z%8z&$$z&8,z&8$z&8@z&L$z&8Tz&\$z&8dz&p$z&8xz&$z&8z&$(@(8z(8z&$(@(8z(8z&$(@(8z(8z&$z&8z&$z&6DAT*4 @temjem@nectzwe@ect n@stro h@@ @ @ontach@ 1688"8"8#"0$18@888z@$1vH$1<8P08a0:DAT*P    % 3 ODBC    ( 2  f_get_odbc_connection 2  %8DAT*Performs a search and repalce on all occureances within a stringglobal type f_global_replace from function_object end type forward prototypes global function string f_global_replace (string source, string look_for, string replace_with) end prototypes global function string f_global_replace (string source, string look_for, string replace_with);/* A String Occurrence Search and Replace Routine The following code demonstrates a string occurrence search and replace routine. This routinDAT*e works generically for any string. For example, if old_str = "red" and new_str = "green", all occurrences of "red" inside of mystring will be replaced with "green". */ int start_pos=1,len_look_for len_look_for = len(look_for) //find the first occurrence of look_for ... start_pos = Pos(source,look_for,start_pos) //only enter the loop if you find whats in look_for DO WHILE start_pos > 0 //replace look_for with replace_with ... source = Replace(source,start_pos,Len_look_for,repDAT*lace_with) //find the next occurrence of look_for start_pos = Pos(source,look_for,start_pos+Len(replace_with)) LOOP return source end function DAT*, 8l,8,88>z%81<h1x, 8uD,,88zz%81<11R, D,88zz%81<@,1x8080@81,  &\h"%DAT*)+.,4/@1D2l6x8~d! ridnumgs_databasesqlca< @@ 9 ORACLEFail on selecting the next available rid from rid_storage sequence. Contact your technical support.ODBCrid_storage table. Contact your technical support.Fail on incrementing maximum value of rid in Errorf_get_sequence(); could not get next RID. Unknown DBMS. Contact your technical support.2 " f_get_sequeDAT*ncef_db_errorP2  DAT*w4D`td3 as_unitcodell_rcls_measurementcodesqlcaP  caur vi-@ 2 . f_get_measurement_for_unitf_sqlcheck(#2  DAT*Function to put the green focus around the button when the button is clickedglobal type f_highlight_button from function_object end type forward prototypes global subroutine f_highlight_button (rectangle p_rectangle, commandbutton p_cb, string p_action) end prototypes global subroutine f_highlight_button (rectangle p_rectangle, commandbutton p_cb, string p_action);if p_action = "on" then p_cb.Enabled = FALSE p_rectangle.Resize(p_cb.Width + 35, p_cb.Height + 25) p_rectangle.X = p_DAT*cb.X - 10 p_rectangle.Y = p_cb.Y - 10 p_rectangle.Show() elseif p_action = "off" then p_cb.Enabled = TRUE p_rectangle.hide() end if end subroutine DAT* ca ur vi sc e'@ getchildoo Application Error: - Not a DataWindowChild. Contact your technical support.errorsettransobjectyDataWindow.Table.Selectdescribe    2  f_get_sql2  ,DAT*- < 68,08L1 1}p   - < - <=8Lz%- <=668z(f MN OLP`RSU V8Y<ZP[~\^dm dw_argobj_list obj_typebandattributesobj_stringobj_holdercommandobj_countcounti -$DAT* - 2 = H S [ekN datawindow.objectsDescribej .typej*.bandj $ 4 D 2 @ f_dw_get_objects_attribf_get_tokenf_dw_get_attributesP ca ur vi,2  >DDAT* DAT*Function serves as the controlling event for all of the types of highlighting that will be doneglobal type f_highlight_row from function_object end type forward prototypes global function long f_highlight_row (datawindow dw_object, long last_clicked_row) end prototypes global function long f_highlight_row (datawindow dw_object, long last_clicked_row);// Purpose: This function will be the controlling event for all of the // types of highlighting that will be done long ll_clicked_DAT*row string ls_key_down_type // First make sure the user clicked on a row. Clicking on whitespace or // in the header will return a clicked row value of 0. If that occurs, // just leave dw_object event. ll_clicked_row = dw_object.GetclickedRow() if ll_clicked_row = 0 then return 0 // If shift key is pressed if KeyDown(KeyShift!) then f_shift_highlight(ll_clicked_row, dw_object, last_clicked_row) // If control key is pressed elseif KeyDown(KeyControl!) then // If the clicked roDAT*w has been selected, deselect it; // otherwise, highlight the new selected row if dw_object.IsSelected(ll_clicked_row) then dw_object.SelectRow(ll_clicked_row, FALSE) else dw_object.SelectRow(ll_clicked_row, TRUE) end if // Otherwise, deselect all rows, then select the clicked row else dw_object.SelectRow(0, FALSE) dw_object.SelectRow(ll_clicked_row, TRUE) end if return ll_clicked_row end function DAT*ai_max_lenas_char_caseas_current_valueparmw_get_stringmessage  ) : @?@ L@H( string_arginteger_arg ( 0 8 @ 2  f_get_string R2  :8DAT* 2 - f_dw_get_attributesf_global_replace<2  !,DAT*DAT*increment unbounded arraysglobal type f_increment_array from function_object end type forward prototypes global subroutine f_increment_array (ref string ps_array[], long pl_increment, ref integer pi_ub) end prototypes global subroutine f_increment_array (ref string ps_array[], long pl_increment, ref integer pi_ub);//INTEGER li_bound //li_bound = UpperBound(ps_array) pi_ub = pi_ub + pl_increment ps_array[pi_ub] = 'End' end subroutine DAT*08|8z%8z&@811 "0f v"&*d& pl_leg_ridli_leg_countsqlca< @ Fail on counting legal entity records on rap_legal_entities table. Contact your technical support.Legal EntitiesCan not delete the current record until its child legal entities are first deleted. No changes made to database.2 $DAT* f_delete_leg_entf_db_error(2  DAT*01d@8}8`9}h9}8px:U@8:U@8H:U@8,x:U@8:U@}}}},$8z%>| 6DAT*t,D\t !"#)dv window_namewindow_parmbar_visiblebar_alignbar_showtextbar_xbar_ybar_widthbar_heightgs_inifilerapids  , 86 1C1IO%Yd@o@ h toolbarvisibleyestoolbaralignmenttoptoolbarxtoolbarDAT*ytoolbarwidthtoolbarheightbottomU@left,U@right8U@U@floatingU@ !"#toolbarframetitlero  Bar` h x           2  f_get_toolbar_profile2  DAT*Function to store all objects in one report band into an arrayglobal type f_listobjects from function_object end type forward prototypes global function integer f_listobjects (datawindow dw_arg, ref string obj_list[], string obj_type, string band) end prototypes global function integer f_listobjects (datawindow dw_arg, ref string obj_list[], string obj_type, string band);//ARGUMENTS: // dw_arg (the datawindow control passed by value) // obj_list (a string array passed by reference) DAT* // obj_type (a string passed by value) // band (a string passed by value) string obj_string, obj_holder int obj_count, start_pos=1, tab_pos, count = 0 obj_string = dw_arg.Describe("datawindow.objects") tab_pos = Pos(obj_string,"~t",start_pos) DO WHILE tab_pos > 0 obj_holder = Mid(obj_string,start_pos,(tab_pos - start_pos)) IF (dw_arg.Describe(obj_holder+".type") = obj_type or obj_type = "*") & AND (dw_arg.Describe(obj_holder+".band") = band or band = "*") THEN cDAT*ount = count + 1 obj_list[count] = obj_holder END IF start_pos = tab_pos + 1 tab_pos = Pos(obj_string,"~t",start_pos) LOOP obj_holder = Mid(obj_string,start_pos,Len(obj_string)) IF (dw_arg.Describe(obj_holder+".type") = obj_type or obj_type = "*") AND & (dw_arg.Describe(obj_holder+".band") = band or band = "*") THEN count = count + 1 obj_list[count] = obj_holder END IF Return count end function DAT*pointertransaction@j@)k@@R3@m@A@@M@@a@^@qm @p@}@ @!o @ @ @nConte@ T:F@@8,T,889z%81<v1DAT* ,(,8z8z%81<11<1<"D8088z%8_z&@81N8|8">, ,88z%81<11<*8088z%8_z&@81:1N1 "0 DAT* f&v(z)~+-79=0?@ADEjGnHrJLPQUV&W*Y:Z>da pl_geo_loc_ridps_geo_loc_typeli_loc_countli_group_countli_source_countls_typesqlca '4CS [@  Fail on counting geographic location records on rap_geographic_locations table. Contact your technical support.Fail on counting group memberDAT* records on rap_group_members table. Contact your technical support.Geographic LocationsCan not delete the current record until its child geo location or group member records are first deleted. No changes made to database.COUNTYCITYFail on counting source records on rap_sources table. Contact your technical support.record until it source records are first deleted. 2 $ f_delete_geo_locf_db_errorPDAT*X2  ' DAT*sqlsqlcad  ca ur vi sc@( value_unit_codegetchildic ounit_coden o Application Error: Value Unit Code - Not a DataWindowChild. Contact your technical support.errorsettransobjectDataWindow.Table.Selectdescribe$ 8 @   2  f_get_unit_sql2   DAT*Calls w_look_up window with parameterglobal type f_look_up from function_object end type forward prototypes global function boolean f_look_up (datawindow pdw_obj, string ps_fld_name, string ps_win_name, string ps_sql_stmnt, string ps_cur_code) end prototypes global function boolean f_look_up (datawindow pdw_obj, string ps_fld_name, string ps_win_name, string ps_sql_stmnt, string ps_cur_code);string ls_obj_name_str, ls_obj_name str_lookup lstr_lookup long ll_pos_num ls_obj_name_str = DAT*pdw_obj.GetObjectAtPointer() ls_obj_name = Left(ls_obj_name_str, Pos(ls_obj_name_str, "~t") - 1) SetPointer(HourGlass!) if ls_obj_name = ps_fld_name then // Assign SQL statement for the code lookup to the structure variable lstr_lookup.sqlStatement = ps_sql_stmnt // Assign window title to be display in the look up window to the // structure variable lstr_lookup.winTitle = ps_win_name // Assign current code to be display on the edit box of the lookup window lstr_lookup.cDAT*urrent_code = ps_cur_code // Open the look up window with parameters OpenWithParm(w_look_up, lstr_lookup) if Not (IsNull(gs_code_value) or gs_code_value = '') then ll_pos_num = Pos(ls_obj_name, "_t") if ll_pos_num > 0 then ls_obj_name = Left(ls_obj_name, ll_pos_num - 1) end if pdw_obj.SetItem(pdw_obj.GetRow(), ls_obj_name, gs_code_value) return TRUE end if end if return FALSE end function DAT*#DAT*@ @ue U "@ x1:u88%z%R88Vz%,-,$-p$1, `-x$1nu8<1LRu80-81nR-DAT*$1!- -$11R~-$1-$1d!2-8081,-8086:R` ~!$%&'(*L.n0157:;<$?2@BBddP nparentridtransbdeletencountnindnridszselectionsqlsastream_cur ca DAT* urvi!sc(e-st2 te>@ owD>0 Select Rid from Rap_Streams where From_Process_Rid = ? OR To_Process_Rid = ?where Rid = ? OR Rid = ?zf_del_Streamsf_del_Streams - Close failedp x     2 C f_del_streamsf_del_activitiesf_del_doc_lookupf_db_errord DAT*caur'vi8sc82  !,DAT*n_global_replace on2  %,DAT*& 8"28 z%P $1!x $1$18$08126:Hhlx!"#&d/ ps_codeptranspb_deletell_cntll_indd  !(7 -DAT*f_del_split_factor   2 & f_del_split_factorf_db_error(2  !,DAT* d" p_rectanglep_cbp_action<   X onresize$ show1Toffhide@AAp   , 4 < D L \ h x 2  f_highlight_button2  ",DAT*,j@1k@@O;@m@I@@U@@i@^@Au @@@@ @ h@@ @ @- 10an@  1&8088@0,1t ,, ,d$1& DAT*., $1681R681R681R$1! p$1"1R$1$1d!8081 ,80DAT*08"&8FVpt!"%&'()(*R+b,t-.578<>"A&BXCzFGId] pl_parent_ridps_codeptranspb_deletell_cntll_indls_sells_codesqlsacur_calcs \ en%de/ag6li= wiD pL@ doR>0 Select code fDAT*2rom Rap_speciation_profiles where code = ?select code from rap_speciation_profiles where process_rid = ?f_del_speciation_profilef_del_speciation_profile - Close failed      2 s f_del_speciation_profilef_del_split_factorf_del_scc_ams_speciation_codef_del_emission_factorf_db_errorx!4RhDAT*_h2  /8DAT*bjectlast_clicked_rowll_clicked_rowls_key_down_typeP e#ro2 `0 getclickedrowonisselectedt) selectrowam@4@4@4@4 , @ H P X 2 * f_highlight_rowf_shift_highlight( onects2  # DAT*8 h@@ @ @ H!1u-(-$11!t-81Ru8<1Ru8<1lRu8<DAT*:1Ru8<1Ru-81RRu8<1tR-$1!- -$11R- $1-($1d!4-80081"&4\DAT*<!".#@%l&|')*+-./&1R3t56:=>?&B4d- nparentridtransbdeletencountnindd ca urvi!sc(>( f_del_Sources    ( 2 f_del_sourcesf_del_group_memberf_del_contactsf_del_location_coordinate_groupsf_del_devicesf_delDAT*1_activitiesf_del_appf_del_leg_ent_relf_db_error)8Yilagegchlistxre2  !,DAT*@ 8"28 z%X $1!x $1$18$08126:Hhlx!"#&d/ ps_codeptranspb_deletell_cntll_indd  cten!de(B DAT* -f_del_scc_ams_speciation_code   2 1 f_del_scc_ams_speciation_codef_db_error( t&2  !,DAT*D1<R}8,<@8}P<@88.z%)L988<"8>z%)T988<"!  1<R}- < 6  Pd">Zv^zdj dw_argobj_list obj_typebandobj_stringobj_holderobj_countstart_postab_poDAT*scount -$ - 2 = 4HR\d\( datawindow.objectsdescribej .typej*.bandjjj$ 4 D L T 2  f_listobjects2  38DAT*H- 10an@ 80,-,$-<$1:, `-D$168<1R-L$1!- -T$161R:-\$1-d$1d!-8l08DAT*J1,-8{08 :Tn#%&*,6/:0l1457dQ ps_codetransbdeletencountnindszselectionls_codesqlsarefcode_cur  ende%ag* li6 wi>@ pD>0 Select code from rap_reference_codes where cDAT*zode = ?f_del_ref_codef_del_ref_code - Close failed< D L T \ d 2 7 f_del_ref_codef_del_ref_activitiesf_db_errorP,,2  ,DAT*N6`6*@8,,8h"#8i@81v1Yo@o8)t8,6)899\ v <Lv#d pdw_objps_fld_nameps_win_nameps_sql_stmntps_cur_codels_obj_name_strls_obj_namelstr_lookupll_pos_numw_look_upgs_code_valueDAT*P   en( de5 agA liQ wi] pidot@io~@0 getobjectatpointert sqlstatement&wintitle <current_codeP_tgetrow lsetitemP| 4 H ` t  2  f_look_up on2  ADDAT*#DAT*Tan@ " 80,-,(, d-H$11!!- -P$1-8X081,-8m08 :T"#%d; ps_codetransbdeletencountls_sqlsqlsaacDAT*Vt_cur  % ,@ @2> Select count(Rid) from Rap_Activities where reference_code = ?f_del_ref_Activitiesf_del_ref_Activities - Close failedH P 2 ( f_del_ref_activitiesf_db_error<2  ,DAT* DAT*Z80@88*80,68o08x06@8,$t,$$9} 68 |$,$$9},$$9},$$4$<9},D$X$`9},h$|$9},$$9DAT*\},$$9},$$9},$$ 9},($<$D9},T$l$t9}."8| $,$$9},$$9}."8 8 "$88",$$9},$$DAT*^9},$,$49},<$D$L9},T$h$p9},x$$9},$$9},$$9}."8 *$,$$9},$ $9},$$$,9},4$<$D9},L$DAT*`T$\9},d$l$t9},|$$9},$$9}."8 n $,$$9},$$9},$$9},$ $(9},0$@$H9},P$X$`9},h$x$9},$DAT*b$9},$$9},$$9},$$9},$$9}, $4$<9},D$L$T9},\$p$x9},$$9},$$9},$$9},$$9},$DAT*d$9},$$9},$$ 9},($0$89},@$H$P9},X$`$h9}."8p  $,x$$9},$$9},$$9},$$9},$$9},DAT*f$$9},$$9}, $($09},8$@$H9},P$X$`9},h$p$x9},$$9},$$9}."8 8 "8 "$88",$$9},$DAT*h$9},$ $ 9}, $ $$ 9},, $4 $< 9},D $L $T 9}8\ ,d $l $t 9},| $ $ 9}, $ $ 9}, $ $ 9}."8  $$88" , $ $ DAT*j9}, $ $ 9}, $ $ 9}, $ $( 9},0 $8 $@ 9},H $P $X 9},` $h $p 9}8\ ,x $ $ 9}, $ $ 9} , $ $ 9}, $ $ 9}."8  8  "8  DAT*"8  " $88", $ $ 9}, $$ $, 9}R,4 $< $D 9},L $T $\ 9},d $l $t 9},| $ $ 9}, $ $ 9}, $ $ 9}."8   $88"DAT*nChanges menu behavior (visible, enable...)global type f_menu_behave from function_object end type forward prototypes global subroutine f_menu_behave (string state, string style_state, string enlarge_state) end prototypes global subroutine f_menu_behave (string state, string style_state, string enlarge_state);// This function changes the menu items and toolbar items behavior string ls_master_user // Floating toolbar will cause a window USER.EXE stack fault error when // the setredraDAT*pw to true is executed. So, the temporary fix is not to // setredraw when the toolbar is floating style. 6/30/94 swj if w_mdi_main.toolbaralignment <> floating! then w_mdi_main.SetRedraw(FALSE) end if // Added for security for Oracle and RAPIDS m_main_menu.m_file.m_security.enabled = False if upper(left(gs_database,2))='OR' then ls_master_user = ProfileString(gs_iniFile, 'security', 'master_user', & 'not found') if ls_master_user = 'not found' then // Do this in case thatDAT*r rapids.ini does not have this key ls_master_user = 'RAPIDS' SetProfileString(gs_iniFile, 'security', 'master_user', ls_master_user) end if if upper(sqlca.logid) = ls_master_user then m_main_menu.m_file.m_security.enabled = True end if end if choose case state case 'base' f_menu_off() m_main_menu.m_file.m_print.ToolbarItemVisible = TRUE //m_main_menu.m_file.m_rms.ToolbarItemVisible = TRUE m_main_menu.m_data.m_geographic.ToolbarItemVisible = TRUE m_maiDAT*tn_menu.m_data.m_legal.ToolbarItemVisible = TRUE m_main_menu.m_data.m_source.ToolbarItemVisible = TRUE m_main_menu.m_data.m_device.ToolbarItemVisible = TRUE m_main_menu.m_data.m_process.ToolbarItemVisible = TRUE m_main_menu.m_data.m_stream.ToolbarItemVisible = TRUE m_main_menu.m_data.m_material.ToolbarItemVisible = TRUE m_main_menu.m_data.m_emissionestimation.ToolbarItemVisible = TRUE m_main_menu.m_data.m_reference.ToolbarItemVisible = TRUE m_main_menu.m_help.m_usingrapids.TDAT*voolbarItemVisible = TRUE case 'er' f_menu_off() m_main_menu.m_file.m_print.ToolbarItemVisible = TRUE //m_main_menu.m_file.m_rms.ToolbarItemVisible = TRUE m_main_menu.m_help.m_usingrapids.ToolbarItemVisible = TRUE case 'master/detail', 'single' f_menu_on() if style_state = '' or style_state = 'list' then m_main_menu.m_view.m_tabular.Checked = TRUE m_main_menu.m_view.m_tabular.ToolbarItemVisible = FALSE else m_main_menu.m_view.m_freeform.Checked = TRUE DAT*xm_main_menu.m_view.m_freeform.ToolbarItemVisible = FALSE end if m_main_menu.m_view.m_current.Enabled = FALSE m_main_menu.m_view.m_history.Enabled = FALSE m_main_menu.m_view.m_expand.Enabled = FALSE m_main_menu.m_view.m_original.Enabled = FALSE case 'master' f_menu_on() m_main_menu.m_view.m_freeform.Enabled = FALSE m_main_menu.m_view.m_freeform.ToolbarItemVisible = FALSE m_main_menu.m_view.m_tabular.Enabled = FALSE m_main_menu.m_view.m_tabular.ToolbarItemVisible =DAT*z FALSE m_main_menu.m_view.m_current.Enabled = FALSE m_main_menu.m_view.m_history.Enabled = FALSE m_main_menu.m_view.m_expand.Enabled = FALSE m_main_menu.m_view.m_original.Enabled = FALSE case 'connection' f_menu_on() m_main_menu.m_edit.m_undo.Enabled = FALSE m_main_menu.m_edit.m_undo.ToolbarItemVisible = FALSE m_main_menu.m_edit.m_cut.Enabled = FALSE m_main_menu.m_edit.m_cut.ToolbarItemVisible = FALSE m_main_menu.m_edit.m_copy.Enabled = FALSE m_main_menu.m_ediDAT*|t.m_copy.ToolbarItemVisible = FALSE m_main_menu.m_edit.m_paste.Enabled = FALSE m_main_menu.m_edit.m_paste.ToolbarItemVisible = FALSE m_main_menu.m_edit.m_copyrecord.Enabled = FALSE m_main_menu.m_edit.m_copyrecord.ToolbarItemVisible = FALSE m_main_menu.m_edit.m_pasterecord.Enabled = FALSE m_main_menu.m_edit.m_pasterecord.ToolbarItemVisible = FALSE m_main_menu.m_view.m_filter.Enabled = FALSE m_main_menu.m_view.m_filter.ToolbarItemVisible = FALSE m_main_menu.m_view.m_showalDAT*~l.Enabled = FALSE m_main_menu.m_view.m_showall.ToolbarItemVisible = FALSE m_main_menu.m_view.m_freeform.Enabled = FALSE m_main_menu.m_view.m_freeform.ToolbarItemVisible = FALSE m_main_menu.m_view.m_tabular.Enabled = FALSE m_main_menu.m_view.m_tabular.ToolbarItemVisible = FALSE m_main_menu.m_view.m_tabular.Checked = TRUE m_main_menu.m_view.m_current.Enabled = FALSE m_main_menu.m_view.m_history.Enabled = FALSE m_main_menu.m_view.m_expand.Enabled = FALSE m_main_menu.m_viDAT*ew.m_original.Enabled = FALSE case 'stream' f_menu_on() m_main_menu.m_view.m_filter.Enabled = FALSE m_main_menu.m_view.m_filter.ToolbarItemVisible = FALSE m_main_menu.m_view.m_showall.Enabled = FALSE m_main_menu.m_view.m_showall.ToolbarItemVisible = FALSE m_main_menu.m_view.m_freeform.Enabled = FALSE m_main_menu.m_view.m_freeform.ToolbarItemVisible = FALSE m_main_menu.m_view.m_tabular.Enabled = FALSE m_main_menu.m_view.m_tabular.ToolbarItemVisible = FALSE m_main_DAT*menu.m_view.m_tabular.Checked = TRUE m_main_menu.m_view.m_current.Enabled = FALSE m_main_menu.m_view.m_history.Enabled = FALSE m_main_menu.m_view.m_expand.Enabled = FALSE m_main_menu.m_view.m_original.Enabled = FALSE case 'member', 'legal', 'application' f_menu_on() if style_state = '' or style_state = 'list' then m_main_menu.m_view.m_tabular.Checked = TRUE m_main_menu.m_view.m_tabular.ToolbarItemVisible = FALSE else m_main_menu.m_view.m_freeform.Checked = TRUDAT*E m_main_menu.m_view.m_freeform.ToolbarItemVisible = FALSE end if m_main_menu.m_view.m_current.Enabled = FALSE m_main_menu.m_view.m_history.Enabled = FALSE if enlarge_state = 'detail' then m_main_menu.m_view.m_expand.Checked = TRUE m_main_menu.m_view.m_original.ToolbarItemVisible = TRUE else m_main_menu.m_view.m_original.Checked = TRUE m_main_menu.m_view.m_original.ToolbarItemVisible = FALSE end if case 'schedule' f_menu_on() if style_state = '' or DAT*style_state = 'list' then m_main_menu.m_view.m_tabular.Checked = TRUE m_main_menu.m_view.m_tabular.ToolbarItemVisible = FALSE m_main_menu.m_view.m_freeform.Checked = FALSE m_main_menu.m_view.m_freeform.Enabled = FALSE m_main_menu.m_view.m_freeform.ToolbarItemVisible = FALSE end if m_main_menu.m_view.m_current.Enabled = FALSE m_main_menu.m_view.m_history.Enabled = FALSE if enlarge_state = 'detail' then m_main_menu.m_view.m_expand.Checked = TRUE m_main_menu.m_DAT*view.m_original.ToolbarItemVisible = TRUE else m_main_menu.m_view.m_original.Checked = TRUE m_main_menu.m_view.m_original.ToolbarItemVisible = FALSE end if case 'geo member', 'leg member', 'leg source', 'leg form' f_menu_on() if style_state = '' or style_state = 'list' then m_main_menu.m_view.m_tabular.Checked = TRUE m_main_menu.m_view.m_tabular.ToolbarItemVisible = FALSE else m_main_menu.m_view.m_freeform.Checked = TRUE m_main_menu.m_view.m_freeform.TooDAT*lbarItemVisible = FALSE end if m_main_menu.m_view.m_current.Enabled = FALSE m_main_menu.m_view.m_history.Enabled = FALSE m_main_menu.m_view.m_expand.Enabled = FALSE m_main_menu.m_view.m_original.Enabled = FALSE case 'activity' f_menu_on() if style_state = '' or style_state = 'list' then m_main_menu.m_view.m_tabular.Checked = TRUE m_main_menu.m_view.m_tabular.ToolbarItemVisible = FALSE m_main_menu.m_view.m_freeform.ToolbarItemVisible = TRUE m_main_menu.m_viDAT*ew.m_current.ToolbarItemVisible = TRUE m_main_menu.m_view.m_history.ToolbarItemVisible = TRUE elseif style_state = 'form' then m_main_menu.m_view.m_freeform.Checked = TRUE m_main_menu.m_view.m_freeform.ToolbarItemVisible = FALSE m_main_menu.m_view.m_tabular.ToolbarItemVisible = TRUE m_main_menu.m_view.m_current.ToolbarItemVisible = TRUE m_main_menu.m_view.m_history.ToolbarItemVisible = TRUE elseif style_state = 'current' then m_main_menu.m_view.m_current.Checked =DAT* TRUE m_main_menu.m_view.m_current.ToolbarItemVisible = FALSE m_main_menu.m_view.m_tabular.ToolbarItemVisible = TRUE m_main_menu.m_view.m_freeform.ToolbarItemVisible = TRUE m_main_menu.m_view.m_history.ToolbarItemVisible = TRUE else m_main_menu.m_view.m_history.Checked = TRUE m_main_menu.m_view.m_history.ToolbarItemVisible = FALSE m_main_menu.m_view.m_tabular.ToolbarItemVisible = TRUE m_main_menu.m_view.m_freeform.ToolbarItemVisible = TRUE m_main_menu.m_view.DAT*m_current.ToolbarItemVisible = TRUE end if if enlarge_state = 'detail' then m_main_menu.m_view.m_expand.Checked = TRUE m_main_menu.m_view.m_original.ToolbarItemVisible = TRUE else m_main_menu.m_view.m_original.Checked = TRUE m_main_menu.m_view.m_original.ToolbarItemVisible = FALSE end if case 'geo activity', 'leg activity' f_menu_on() if style_state = '' or style_state = 'list' then m_main_menu.m_view.m_tabular.Checked = TRUE m_main_menu.m_view.m_tabuDAT*lar.ToolbarItemVisible = FALSE m_main_menu.m_view.m_freeform.ToolbarItemVisible = TRUE m_main_menu.m_view.m_current.ToolbarItemVisible = TRUE m_main_menu.m_view.m_history.ToolbarItemVisible = TRUE elseif style_state = 'form' then m_main_menu.m_view.m_freeform.Checked = TRUE m_main_menu.m_view.m_freeform.ToolbarItemVisible = FALSE m_main_menu.m_view.m_tabular.ToolbarItemVisible = TRUE m_main_menu.m_view.m_current.ToolbarItemVisible = TRUE m_main_menu.m_view.m_histDAT*ory.ToolbarItemVisible = TRUE elseif style_state = 'current' then m_main_menu.m_view.m_current.Checked = TRUE m_main_menu.m_view.m_current.ToolbarItemVisible = FALSE m_main_menu.m_view.m_tabular.ToolbarItemVisible = TRUE m_main_menu.m_view.m_freeform.ToolbarItemVisible = TRUE m_main_menu.m_view.m_history.ToolbarItemVisible = TRUE else m_main_menu.m_view.m_history.Checked = TRUE m_main_menu.m_view.m_history.ToolbarItemVisible = FALSE m_main_menu.m_view.m_tabulaDAT*r.ToolbarItemVisible = TRUE m_main_menu.m_view.m_freeform.ToolbarItemVisible = TRUE m_main_menu.m_view.m_current.ToolbarItemVisible = TRUE end if m_main_menu.m_view.m_expand.Enabled = FALSE m_main_menu.m_view.m_original.Enabled = FALSE case 'geo group', 'geo location', 'leg contact' f_menu_on() m_main_menu.m_view.m_freeform.Checked = TRUE m_main_menu.m_view.m_freeform.Enabled = FALSE m_main_menu.m_view.m_freeform.ToolbarItemVisible = FALSE m_main_menu.m_view.m_DAT*tabular.Enabled = FALSE m_main_menu.m_view.m_tabular.ToolbarItemVisible = FALSE m_main_menu.m_view.m_current.Enabled = FALSE m_main_menu.m_view.m_history.Enabled = FALSE m_main_menu.m_view.m_expand.Enabled = FALSE m_main_menu.m_view.m_original.Enabled = FALSE case 'group', 'location', 'contact' f_menu_on() m_main_menu.m_view.m_freeform.Checked = TRUE m_main_menu.m_view.m_freeform.Enabled = FALSE m_main_menu.m_view.m_freeform.ToolbarItemVisible = FALSE m_main_menuDAT*.m_view.m_tabular.Enabled = FALSE m_main_menu.m_view.m_tabular.ToolbarItemVisible = FALSE m_main_menu.m_view.m_current.Enabled = FALSE m_main_menu.m_view.m_history.Enabled = FALSE if enlarge_state = 'detail' then m_main_menu.m_view.m_expand.Checked = TRUE m_main_menu.m_view.m_original.ToolbarItemVisible = TRUE else m_main_menu.m_view.m_original.Checked = TRUE m_main_menu.m_view.m_original.ToolbarItemVisible = FALSE end if case 'doc' f_menu_on() // m_mainDAT*_menu.m_file.m_scan.Enabled = TRUE // m_main_menu.m_file.m_scan.ToolbarItemVisible = TRUE // if style_state = '' or style_state = 'list' then m_main_menu.m_view.m_tabular.Checked = TRUE m_main_menu.m_view.m_tabular.ToolbarItemVisible = FALSE // else // m_main_menu.m_view.m_freeform.Checked = TRUE m_main_menu.m_view.m_freeform.Checked = FALSE m_main_menu.m_view.m_freeform.ToolbarItemVisible = FALSE // end if m_main_menu.m_view.m_current.Enabled = FALSE m_main_menu.mDAT*_view.m_history.Enabled = FALSE m_main_menu.m_view.m_expand.Enabled = FALSE m_main_menu.m_view.m_original.Enabled = FALSE end choose // Floating toolbar will cause a window USER.EXE stack fault error when // the setredraw to true is executed. So, the temporary fix is not to // not to setredraw when the toolbar is floating style. 6/30/94 swj if w_mdi_main.toolbaralignment <> floating! then w_mdi_main.SetRedraw(TRUE) end if end subroutine DAT* , $ $ 9}, $ $ 9}, $ $ 9}, $ $( 9},0 $8 $@ 9}8H  ,P $X $` 9},h $p $x 9}, $ $ 9}, $ $ 9}, $ $ 9}8 , $ $ DAT*9}, $ $ 9}, $ $ 9}, $ $( 9},0 $8 $@ 9},H $P $X 9},` $h $p 9},x $ $ 9}, $ $ 9}, $ $ 9}8\ 2, $ $ 9}, $ $ 9},DAT* $ $9},$$9}."8  8- " $88",<$D$L9},T$\$d9},l$t$|9},$$9},$$9}d8H ,$$9},$$9},DAT*$$9},$$ 9},$$$9}d8 ,,$4$<9},D$L$T9},\$d$l9},t$|$9},$$9}d,$$9},$$9},$$9},$DAT*$9},$ $9},$$$,9},4$<$D9}."8L 8V "8c " $,p$x$9},$$9},$$9},$$9},$$9},$$9},$DAT*$9},$ $(9},0$8$@9}."8H 8N "8W "  $,`$h$p9},x$$9},$$9},$$9},$$9},$$9},$$9}8\ ` ,DAT*$$9}, $($09} ,8$@$H9},P$X$`9}."8h ."$,l$t$|9},$$9},$$9},$$9},$$9},$$9},$$ 9}DAT*,$$$9},,$:U@`",9)48 2\*Jt !"$%&('R(|)*+,$-N/x01356 728X9:;<>?.@XACDEFG*HTI~JKLN&O>PPQzRSTU"VLWvXYZ[ \H ]r ^ _ ` a bD cn d e f g h@ jj k l m n o p< qf r s t u v8 wb x z { |}*~T~DAT**>h:d 6`t n(R|$Jt4^HrHr.2\<f&Pz:d:d0Z,V"Lv 2 \ `     DAT*!2!\!!!!""."#H"ds statestyle_stateenlarge_statels_master_userw_mdi_mainm_main_menugs_databasegs_inifilesqlcacase30   ( 7@ B@ N@Z@e@k <H toolbaralignmentU@setredrawY$m_file8m_securityHenabled\ORsecuritymaster_useDAT*rnot foundRAPIDSde8H\base8m_printtoolbaritemvisible m_data:m_geographic; :m_legal,< :m_sourceL= :m_devicep> :m_process? :m_stream@ :m_materialA :m_emissionestimation$B :m_reference0!F m_helpL[m_usingrapidsh\\DAT* er8 L[\\ master/detailsinglelistm_view(m_tabularnt2checked(2 (m_freeform 1( 1 (m_current\ 3\(m_history$!4\(m_expand#6\(m_original$7\master( 1\( 1 (2\(2 (\ 3\(DAT*!4\(#6\($7\connectionm_editm_undo\ m_cut\ m_copy8 \8 m_pastep!\p! m_copyrecord9#\# m_pasterecord$\$ (m_filter}(.\((. (DAT*m_showalld/\(d/ ( 1\( 1 (2\(2 (2(\ 3\(!4\(#6\($7\stream((.\((. (d/\(d/ ( 1\( 1 (2\(2 (2(\DAT*Function turns all menu items, toolbar items and check marks offglobal type f_menu_off from function_object end type forward prototypes global subroutine f_menu_off () end prototypes global subroutine f_menu_off ();// This function turns the menu items, toolbar items and check marks off //w_mdi_main.SetRedraw(FALSE) //w_mdi_main.ToolbarVisible = TRUE // Turn all menu items and toolbar items off m_main_menu.m_file.m_close.Enabled = FALSE m_main_menu.m_file.m_save.Enabled = FALSE DAT*m_main_menu.m_file.m_save.ToolbarItemVisible = FALSE //m_main_menu.m_file.m_scan.Enabled = FALSE //m_main_menu.m_file.m_scan.ToolbarItemVisible = FALSE m_main_menu.m_edit.m_undo.Enabled = FALSE m_main_menu.m_edit.m_cut.Enabled = FALSE m_main_menu.m_edit.m_copy.Enabled = FALSE m_main_menu.m_edit.m_paste.Enabled = FALSE m_main_menu.m_edit.m_insert.Enabled = FALSE m_main_menu.m_edit.m_insert.ToolbarItemVisible = FALSE m_main_menu.m_edit.m_delete.Enabled = FALSE m_main_menu.m_edit.m_deleteDAT*.ToolbarItemVisible = FALSE m_main_menu.m_edit.m_copyrecord.Enabled = FALSE m_main_menu.m_edit.m_copyrecord.ToolbarItemVisible = FALSE m_main_menu.m_edit.m_pasterecord.Enabled = FALSE m_main_menu.m_edit.m_pasterecord.ToolbarItemVisible = FALSE m_main_menu.m_view.m_first.Enabled = FALSE m_main_menu.m_view.m_first.ToolbarItemVisible = FALSE m_main_menu.m_view.m_prior.Enabled = FALSE m_main_menu.m_view.m_prior.ToolbarItemVisible = FALSE m_main_menu.m_view.m_next.Enabled = FALSE m_main_menDAT*u.m_view.m_next.ToolbarItemVisible = FALSE m_main_menu.m_view.m_last.Enabled = FALSE m_main_menu.m_view.m_last.ToolbarItemVisible = FALSE m_main_menu.m_view.m_filter.Enabled = FALSE m_main_menu.m_view.m_filter.ToolbarItemVisible = FALSE m_main_menu.m_view.m_showall.Enabled = FALSE m_main_menu.m_view.m_showall.ToolbarItemVisible = FALSE m_main_menu.m_view.m_freeform.Enabled = FALSE m_main_menu.m_view.m_freeform.ToolbarItemVisible = FALSE m_main_menu.m_view.m_tabular.Enabled = FALSE m_DAT*main_menu.m_view.m_tabular.ToolbarItemVisible = FALSE m_main_menu.m_view.m_current.Enabled = FALSE m_main_menu.m_view.m_current.ToolbarItemVisible = FALSE m_main_menu.m_view.m_history.Enabled = FALSE m_main_menu.m_view.m_history.ToolbarItemVisible = FALSE m_main_menu.m_view.m_expand.Enabled = FALSE //m_main_menu.m_view.m_expand.ToolbarItemVisible = FALSE m_main_menu.m_view.m_original.Enabled = FALSE m_main_menu.m_view.m_original.ToolbarItemVisible = FALSE m_main_menu.m_file.m_print.ToDAT*olbarItemVisible = FALSE //m_main_menu.m_file.m_rms.ToolbarItemVisible = FALSE m_main_menu.m_data.m_geographic.ToolbarItemVisible = FALSE m_main_menu.m_data.m_legal.ToolbarItemVisible = FALSE m_main_menu.m_data.m_source.ToolbarItemVisible = FALSE m_main_menu.m_data.m_device.ToolbarItemVisible = FALSE m_main_menu.m_data.m_process.ToolbarItemVisible = FALSE m_main_menu.m_data.m_stream.ToolbarItemVisible = FALSE m_main_menu.m_data.m_material.ToolbarItemVisible = FALSE m_main_menu.m_data.m_emDAT*issionestimation.ToolbarItemVisible = FALSE m_main_menu.m_data.m_reference.ToolbarItemVisible = FALSE m_main_menu.m_help.m_usingrapids.ToolbarItemVisible = FALSE // Turn all check mark off m_main_menu.m_view.m_freeform.Checked = FALSE m_main_menu.m_view.m_tabular.Checked = FALSE m_main_menu.m_view.m_current.Checked = FALSE m_main_menu.m_view.m_history.Checked = FALSE m_main_menu.m_view.m_expand.Checked = FALSE m_main_menu.m_view.m_original.Checked = FALSE //w_mdi_main.SetRedraw(TRUE)DAT* end subroutine DAT* 3\(!4\(#6\($7\memberlegalapplication(2(2 ( 1( 1 (\ 3\(!4\detail(#6($7 ($7($7 schedule(2(2 ( 1( 1\( 1 (DAT*\ 3\(!4\(#6($7 ($7($7 geo memberleg memberleg sourceleg form(2(2 ( 1( 1 (\ 3\(!4\(#6\($7\activity(2(2 ( 1 (\ 3 (!4 DAT*form( 1( 1 (2 (\ 3 (!4 current(\ 3(\ 3 (2 ( 1 (!4 (!4(!4 (2 ( 1 (\ 3 (#6($7 ($7($7 geo activityleg activityDAT*(2(2 ( 1 (\ 3 (!4 ( 1( 1 (2 (\ 3 (!4 (\ 3(\ 3 (2 ( 1 (!4 (!4(!4 (2 ( 1 (\ 3 (#6\DAT*($7\geo groupgeo locationleg contact( 1( 1\( 1 (2\(2 (\ 3\(!4\(#6\($7\grouplocationcontact( 1( 1\( 1 (2\(2 (\ 3\(!4\(#6(DAT*$7 ($7($7 doc(2(2 ( 1( 1 (\ 3\(!4\(#6\($7\U@Y$ 0 @ T d           $ 4 < D X ` h |      DAT*         ( < D T l t              , 4 < D L T h p x                 $ , 4 < D L T \ d l t | DAT*                 ( 0 @ H P X ` h x                   4 < D L T \ p x              DAT*         ( 0 8 @ H P X ` h x                       ( 0 8 @ H P X ` h p x             DAT*     $ , 4 < D L T d l t |                    ( 0 8 @ H P X ` h p x                $ , 4 DAT* < D L T \ d l t |                    ( 0 8 @ P X ` h p x                     ( 0 8 @ DAT*H P X ` h p x                     < D L T \ d l t |                      $ , 4 < D L T DAT*\ d l t |                      $ , 4 < D p x                       ( 0 8 @ ` h p x  DAT*                     ( 0 8 @ H P X ` l t |                      $ , 4 2 + f_menu_behavef_menu_offf_menu_on,DAT*Function turns all menu items, toolbar items on, but all check marks off.global type f_menu_on from function_object end type forward prototypes global subroutine f_menu_on () end prototypes global subroutine f_menu_on ();// This function turns the menu items and toolbar items on, but turns // all check marks off //w_mdi_main.SetRedraw(FALSE) //w_mdi_main.ToolbarVisible = TRUE // Turn all menu items and toolbar items on m_main_menu.m_file.m_close.Enabled = TRUE m_main_menu.m_fileDAT*.m_save.Enabled = TRUE m_main_menu.m_file.m_save.ToolbarItemVisible = TRUE m_main_menu.m_edit.m_undo.Enabled = TRUE m_main_menu.m_edit.m_cut.Enabled = TRUE m_main_menu.m_edit.m_copy.Enabled = TRUE m_main_menu.m_edit.m_paste.Enabled = TRUE m_main_menu.m_edit.m_copyrecord.Enabled = TRUE m_main_menu.m_edit.m_copyrecord.ToolbarItemVisible = TRUE m_main_menu.m_edit.m_pasterecord.Enabled = TRUE m_main_menu.m_edit.m_pasterecord.ToolbarItemVisible = TRUE m_main_menu.m_edit.m_insert.Enabled = TDAT*RUE m_main_menu.m_edit.m_insert.ToolbarItemVisible = TRUE m_main_menu.m_edit.m_delete.Enabled = TRUE m_main_menu.m_edit.m_delete.ToolbarItemVisible = TRUE m_main_menu.m_view.m_first.Enabled = TRUE m_main_menu.m_view.m_first.ToolbarItemVisible = TRUE m_main_menu.m_view.m_prior.Enabled = TRUE m_main_menu.m_view.m_prior.ToolbarItemVisible = TRUE m_main_menu.m_view.m_next.Enabled = TRUE m_main_menu.m_view.m_next.ToolbarItemVisible = TRUE m_main_menu.m_view.m_last.Enabled = TRUE m_main_menDAT*u.m_view.m_last.ToolbarItemVisible = TRUE m_main_menu.m_view.m_filter.Enabled = TRUE m_main_menu.m_view.m_filter.ToolbarItemVisible = TRUE m_main_menu.m_view.m_showall.Enabled = TRUE m_main_menu.m_view.m_showall.ToolbarItemVisible = TRUE m_main_menu.m_view.m_freeform.Enabled = TRUE m_main_menu.m_view.m_freeform.ToolbarItemVisible = TRUE m_main_menu.m_view.m_tabular.Enabled = TRUE m_main_menu.m_view.m_tabular.ToolbarItemVisible = TRUE m_main_menu.m_view.m_current.Enabled = TRUE m_mainDAT*_menu.m_view.m_history.Enabled = TRUE m_main_menu.m_view.m_expand.Enabled = TRUE //m_main_menu.m_view.m_expand.ToolbarItemVisible = TRUE m_main_menu.m_view.m_original.Enabled = TRUE //m_main_menu.m_view.m_original.ToolbarItemVisible = TRUE m_main_menu.m_file.m_print.ToolbarItemVisible = TRUE //m_main_menu.m_file.m_rms.ToolbarItemVisible = TRUE m_main_menu.m_data.m_geographic.ToolbarItemVisible = TRUE m_main_menu.m_data.m_legal.ToolbarItemVisible = TRUE m_main_menu.m_data.m_source.ToolDAT*barItemVisible = TRUE m_main_menu.m_data.m_device.ToolbarItemVisible = TRUE m_main_menu.m_data.m_process.ToolbarItemVisible = TRUE m_main_menu.m_data.m_stream.ToolbarItemVisible = TRUE m_main_menu.m_data.m_material.ToolbarItemVisible = TRUE m_main_menu.m_data.m_emissionestimation.ToolbarItemVisible = TRUE m_main_menu.m_data.m_reference.ToolbarItemVisible = TRUE m_main_menu.m_help.m_usingrapids.ToolbarItemVisible = TRUE // Turn all check mark off m_main_menu.m_view.m_freeform.Checked = FDAT*ALSE m_main_menu.m_view.m_tabular.Checked = FALSE m_main_menu.m_view.m_current.Checked = FALSE m_main_menu.m_view.m_history.Checked = FALSE m_main_menu.m_view.m_expand.Checked = FALSE m_main_menu.m_view.m_original.Checked = FALSE // Always turn these two off m_main_menu.m_view.m_current.ToolbarItemVisible = FALSE m_main_menu.m_view.m_history.ToolbarItemVisible = FALSE //w_mdi_main.SetRedraw(TRUE) end subroutine DAT*kstureenviro!fiscri!meeda!ilstvi!evtem!inower!aww T!f nd o!!!!!2  (,DAT*wro@ttr dy@csta h@@ @ @ 11"*1688",888("8<858>":8<8KDAT*8V"8<8j8t"8<88"B8<88<88<8 8<8ZDAT*Function to check for a lost connection in Oracleglobal type f_oracle_connection from function_object end type forward prototypes global subroutine f_oracle_connection (long pl_error_code) end prototypes global subroutine f_oracle_connection (long pl_error_code);// Function: f_oracle_connection // // Purpose: To check for a lost connection in Oracle. If the connection // lost, halt the system. // // Scope: public // // Parameter: // pl_error_code (long/value) - contains the datDAT*<abase vendor's error // code. // // Returns: none // // Log: // Date Who What // -------- ----- ----------------------------- // 7/27/95 SWJ Initial version choose case pl_error_code case 500 to 599, 3000 to 3999, 6000 to 6999, 9000 to 9999, 12000 to 12999 halt end choose end subroutine DAT* 8<88" 8<88", 888!"Z 8<8<8<8U8n8<8<,DAT*888",888",888"680,88~80,81808z%@8&* : ` 6`>VDAT*(V#$%&('V(n)-./0182b3456728J9z:~;@d. nridsznamebdeletencntcase8sqlcax ! ag(@  d_geo_locd_geo_memberd_sourced_cit_memberd_deviced_src_memberd_activityd_activity_freeformd_processd_dev_memberd_stream_fromd_stream_tod_contactd_contact_reasonsd_loc_coord_groupd_loc_cDAT*oordd_connect_fromd_connect_tod_legal_entityd_legal_memberd_src_leg_ent_reld_src_leg_ent_rel_freeformd_legal_entity_types_legd_legal_entity_relationsd_process_schedulesd_material_displayd_formd_form_freeformd_applicationd_application_freeformd_docd_doc_freeformd_doc_lookupf_del_recsDelete not implemented for 2 y f_del_recsf_del_geo_locsf_del_sourcesf_del_devicesf_del_activitiesf_del_processesf_del_streamsf_del_contactsf_del_contact_reasonsf_delDAT*_location_coordinate_groupsf_del_location_coordinatesf_del_connectionsf_del_legal_entityf_del_leg_ent_relf_del_legal_entitiesf_del_process_specific_schedulef_del_materialf_del_formf_del_appf_del_docf_del_doc_lookup"0>,O-D_m|R1-DAT*-T retnd end: e _IT ^!nh"2  ,DAT* 9},$$9},$$9},$$9}, $$$9},,$4$<9},D$T$\9},d$l$t9},|$$9},$$9},$$9},$$9},$$DAT*9},$$ 9},($<$D9},L$T$\9},d$x$9},$$9},$$9},$$9},$$9},$$9},$,$49},<$D$L9},T$h$DAT*p9},x$$9},$$9},$$9},$$9},$$9},$$8$@9},H$\$d9},l$$9},$$9},$$9},$$9},$$DAT*$9},4$L$T9},\$d$t9},|$$9},$$9},$$9},$$9},$$9}* T ~&Pz"LvH r!#$%&D(n)*+,-@.j/1346<8f9:;<=8>bDAT*?@AD E4F^GHId m_main_menu@ ( m_filenm_closeenabled(m_savem@(@toolbaritemvisibleh m_editm_undoe(m_cutob(m_copy (m_paste!(m_insert&(&h m_deleteP'(P'h m_copDAT*yrecord#(#h m_pasterecord$($h m_view(m_first)(()h (m_priorL*((L*h (m_next+((+h (m_lastw,((,h (m_filter.((.h (m_showall0/((0/h (m_freeform/l1(DAT*(l1h (m_tabular/e2((2h (m_current 3(( 3h (m_history2 !4(( !4h (m_expand\#6((m_original$7(($7h m_printh m_data:m_geographic;h :m_legal h :m_processDAT*!t?h :m_stream@h :m_materialAh :m_emissionestimationBh :m_reference!Fh m_help,[m_usingrapids<\h (l1checkedl(2l( 3l( !4l(\#6l($7l  0 8 H P X ` |        DAT*         ( 0 8 @ H \ d l t |                $ , 4 < D T \ d l t |                   ( < D L DAT*T \ d x                  , 4 < D L T h p x               $ 8 @ H \ d l            DAT*B  $ 4 L T \ d t |               2  f_menu_off on2  DAT*0ie@nvir2lf@escr@lm@gedLhi@istv`ee@itemlni@powe|ma@enu @ @+exp @@ @- 10an@ *14u80F8;0,-,$-h$1H, `-p$1DAT*,Function that turns null variable values into the word "NULL" for strings used in messages. If not null then returns the string value.global type f_msgstring from function_object end type forward prototypes global function string f_msgstring (any aa_value) end prototypes global function string f_msgstring (any aa_value);//******************************************************************************** // // Object: f_msgstring ( any aa_value ) returns string // Function: f_msDAT*&Function to get the values from the structure and put the values on all columns of the datawindow.global type f_paste_record from function_object end type forward prototypes global function boolean f_paste_record (datawindow pdw_obj, ref s_rec_holder pstr_record) end prototypes global function boolean f_paste_record (datawindow pdw_obj, ref s_rec_holder pstr_record); ////////////////////////////////////////////////////////////////////////// // // Function: f_paste_record // // PurposDAT*(e: // // Global function f_paste_record is to get the values from the // structure and put the values on all columns of the datawindow. // IMPORTANT - This function does not support compute fields and groups. // // Scope: public // // Arguments: // pdw_obj (datawindow/value) Contains the active datawindow // object. // // Returns : boolean // TRUE - if paste record successfully // FALSE - if paste record failed // // DATE NAME REVISION // ---- --DAT**---------------------------------------------------------- // 8/4/94 SWJ INITIAL VERSION ///////////////////////////////////////////////////////////////////////// // Location variable declaration string ls_detail_list[], ls_obj_type, ls_data_type, ls_tmp_data, & ls_dec_data integer li_detail_count, li_cur_obj, li_str_count = 1, & li_long_count = 1, li_date_count = 1, li_dt_count = 1, & li_time_count = 1, li_dec_count = 1, li_other_count = 1 long ll_cur_row, ll_dec_data SetPointDAT*er(HourGlass!) // Check and make sure it is still the same datawindow to paste the record if pdw_obj.DataObject <> pstr_record.dw_data_object then MessageBox('Paste Record', 'Nothing to paste from') return FALSE end if // Get the current row ll_cur_row = pdw_obj.GetRow() if ll_cur_row = 0 then MessageBox('Paste Record', 'No row is current') return FALSE elseif ll_cur_row = -1 then MessageBox('Paste Record', 'Error - GetRow() in wf_copy_record') return FALSE end if // GetDAT*.gString // Access: public // Arguments: any aa_value // Returns: string // Description: converts to string for messages where null value must be converted. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 05/09/2001 Michael Colombo Initial Version //************************************************************DAT*|******************** if isnull(aa_value) then aa_value = 'NULL' end if return string(aa_value) end function DAT*2-810Ru8<1~Ru8<1Ru8<1R8x0-81pR8x0-81Ru8x0-DAT*481R-|$1!- d-$1D1Rn-$1-$1d!-8081,-80 804FTn"#$%&(0)@*R,~-.01245.6@8p9:<=BDE IKDNHOzPSTVdQ DAT*< nparentridtransbdeletencountnindnridszselectionsqlsaprocess_cur !(-2 >@ D>0 Select Rid from Rap_Processes where Device_Rid = ?Select Rid from Rap_Processes where Rid = ?dSf_del_Processesf_del_Processes - Close failedh p |  DAT*8global type f_getridfromid from function_object end type forward prototypes global function long f_getridfromid (string as_datalevel, string as_id) end prototypes global function long f_getridfromid (string as_datalevel, string as_id);//Function f_getRidFromID /* Returns: RID for the given ID and Level 0 No RID found -1 Error */ long ll_rc long ll_rid //data levels taken from rap_metric_levels and rap_geographic_types choose case upper(as_dataLevel) // case DAT*:'NATION','STATE','COUNTY','CITY','GEO' case 'SOURCE','SRC' select rid into :ll_rid from rap_sources where id = :as_id using SQLCA; case 'DEVICE','DEV' select rid into :ll_rid from rap_devices where id = :as_id using SQLCA; case 'PROCESS','PRO' select rid into :ll_rid from rap_processes where id = :as_id using SQLCA; case 'STREAM','STR' select rid into :ll_rid from rap_streams where id = :as_id using SQLDAT*TCA; case else messageBox("Error", "f_getRidFromID(); Invalid data level '" + as_dataLevel + "' specified.", exclamation!) ll_rid = 0 return -1 end choose ll_rc = f_sqlCheck(SQLCA) if ll_rc < 0 then ll_rid = 0 return -1 elseif ll_rc = 100 then ll_rid = 0 return 0 end if return ll_rid end function DAT*  2 f_del_processesf_del_group_memberf_del_activitiesf_del_streamsf_del_process_specific_schedulef_del_speciation_profilef_del_emission_factorf_del_doc_lookupf_db_error+<Jj2  !,DAT*@9},$$9},$$9},$$9}, $$$9},,$4$<9},D$T$\9},d$l$t9},|$$9},$$9},$$9},$$9},$$DAT*B9},$$ 9},($<$D9},L$T$\9},d$x$9},$$9},$$9},$$9},$$9},$$9},$$8$@9},H$\$d9},l$|$DAT*D9},$$9},$$9},$$9},$$9},$$8$@9},H$\$d9},l$$9},$$9},$$9},$$ 9},$$,9},4$<$DAT*FD9},L$T$\9},d$l$t9},|$$9},$$9},$$9},$$9} * T ~ &Pz"LvHr "#$%D'n()*+,@.j03567<8f9:;<=8>bABCD E4F^IJdDAT*H m_main_menu@  m_filenm_closeenabled(m_savea@(@toolbaritemvisibleh m_edit@m_undot(m_cut (m_copy (m_paste!(m_copyrecord#(#h m_pasterecordT$(T$h m_insert&(&hDAT*J m_delete'('h m_view_(m_first)(()h (m_priorL*((L*h (m_nexti+((+h (m_lastw,((,h (m_filter.((.h (m_showall0/((0/h (m_freeforml1((l1h (m_tabularDAT*L2((2h (m_current 3((m_history!4((m_expand,#6((m_originalP$7(m_printth m_data:m_geographic7;h :m_legalh :m_process,?h :m_streamP@h :m_materialtAh :m_emissionestimationDAT*NBh :m_reference!Fh m_helpd[m_usingrapids\h (l1checked$(2$( 3$(!4$(,#6$(P$7$( 3h (!4h   0 8 H P X ` |               $ , 4 DAT*P< D L d l t |                 $ , 4 < D T \ d l t |                   ( < D L T \ d x      DAT*R           $ 8 @ H \ d l |              $ 8 @ H \ d l               , 4 < D L T \ d l t |DAT*            2  f_menu_on on2  DAT*Viewitemconnectioninfopowerobjecttransaction on@ectgctur'pi@envi1il@desc?il@ageKch@list_re@witekon@pow{@>b @E4 @ @ @ 88"P,0f88DAT*X",f88&",|f8*81", f8508;z%8cz&:)@@811,81111d116:>Lvz ~!#%&')+,- ./L0Z3f456789<dDAT*6 as_datalevelas_idll_rcll_ridcase18sqlcax  ero!ri( da0@ p SOURCESRCDEVICEDEVPROCESSPROSTREAMSTRErrorf_getRidFromID(); Invalid data level '' specified.2 " f_getridfromidf_sqlcheck(2   DAT*u-D-$1!d- -$1-$1-8 081"&4TXd!"#&d- nparentridtransbdeletencountnindd ca urvi!sc(5 f_del_Method_Metrics  DAT*^Function to print master style datawindow (single row)global type f_print_master_dw from function_object end type forward prototypes global function integer f_print_master_dw (datawindow dw, integer printjob, integer startpos, integer pagesize, integer leftmargin, integer cur_row, ref integer page_num) end prototypes global function integer f_print_master_dw (datawindow dw, integer printjob, integer startpos, integer pagesize, integer leftmargin, integer cur_row, ref integer page_num);//-DAT*`---------------------------------------------------------------------------------------------------------------------------------------- // FUNCTION: F_PRINT_MASTER_DW // // THIS FUNCTION ALLOWS A USER TO PRINT MULTIPLE DATAWINDOWS ON A PAGE // ALL UNITS ARE IN 1/1000 of an inch // // PARMS : DW (datawindow) - Datawindow to be printed // : PRINTJOB (integer) - jobnumber of open print job // : STARTPOS (integer) - starting position on the page in units // : PAGESIZEDAT*b (integer) - size of printed page in units // : LEFTMARGIN (integer) - position from left of page in units // : CUR_ROW (long) - current row number // : PAGE_NUM (integer) - report page number (Pass by reference) // // RETURN : YCOORD (integer) - ending position as a result of this call // in units on last page printed // // NOTES: THE PRINT JOB MUST ALREADY BE OPEN. // THE DATAWINDOW STYLE MUST BE CHANGED TO 1/1000 in SCALE // USING THE DATADAT*dWINDOW PAINTER. // THIS FUNCTION REQUIRES A COMPANION FUNCTION: LISTOBJECTS. //---------------------------------------------------------------------------------------------------------------------------------------- // (c)1993 Powersoft Corporation Bob Ellis - Powersoft Consulting Services //---------------------------------------------------------------------------------------------------------------------------------------- // 7/1/94 SWJ Modified script to print only the one row DAT*f(the current // row) of the datawindow. This script is for the master // datawindow in the master/detail style // 7/7/94 SWJ Modified script to print page number on the bottom // center string objlist[] string header_list[], detail_list[], footer_list[], summary_list[] int count,i,j,band int header_count, detail_count, footer_count, summary_count int x_coord,y_coord string coltype string datatype string temp_text string special_text string fontface string fontheightDAT*h string fontfamily string fontpitch string fontweight string fontitalic string fontunderline fontfamily familytype fontpitch pitch int fontsize boolean isitalic, isunderline string file_bitmap int obj_width, obj_height int text_width int bandheight int newheight int line_x1, line_y1,line_x2,line_y2, line_width int bottom_y string format int ellipse_height, ellipse_width string align // SetPointer(HourGlass!) // 7/5/94 swj //MAKE SURE THE DATAWINDOW OBJECT IS SET TO 1/10DAT*j00 INCH IN PAINTER // ELSE RETURN AN ERROR CODE temp_text = dw.Describe("datawindow.units") if temp_text <> "2" then return -1 end if //FIRST GET A LIST OF ALL THE DATAWINDOW OBJECTS BY BAND //OBJLIST[] NOW CONTAINS THE NAME OF ALL OBJS ON DW //NOTE THAT THESE ARE RETURNED IN CREATION ORDER //NOT BY POSITION ON THE DATAWINDOW. header_count = f_listobjects(dw, header_list, "*", "header") detail_count = f_listobjects(dw, detail_list, "*", "detail") summary_count = f_listobjects(dw, DAT*lsummary_list, "*", "summary") footer_count = f_listobjects(dw, footer_list, "*", "footer") //POSITION THE STARTING POINT newheight = startpos //PROCESS EACH BAND 1=HEAD, 2=DETAIL, 3=SUMM, 4=FOOT //PUT THE BAND LIST INTO THE GENERAL OBJ LIST //SET ROW COUNTS AND GET BAND HEIGHT //FOR EACH BAND---------------------------> for band = 1 to 4 choose case band case 1 objlist[] = header_list[] count = header_count bandheight = integer(dw.Describe("datawindow.header.height")DAT*n) case 2 objlist[] = detail_list[] count = detail_count //GET DETAIL HEIGHT OF DATAWINDOW bandheight = integer(dw.Describe("datawindow.detail.height")) case 3 objlist[] = summary_list[] count = summary_count bandheight = integer(dw.Describe("datawindow.summary.height")) case 4 objlist[] = footer_list[] count = footer_count bandheight = integer(dw.Describe("datawindow.footer.height")) end choose //FOR CURRENT ROW-----------------------------> DAT*p j = cur_row //RESET BOTTOM OBJECT LOCATION VALUE bottom_y = 0 // Check for the end of the page before print the new band. 7/7/94, swj if (newheight + bandheight) >= pagesize then // Define the font for page number and set it PrintDefineFont ( printjob, 1, 'MS Sans Serif', & -8, 700, Fixed!, Swiss!, FALSE, FALSE ) PrintSetFont(printjob, 1) page_num = page_num + 1 PrintText(printjob, "Page " + String(page_num), 4750, 7800) PrintPage(printjob) neDAT*rwheight = 0 end if //FOR EACH OBJECT-------------------------------> for i = 1 to count //FOR EACH OBJECT GET THE TYPE AND THE FIRST X AND Y COORDINATES coltype = dw.Describe(objlist[i] + ".type") x_coord = integer(dw.Describe(objlist[i] + ".x")) y_coord = integer(dw.Describe(objlist[i] + ".y")) obj_height = integer(dw.Describe(objlist[i] + ".height")) obj_width = integer(dw.Describe(objlist[i] + ".width")) align = dw.Describe(objlist[i] + ".alignment") DAT*t //ADD LEFTMARGIN VALUE TO X x_coord = x_coord + leftmargin //ADD NEW HEIGHT TO Y COORD y_coord = y_coord + newheight //GET FONTINFO FOR THE OBJECT fontface = dw.Describe(objlist[i] + ".Font.Face") fontfamily = dw.Describe(objlist[i] + ".Font.Family") fontheight = dw.Describe(objlist[i] + ".Font.Height") fontweight = dw.Describe(objlist[i] + ".Font.Weight") fontpitch = dw.Describe(objlist[i] + ".Font.Pitch") fontitalic = dw.Describe(objlist[i]DAT*v + ".Font.Italic") fontunderline = dw.Describe(objlist[i] + ".Font.Underline") //CONVERT POINT SIZE FROM DW TO 1/1000 in fontsize = abs(integer(fontheight)) fontsize = fontsize * 15 //CONVERT TO THE ENUM DATA TYPE FOR FAMILY CHOOSE CASE fontfamily CASE "0" familytype = Anyfont! CASE "1" familytype = Roman! CASE "2" familytype = Swiss! CASE "3" familytype = Modern! CASE "4" familytype = Script! CASE "5" DAT*x familytype = Decorative! END CHOOSE //CONVERT TO THE ENUM DATA TYPE FOR FONT PITCH CHOOSE CASE fontpitch CASE "0" pitch = Default! CASE "1" pitch = Fixed! CASE "2" pitch = Variable! END CHOOSE //IS IT ITALIC OR UNDERLINED if fontitalic = "1" then isitalic = TRUE else isitalic = FALSE end if //IS IT ITALIC OR UNDERLINED if fontunderline = "1" then isunderline = TRUE else isunderline = FALSE DAT*z end if //DEFINE THE FONT AND SET IT BASED ON OBJECT INFORMATION PrintDefineFont ( printjob, 1, fontface, & fontsize, integer(fontweight), pitch, familytype, & isitalic, isunderline ) PrintSetFont(printjob, 1) //IF BORDER NOT ZERO THEN PRINT A RECTANGLE THE SIZE OF THE COLUMN //ADDING SOME SPACE TO AVOID OVERPRINT if dw.Describe(objlist[i] + ".Border") <> "0" then PrintRect ( printjob, x_coord - 10, y_coord - 10, & obj_width + 25, obj_heiDAT*|ght, 10 ) end if //GET THE KIND OF OBJECT CHOOSE CASE coltype CASE "text" temp_text = dw.Describe(objlist[i] + ".Text") //GET TEXT WIDTH FOR CENTER OR RIGHT JUSTIFICATION text_width = PrintWidth( printjob, temp_text) choose case align case "1" //RIGHT x_coord = Int(obj_width - text_width) + x_coord case "2" //CENTER x_coord = Int((obj_width - text_width)/2) + x_coord end choose printtext(printjob, temp_text,x_DAT*~coord, y_coord) CASE "column", "compute" //GET THE DATATYPE OF COLUMN if coltype = "column" then datatype = left(dw.Describe(objlist[i] + ".coltype"),5) else //COMPUTE FIELDS HAVE NO COLTYPE SO USE TAG VAL datatype = left(dw.Describe(objlist[i] + ".tag"),5) end if CHOOSE CASE datatype CASE "char(" temp_text = dw.getitemstring(j, objlist[i]) CASE "decim" format = dw.Describe(objlist[i] + ".formaDAT*t") temp_text = string(dw.getitemnumber(j, objlist[i]), format) CASE "date" format = dw.Describe(objlist[i] + ".format") temp_text = string(dw.getitemdate(j, objlist[i]), format) CASE "datet" format = dw.Describe(objlist[i] + ".format") temp_text = string(dw.getitemdatetime(j, objlist[i]), format) CASE "numbe" format = dw.Describe(objlist[i] + ".format") temp_text = string(dw.getitemnumber(j, objlist[i]), formaDAT*t) CASE "time" format = dw.Describe(objlist[i] + ".format") temp_text = string(dw.getitemtime(j, objlist[i]), format) CASE ELSE temp_text = "" END CHOOSE //GET TEXT WIDTH FOR CENTER OR RIGHT JUSTIFICATION text_width = PrintWidth( printjob, temp_text) choose case align case "1" //RIGHT x_coord = Int(obj_width - text_width) + x_coord case "2" //CENTER x_coord = Int((obj_width - text_width)/2) + x_coDAT*ord end choose printtext(printjob, temp_text, x_coord, y_coord) CASE "line" //LINES USE A DIFF COORD SYSTEM //GET THE LINE COORDINATES FROM THE DW line_x1 = integer(dw.Describe(objlist[i] + ".X1")) + leftmargin line_y1 = integer(dw.Describe(objlist[i] + ".Y1")) line_x2 = integer(dw.Describe(objlist[i] + ".X2")) + leftmargin line_y2 = integer(dw.Describe(objlist[i] + ".Y2")) line_width = integer(dw.DescriDAT*be(objlist[i] + ".Pen.Width")) printline(printjob, line_x1, line_y1+newheight, line_x2, line_y2+newheight, line_width) //REASSIGN FOR BOTTOM OBJECT CHECK AT END OF CHOOSE y_coord = line_y2 obj_height = line_width CASE "bitmap" file_bitmap = dw.Describe(objlist[i] + ".filename") printbitmap(printjob, file_bitmap, x_coord, y_coord, obj_width, obj_height ) CASE "oval" line_width = integer(dw.Describe(objlist[i] + ".Pen.Width")) DAT*PrintOval ( printjob, x_coord, y_coord, obj_width, obj_height, line_width ) CASE "roundrectangle" ellipse_width = integer(dw.Describe(objlist[i] + ".ellipsewidth")) ellipse_height = integer(dw.Describe(objlist[i] + ".ellipseheight")) line_width = integer(dw.Describe(objlist[i] + ".Pen.Width")) PrintRoundRect ( printjob, x_coord, y_coord, obj_width, obj_height, ellipse_width, ellipse_height, line_width ) CASE "rectangle" line_width = integer(dw.DescribeDAT*(objlist[i] + ".Pen.Width")) PrintRect ( printjob, x_coord, y_coord, obj_width, obj_height, line_width ) END CHOOSE //KEEP TRACK OF THE GREATEST Y+HEIGHT VALUE FOR FINAL Y if y_coord + obj_height > bottom_y then bottom_y = y_coord + obj_height end if Yield() NEXT // <--------------------NEXT OBJECT //ADD BAND HEIGHT TO NEWHEIGHT newheight = newheight + bandheight // //CHECK FOR THE END OF THE PAGE // if newheight >= pagesize then DAT* // // Define the font for page number and set it. 7/7/94, swj // PrintDefineFont ( printjob, 1, 'MS Sans Serif', & // -8, 700, Fixed!, Swiss!, FALSE, FALSE ) // PrintSetFont(printjob, 1) // page_num = page_num + 1 // 7/7/94, SWJ // PrintText(printjob, "Page " + String(page_num), 4750, 7800) // 7/7/94, SWJ // PrintPage(printjob) // newheight = 0 // end if Yield() NEXT // <-------------------------------------------------------NEXT BAND //DONE FUNCTION DAT* //beep(1) //RETURN CURRENT POSITION OF BOTTOM OBJECT ON THE PRINTED PAGE return bottom_y + (newheight - bandheight) end function DAT* 2 ( f_del_method_metricsf_db_error(2  !,DAT*treeviewitemconnectioninfopowerobjecttransaction@QQj@8k@@QB@m@P@@\@@p@^@q|jt@q@@n+c te@stro @ @ @ 21hu-\-$1!d- DAT*--$1!- -$1- $1-8(081"&4TXd"h$l%p'~)*03458d- nparentridtransbdeletencountnindd !(I f_del_ProcDAT*ess_Specific_Schedules    2 3 f_del_process_specific_schedulef_db_error((2  !,DAT*z0$1!,81Ru80,81R1 $1 1R$1j8$0816\l~!"(+ ,:-\0jd4 pl_ridptranspb_deDAT*letell_cntll_indsqlcax ca urvi sc'e.@ 3 of_del_material   2 F f_del_materialf_del_group_memberf_del_doc_lookupf_db_errorP*;2  ,DAT* 1u-L-$1!d- -$1-$1-8 081"&4TXd !"%d- nparentridtransbdeletencountnindd !(; f_del_LocatiDAT*on_Coordinates   2 . f_del_location_coordinatesf_db_error( onect#si2  !,DAT*@q@@ @ h@@ @ @- 10an@ 1:u888z%R88Jz%,-,8-X$1v, t-`$18<1R-h$1DAT*!D- $-p$1r1Rz-x$1-$1d!-8081,-8086:R` z!$%&',.4/83D5r8v9:=>@ dQ nparentridtransbdeletencountnindnridszselectionsqlsacur_locgrps DAT*!(-2 >@ D>0 Select Rid from Rap_Location_Coordinate_Groups where Ref_Rid = ?where Rid = ?f_del_location_coordinate_groupsf_del_location_coordinate_groups - Close failedX ` h p x  2 O f_del_location_coordinate_groupsf_del_location_coordinatesf_db_errorPDAT*)DD2  !,DAT*e@onmeQed@ipti]sa@atawql@iewi}ew@cono@robj ct@" @ @_cq #@ 1u--$1!|- |-$1-$1-8 081DAT*"&*.2@`dhlp#|&'(+dJ nparentridnrefridszcodedbeginreldatetransbdeletencountnind " 0 6>E= f_del_Legal_Entity_Relations   2 4 f_del_legal_entity_relations_recDAT*~f_db_error()2  >PDAT* 1u-X-$1!d- -$1-$1-8 081"&4TXd !"%d- nparentridtransbdeletencountnindd !(= DAT*f_del_Legal_Entity_Relations   2 0 f_del_legal_entity_relationsf_db_error(%2  !,DAT*1u8$11!P8<1Ru8<1.Ru8<1PR$1! $11R DAT*$18(081"&4\ #$%(.,P.p/t3678;d4 pl_ridptranspb_deletell_cntll_indsqlcax  '.@ = f_del_legal_entities    2 X f_del_legal_entityfDAT*_del_leg_ent_relf_del_contactsf_del_activitiesf_db_errord-<M2  ,DAT* @o @ 7s@ @- 10an@ 1&80,-,4-<$1L, p-D$1u8<1R-L$1!, -T$1H1RDAT*N-\$1-d$1d!-8l081,-808&4Nh"#$%*, 02H5L6~7:;=d^ nparentridtransbdeletencountnindnridszselectionsqlsacur_legal_entitiessqlca t esip!ai(ai-wc2DAT* tr>@ ioD>trX@ 0 Select Rid from Rap_Legal_Entities where Rid = ?f_del_Legal_Entitiesf_del_Legal_Entities - Close failed< D L T \ d 2 E f_del_legal_entitiesf_del_legal_entity_relationsf_db_errorP onectsture:enviro:fi2  !,DAT*DAT*Function to print detail style datawindowglobal type f_printdw from function_object end type forward prototypes global function integer f_printdw (datawindow dw, integer printjob, integer startpos, integer pagesize, integer leftmargin, ref integer page_num) end prototypes global function integer f_printdw (datawindow dw, integer printjob, integer startpos, integer pagesize, integer leftmargin, ref integer page_num);//------------------------------------------------------------------------DAT*----------------------------------------------------------------- // FUNCTION: PRINTDW // // THIS FUNCTION ALLOWS A USER TO PRINT MULTIPLE DATAWINDOWS ON A PAGE // ALL UNITS ARE IN 1/1000 of an inch // // PARMS : DW (datawindow) - Datawindow to be printed // : PRINTJOB (integer) - jobnumber of open print job // : STARTPOS (integer) - starting position on the page in units // : PAGESIZE (integer) - size of printed page in units // : LEFTMARGIN (integer) DAT* - position from left of page in units // : PAGE_NUM (integer) - report page number (pass by reference) // // RETURN : YCOORD (integer) - ending position as a result of this call // in units on last page printed // // NOTES: THE PRINT JOB MUST ALREADY BE OPEN. // THE DATAWINDOW STYLE MUST BE CHANGED TO 1/1000 in SCALE // USING THE DATAWINDOW PAINTER. // THIS FUNCTION REQUIRES A COMPANION FUNCTION: LISTOBJECTS. //----------------------------------------------DAT*------------------------------------------------------------------------------------------ // (c)1993 Powersoft Corporation Bob Ellis - Powersoft Consulting Services //---------------------------------------------------------------------------------------------------------------------------------------- // 7/5/94 SWJ Added SetPointer function. // 7/7/94 SWJ Modified script to print the page number at the bottom // center. string objlist[] string header_list[], detail_list[],DAT* footer_list[], summary_list[] int count,i,j,band int header_count, detail_count, footer_count, summary_count int x_coord,y_coord string coltype string datatype string temp_text string special_text string fontface string fontheight string fontfamily string fontpitch string fontweight string fontitalic string fontunderline fontfamily familytype fontpitch pitch int fontsize boolean isitalic, isunderline string file_bitmap int obj_width, obj_height int text_width int bandheighDAT*t int newheight int line_x1, line_y1,line_x2,line_y2, line_width long numrows int bottom_y string format int ellipse_height, ellipse_width string align //SetPointer(HourGlass!) // 7/5/94 swj //GET NUMBER OF ROWS IN THE DATAWINDOW numrows = dw.rowcount() //MAKE SURE THE DATAWINDOW OBJECT IS SET TO 1/1000 INCH IN PAINTER // AND THERE ARE ROWS IN THE DW ELSE RETURN AN ERROR CODE temp_text = dw.Describe("datawindow.units") if temp_text <> "2" or numrows <= 0 then return -1 end DAT*if //FIRST GET A LIST OF ALL THE DATAWINDOW OBJECTS BY BAND //OBJLIST[] NOW CONTAINS THE NAME OF ALL OBJS ON DW //NOTE THAT THESE ARE RETURNED IN CREATION ORDER //NOT BY POSITION ON THE DATAWINDOW. header_count = f_listobjects(dw, header_list, "*", "header") detail_count = f_listobjects(dw, detail_list, "*", "detail") summary_count = f_listobjects(dw, summary_list, "*", "summary") footer_count = f_listobjects(dw, footer_list, "*", "footer") //POSITION THE STARTING POINT newheight =DAT* startpos //PROCESS EACH BAND 1=HEAD, 2=DETAIL, 3=SUMM, 4=FOOT //PUT THE BAND LIST INTO THE GENERAL OBJ LIST //SET ROW COUNTS AND GET BAND HEIGHT //FOR EACH BAND---------------------------> for band = 1 to 4 choose case band case 1 objlist[] = header_list[] count = header_count numrows = 1 bandheight = integer(dw.Describe("datawindow.header.height")) case 2 objlist[] = detail_list[] count = detail_count //GET NUMBER OF ROWS IN THE DATAWINDOW numrowsDAT* = dw.rowcount() //GET DETAIL HEIGHT OF DATAWINDOW bandheight = integer(dw.Describe("datawindow.detail.height")) case 3 objlist[] = summary_list[] count = summary_count numrows = 1 bandheight = integer(dw.Describe("datawindow.summary.height")) case 4 objlist[] = footer_list[] count = footer_count numrows = 1 bandheight = integer(dw.Describe("datawindow.footer.height")) end choose //FOR EACH ROW-----------------------------> for j=1 to numrows DAT* //RESET BOTTOM OBJECT LOCATION VALUE bottom_y = 0 //FOR EACH OBJECT-------------------------------> for i = 1 to count //FOR EACH OBJECT GET THE TYPE AND THE FIRST X AND Y COORDINATES coltype = dw.Describe(objlist[i] + ".type") x_coord = integer(dw.Describe(objlist[i] + ".x")) y_coord = integer(dw.Describe(objlist[i] + ".y")) obj_height = integer(dw.Describe(objlist[i] + ".height")) obj_width = integer(dw.Describe(objlist[i] + ".width")) align = dw.DesDAT*cribe(objlist[i] + ".alignment") //ADD LEFTMARGIN VALUE TO X x_coord = x_coord + leftmargin //ADD NEW HEIGHT TO Y COORD y_coord = y_coord + newheight //GET FONTINFO FOR THE OBJECT fontface = dw.Describe(objlist[i] + ".Font.Face") fontfamily = dw.Describe(objlist[i] + ".Font.Family") fontheight = dw.Describe(objlist[i] + ".Font.Height") fontweight = dw.Describe(objlist[i] + ".Font.Weight") fontpitch = dw.Describe(objlist[i] + ".Font.Pitch") fDAT*ontitalic = dw.Describe(objlist[i] + ".Font.Italic") fontunderline = dw.Describe(objlist[i] + ".Font.Underline") //CONVERT POINT SIZE FROM DW TO 1/1000 in fontsize = abs(integer(fontheight)) fontsize = fontsize * 15 //CONVERT TO THE ENUM DATA TYPE FOR FAMILY CHOOSE CASE fontfamily CASE "0" familytype = Anyfont! CASE "1" familytype = Roman! CASE "2" familytype = Swiss! CASE "3" familytype = Modern! CASE "4" familyDAT*type = Script! CASE "5" familytype = Decorative! END CHOOSE //CONVERT TO THE ENUM DATA TYPE FOR FONT PITCH CHOOSE CASE fontpitch CASE "0" pitch = Default! CASE "1" pitch = Fixed! CASE "2" pitch = Variable! END CHOOSE //IS IT ITALIC OR UNDERLINED if fontitalic = "1" then isitalic = TRUE else isitalic = FALSE end if //IS IT ITALIC OR UNDERLINED if fontunderline = "1" then isunderline = TRUE DAT* else isunderline = FALSE end if //DEFINE THE FONT AND SET IT BASED ON OBJECT INFORMATION PrintDefineFont ( printjob, 1, fontface, & fontsize, integer(fontweight), pitch, familytype, & isitalic, isunderline ) PrintSetFont(printjob, 1) //IF BORDER NOT ZERO THEN PRINT A RECTANGLE THE SIZE OF THE COLUMN //ADDING SOME SPACE TO AVOID OVERPRINT if dw.Describe(objlist[i] + ".Border") <> "0" then PrintRect ( printjob, x_coord - 10, y_coord - 10, DAT*& obj_width + 25, obj_height, 10 ) end if //GET THE KIND OF OBJECT CHOOSE CASE coltype CASE "text" temp_text = dw.Describe(objlist[i] + ".Text") //GET TEXT WIDTH FOR CENTER OR RIGHT JUSTIFICATION text_width = PrintWidth( printjob, temp_text) choose case align case "1" //RIGHT x_coord = Int(obj_width - text_width) + x_coord case "2" //CENTER x_coord = Int((obj_width - text_width)/2) + x_coord end choose DAT* printtext(printjob, temp_text,x_coord, y_coord) CASE "column", "compute" //GET THE DATATYPE OF COLUMN if coltype = "column" then datatype = left(dw.Describe(objlist[i] + ".coltype"),5) else //COMPUTE FIELDS HAVE NO COLTYPE SO USE TAG VAL datatype = left(dw.Describe(objlist[i] + ".tag"),5) end if CHOOSE CASE datatype CASE "char(" temp_text = dw.getitemstring(j, objlist[i]) CASE "decim" format DAT*= dw.Describe(objlist[i] + ".format") temp_text = string(dw.getitemnumber(j, objlist[i]), format) CASE "date" format = dw.Describe(objlist[i] + ".format") temp_text = string(dw.getitemdate(j, objlist[i]), format) CASE "datet" format = dw.Describe(objlist[i] + ".format") temp_text = string(dw.getitemdatetime(j, objlist[i]), format) CASE "numbe" format = dw.Describe(objlist[i] + ".format") temp_text = string(dw.gDAT*etitemnumber(j, objlist[i]), format) CASE "time" format = dw.Describe(objlist[i] + ".format") temp_text = string(dw.getitemtime(j, objlist[i]), format) CASE ELSE temp_text = "" END CHOOSE //GET TEXT WIDTH FOR CENTER OR RIGHT JUSTIFICATION text_width = PrintWidth( printjob, temp_text) choose case align case "1" //RIGHT x_coord = Int(obj_width - text_width) + x_coord case "2" //CENTER x_coord = Int(DAT*(obj_width - text_width)/2) + x_coord end choose printtext(printjob, temp_text, x_coord, y_coord) CASE "line" //LINES USE A DIFF COORD SYSTEM //GET THE LINE COORDINATES FROM THE DW line_x1 = integer(dw.Describe(objlist[i] + ".X1")) + leftmargin line_y1 = integer(dw.Describe(objlist[i] + ".Y1")) line_x2 = integer(dw.Describe(objlist[i] + ".X2")) + leftmargin line_y2 = integer(dw.Describe(objlist[i] + ".Y2")) DAT* line_width = integer(dw.Describe(objlist[i] + ".Pen.Width")) printline(printjob, line_x1, line_y1+newheight, line_x2, line_y2+newheight, line_width) //REASSIGN FOR BOTTOM OBJECT CHECK AT END OF CHOOSE y_coord = line_y2 obj_height = line_width CASE "bitmap" file_bitmap = dw.Describe(objlist[i] + ".filename") printbitmap(printjob, file_bitmap, x_coord, y_coord, obj_width, obj_height ) CASE "oval" line_width = integer(dw.Describe(DAT*objlist[i] + ".Pen.Width")) PrintOval ( printjob, x_coord, y_coord, obj_width, obj_height, line_width ) CASE "roundrectangle" ellipse_width = integer(dw.Describe(objlist[i] + ".ellipsewidth")) ellipse_height = integer(dw.Describe(objlist[i] + ".ellipseheight")) line_width = integer(dw.Describe(objlist[i] + ".Pen.Width")) PrintRoundRect ( printjob, x_coord, y_coord, obj_width, obj_height, ellipse_width, ellipse_height, line_width ) CASE "rectangle" DAT* line_width = integer(dw.Describe(objlist[i] + ".Pen.Width")) PrintRect ( printjob, x_coord, y_coord, obj_width, obj_height, line_width ) END CHOOSE //KEEP TRACK OF THE GREATEST Y+HEIGHT VALUE FOR FINAL Y if y_coord + obj_height > bottom_y then bottom_y = y_coord + obj_height end if Yield() NEXT // <--------------------NEXT OBJECT //ADD BAND HEIGHT TO NEWHEIGHT FOR MULTI ROW POSITION newheight = newheight + bandheight //CHECK FOR THEDAT* END OF THE PAGE if newheight >= pagesize then // Define the font for page number and set it. 7/7/94, swj PrintDefineFont ( printjob, 1, 'MS Sans Serif', & -8, 700, Fixed!, Swiss!, FALSE, FALSE ) PrintSetFont(printjob, 1) page_num = page_num + 1 // 7/7/94, swj PrintText(printjob, "Page " + String(page_num), 4750, 7800) // 7/7/94, swj PrintPage(printjob) newheight = 0 end if Yield() NEXT // <------------------------------------------NEXT ROW DAT* Yield() NEXT // <-------------------------------------------------------NEXT BAND //DONE FUNCTION //beep(1) //RETURN CURRENT POSITION OF BOTTOM OBJECT ON THE PRINTED PAGE return bottom_y + (newheight - bandheight) end function DAT* #@- 10an@ 14u80F8R0,-,$-$1, `-$1!, -$11Rn-$1-$1d!f-8081,-80DAT*804FTn #%)+./60X3f4v6dP nparentridtransbdeletencountnindll_ridls_sqlsqlsaleg_cursqlca t _rtu!nv(es-ge4 is;@ itA>poJ@ ( select legal_entity_rid from rap_legal_entity_relations where ref_rid = ?DAT*select legal_entity_rid from rap_legal_entity_relations where legal_entity_rid = ?f_del_leg_ent_relf_del_leg_ent_rel - Close failed     2 % f_del_leg_ent_relf_db_error<2  !,DAT*@j@+k@@N5@m@C@@O@@c@^@aoji@q@s@@ @ @@ @ @ D$1!F $1l$18 08DAT*Function to put scroll bars on the mdi sheet when neededglobal type f_put_scroll_bars from function_object end type forward prototypes global subroutine f_put_scroll_bars (window win_obj) end prototypes global subroutine f_put_scroll_bars (window win_obj);// Only perform the following code when the window is in its normal size if win_obj.WindowState = Normal! then // Put horizontal scroll bar if the width of the window is less than the // width of MDI client area if win_obj.WiDAT*]dth < 2922 then win_obj.HScrollBar = TRUE else win_obj.HScrollBar = FALSE end if // Put vertical scroll bar if the height of the window is less than the // height of MDI client area if win_obj.Height < 1565 then win_obj.VScrollBar = TRUE else win_obj.VScrollBar = FALSE end if end if end subroutine DAT*14$1! <$1(RD$1r8 0816:F l!"%'(*,-14(5B6d9rd. pl_ridptranspb_deletell_cntll_indd  'L0 DAT*f_del_group_member   4 < D 2 & f_del_group_memberf_db_error<2  ,DAT* 1u<$11!H,81Ru8<1&Ru8<1HR$1!x $11RDAT* $18(081"&4\"#$'&+H-h.l2x567:d4 pl_ridptranspb_deletell_cntll_indsqlcax ca urvi sc'e.@ 7 f_del_geo_locs    2 g f_del_geo_locsDAT*f_del_group_memberf_del_location_coordinate_groupsf_del_activitiesf_db_errord*K\12  ,DAT*$11!u80,81R$1!  $11R($1X80081"&4\!#$(+,(-J0Xd4 pl_ridptranspb_deletell_cntll_indsqlcax ca urDAT*cvi sc'e.@ < form^@f_del_forms   ( 2 ( f_del_formf_del_docf_db_error< onectstureen2  ,DAT*  PT 2 E pl_parent_ridps_codeptranspb_deletef_del_emission_factorJ  %LLSCtransaction.B x function_objectf_del_emission_factorstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction@j@.k@@G8DAT* @m@F@@R@@f@^@qrjr@q@ @f @o ta@area @ @ 1ZH$1!V 18$1! $DAT*$1! T$$1<,$184081&FJ!V#j&~()*,./03689;=> FI<JVKxNd= pl_parent_ridps_codeptranspb_deletell_cntll_indx ca ur vi%sc/e6J( DAT*  f_del_emission_factor   $ , 2 ) f_del_emission_factorf_db_error( onectlo2  /8DAT*2 @- 10an@ 14u80p8?^8C0p80, ,($1. , d$1!, $1*1R$1$1d!808DAT*Function to qc the activity data before saving to the databaseglobal type f_qc_act_data_1 from function_object end type forward prototypes global function boolean f_qc_act_data_1 (string act_value, string metric_code, string value_type, string material_code, string unit_code, string level_type, string source_code, string device_code, string process_code, string stream_code, ref string err_msg, ref string field_name) end prototypes global function boolean f_qc_act_data_1 (string act_value,DAT* string metric_code, string value_type, string material_code, string unit_code, string level_type, string source_code, string device_code, string process_code, string stream_code, ref string err_msg, ref string field_name);/////////////////////////////////////////////////////////////////////////// // // Function: f_qc_act_data_1 // // Purpose: // // Function f_qc_act_data_1 is to qc activity record before saving the // record into the database. The validation information is selected // DAT* from rap_metrics table. If any of the fields // does not pass the validation check, the function then returns // FALSE; otherwise, it returns TRUE. // // Arguments: // act_value : string (value from rap_activities) // metric_code : string (metric_code from rap_activities) // value_type : string (value_type from rap_activities) // material_code : string (material_code from rap_activities) // unit_code : string (value_unit_code from rap_activities) // leDAT*vel_type : string (i.e. GEO, SRC, DEV, PRO, or STR) // source_code : string (i.e. source code value if this is // a source activity; otherwise, empty string) // device_code : string (i.e. device code value if this is // a device activity; otherwise, empty string) // process_code : string (i.e. process code value if this is // a process activity; otherwise, empty string) // stream_code : string (i.e. stream code value if this is // DAT* a stream activity; otherwise, empty string) // err_msg : string ( validation error message, pass by // reference ) // field_name : string ( field name which validation is // performed on, pass by reference ) // // Returns : boolean // // DATE NAME REVISION // ---- ------------------------------------------------------------ // 7/8/94 SWJ INITIAL VERSION ///////////////////////////////////////////////////////////////////////// // Local variableDAT* declaration string ls_format_type, ls_lookup_name, ls_material_flag, ls_meas_code, & ls_value_type_flag, ls_code, ls_code_list integer li_value_length_amt boolean lb_print=TRUE if IsNull(metric_code) then err_msg = 'Metric Code is null' return FALSE end if // Get validation information from rap_metrics table select format_type, lookup_name, material_flag, meas_code, value_length_amt, value_type_flag into :ls_format_type, :ls_lookup_name, :ls_material_flag, :ls_meDAT* as_code, :li_value_length_amt, :ls_value_type_flag from rap_metrics where code = :metric_code; // If metric code not found in the rap_metrics table, print error msg if sqlca.sqlcode = 100 then err_msg = "Invalid Metric Code.~nMetric Code '" + metric_code + & "' not found in rap_metrics table" return FALSE end if if sqlca.sqlcode = -1 then f_db_error(SQLCA, "Fail on selecting data on " + & "rap_metrics table. Contact your technical support.") return FALSE end if fieldDAT*"_name = 'value_unit_code' // Check to see if unit_code is valid declare codeCursor cursor for select code from rap_units where meas_code = :ls_meas_code; open codeCursor; fetch codeCursor into :ls_code; // If meas code not found in the rap_units table, print error msg if sqlca.sqlcode = 100 then if IsNull(ls_meas_code) then if Not IsNull(unit_code) then err_msg = "Unit Code should be null for Metric Code '" + & metric_code close codeCursor; return FALSE DAT*$end if else err_msg = "Invalid Measurement Code.~nMeasurement Code '" + & ls_meas_code + "' not found in rap_units table" close codeCursor; return FALSE end if elseif sqlca.sqlcode = -1 then f_db_error(SQLCA, "Fail on selecting code on " + & "rap_units table. Contact your technical support.") close codeCursor; return FALSE else do while sqlca.sqlcode = 0 if IsNull(ls_code) then ls_code = 'none' end if // Concatenate all valid values into a list DAT*& ls_code_list = ls_code_list + ls_code + ' ' // If unit_code is matched ls_code, this means the unit code is valid. // Do not print error message if unit_code = ls_code then lb_print = FALSE exit end if fetch codeCursor into :ls_code; loop // If unit code not found in the list of valid values, print error msg if lb_print then err_msg = 'Sorry! Not a unit code.~nThe valid unit codes are:~n' + & ls_code_list close codeCursor; return FALSE end if endDAT*( if close codeCursor; field_name = 'value' // If value field is not null if Not IsNull(act_value) then // check on the data type of value field choose case ls_format_type // Activity data type should be alphanumeric case 'C' // Alphanumeric will accept both alpha and numeric type // Commented out by swj, 7/30/94 // // Check to see if the data entered is alphanumeric // if IsNumber(act_value) then // err_msg = "Sorry! Alphanumeric data value is " + & // DAT**"expected for metric '" + metric_code + "'" // return FALSE // end if // Check to see if the value field is within the valid range if level_type <> 'GEO' then if Not f_qc_act_data_3(ls_lookup_name, act_value, & metric_code, err_msg) then return FALSE end if end if // Activity data type should be logic (Y or N) case 'L' if Not (act_value = 'Y' or act_value = 'N') then err_msg = "Sorry! The valid value for metric '" + & metric_code + "'DAT*, is Y for yes or N for no" return FALSE end if // Activity data type should be numeric case 'N' // Check to see if the data entered is numeric if Not IsNumber(act_value) then err_msg = "Sorry! Numeric data value is expected " + & "for metric '" + metric_code + "'" return FALSE end if // Check to see if the value field is within the valid range if level_type <> 'GEO' then if Not f_qc_act_data_2(level_type, source_code, device_code, & pDAT*.rocess_code, stream_code, material_code, act_value, metric_code, & unit_code, err_msg) then return FALSE end if end if end choose // Check on the total number of digits/characters on value field if Len(act_value) > li_value_length_amt then err_msg = 'Sorry! The value field length ' + & 'can not exceed ' + String(li_value_length_amt) return FALSE end if // Check to see if material_code is required for the current metric code if ls_material_flag = 'Y'DAT*0 then if IsNull(material_code) then field_name = 'material_code' err_msg = 'Sorry! Material Code is required' return FALSE end if end if // Check to see if value_type is required for the current metric code if ls_value_type_flag = 'Y' then if IsNull(value_type) then field_name = 'value_type' err_msg = 'Sorry! Value Type is required' return FALSE end if end if // If value field is null, check to see if the value field is required else if level_tDAT*ype <> 'GEO' then if Not f_qc_act_data_2(level_type, source_code, device_code, & process_code, stream_code, material_code, act_value, metric_code, & unit_code, err_msg) then return FALSE end if end if end if // Pass QC check return TRUE end function DAT*41 ,80804HZ^p ~#%(*.0*3.4`589;d] pl_ridps_parentptranspb_deletencountnindll_ridls_sqlsqlsadoclook_cursqlca ca ur vi sc*e1st6te= owD@ onJ>naW@ DAT*6 ( select rid from rap_document_lookups where ref_rid = ?docselect rid from rap_document_lookups where document_rid = ?select rid from rap_document_lookups where rid = ?df_del_doc_lookupf_del_doc_lookup - Close failed     2 $ f_del_doc_lookupf_db_error<2  *8DAT*DAT*: @- 10an@ 1u8H8 08>r8B08z08z%@8180, ,$1 , X$18081RDAT*<$1!, $11R$1$1d!L8z081 ,8082D\nr$%(*,-6.f248:=>?>BLC\E~dY pl_ridps_parentptranspb_deletencountnindll_ridls_sqlsqlsadoc_cursqlcaDAT*>  *es1ld6= D@ J>S@ 0 formselect rid from rap_documents where form_rid = ?appselect rid from rap_documents where application_rid = ?f_del_docInvalid parent type - select rid from rap_documents where rid = ?docf_del_doc - Close failed  DAT*    2 . f_del_docf_del_doc_lookupf_db_errorP##2  *8DAT* end function DAT*Dj@&k@@F0@m@>@@J@@^@^@Aj @q@zs@@ @ @@ @ #@- 10an@ 6+14u80F890,-,$-d$1, `DAT*F-l$1,-810Ru8<1~Ru8<1Ru8<1Ru8<1hRu8<1RuDAT*H8<1 Ru8t0-81,R-x$1!\, p-$11Rn-$1-$1d!-80 81,-80 804FTn"#$%&(0)@*R,~-.01DAT*J245*6<8h9x:<=>@ D,FLJ\LOPQTUW"dW nparentridtransbdeletencountnindnridszselectionsqlsacur_devicessqlca !(8-z2 >@ D>Q@ 0 Select Rid from Rap_Devices where Source_Rid = ?Select Rid from Rap_Devices where Rid = ?DAT*LADIf_del_Devicesf_del_Devices - Close failedd l x    2 f_del_devicesf_del_group_memberf_del_processesf_del_contactsf_del_location_coordinate_groupsf_del_activitiesf_del_connectionsf_del_leg_ent_relf_del_doc_lookupf_db_error)9HizDAT*2  !,DAT*P @- 10an@ 14u80F870,-,(-d$1l, d-l$1 u8<1 R-t$1!:- -|$1h1Rn-$1DAT*R-$1d!-8081,-80804FTn"#$%* ,*-.1:3h6l78;<>dR nparentridtransbdeletencountnindnridszselectionsqlsacur_contacts t cten!de(ag-li2 wi>@ DAT*pD>0 Select Rid from Rap_Contacts where Ref_Rid = ?Select Rid from Rap_Contacts where Rid = ?Lf_del_Contactsf_del_Contacts - Close failedd l t |   2 8 f_del_contactsf_del_contact_reasonsf_db_errorP onectsture-enviro-fi2  !,DAT*u-D-$1!d- -$1-$1-8 081"&4TXd!"#&d- nparentridtransbdeletencountnindd t cten!de(6 f_del_Contact_Reasons DAT*XFunction to check if value field is required and value is within the valid range for numeric value data type in activity dataglobal type f_qc_act_data_2 from function_object end type forward prototypes global function boolean f_qc_act_data_2 (string level_type, string source_code, string device_code, string process_code, string stream_code, string material_code, string act_value, string metric_code, string unit_code, ref string err_msg) end prototypes global function boolean f_qc_act_dataDAT*Z_2 (string level_type, string source_code, string device_code, string process_code, string stream_code, string material_code, string act_value, string metric_code, string unit_code, ref string err_msg);/////////////////////////////////////////////////////////////////////////// // // Function: f_qc_act_data_2 // // Purpose: // // Function f_qc_act_data_2 is to qc activity record before saving the // record into the database. The validation information is selected // from rap_metric_mapsDAT*\ table. This function checks to see if // value field is required and value is within the valid range for // numeric value data type. If any of the fields // does not pass the validation check, the function then returns // FALSE; otherwise, it returns TRUE. // // Arguments: // level_type : string (i.e. SRC, DEV, PRO, or STR) // source_code : string (i.e. source code value if this is // a source activity; otherwise, empty string) // device_code : string DAT*^(i.e. device code value if this is // a device activity; otherwise, empty string) // process_code : string (i.e. process code value if this is // a process activity; otherwise, empty string) // stream_code : string (i.e. stream code value if this is // a stream activity; otherwise, empty string) // material_code : string (i.e. material code value if this is // a stream activity; otherwise, empty string) // act_value : string (valueDAT*` from rap_activities) // metric_code : string (metric_code from rap_activities) // unit_code : string (value_unit_code from rap_activities) // err_msg : string (validation error message, pass by // reference) // // Returns : boolean // // DATE NAME REVISION // ---- ------------------------------------------------------------ // 7/8/94 SWJ INITIAL VERSION ///////////////////////////////////////////////////////////////////////// // Local variable declDAT*baration string ls_sel_stmnt, ls_required_flag, ls_unit_code, ls_metric_map_code, & ls_src_code, ls_dev_code, ls_pro_code, ls_str_code, ls_mat_code, & ls_material_code decimal ldec_max_amt, ldec_min_amt, ldec_act_value, & ldec_default_unit_factor, ldec_user_unit_factor // Do not allow any null values for the following codes if IsNull(metric_code) then err_msg = 'Metric Code is null' return FALSE end if if IsNull(source_code) then err_msg = 'Source Code is null' return FALSE DAT*d end if if IsNull(device_code) then err_msg = 'Device Code is null' return FALSE end if if IsNull(process_code) then err_msg = 'Process Code is null' return FALSE end if if IsNull(stream_code) then err_msg = 'Stream Code is null' return FALSE end if if IsNull(material_code) then ls_material_code = '' else ls_material_code = material_code end if // Construct the sql statement ls_sel_stmnt = "select source_code, device_code, process_code, " + & "stream_code, material_cDAT*fode, maximum_amt, minimum_amt, required_flag, " + & "unit_code, rap_metric_maps.code from rap_metric_maps " choose case level_type case 'SRC' ls_sel_stmnt = ls_sel_stmnt + ", rap_source_codes where " + & "(rap_source_codes.metric_map_code = rap_metric_maps.source_code) and " + & "(rap_metric_maps.code = '" + metric_code + "') and " + & "(rap_source_codes.code = '" + source_code + "')" case 'DEV' ls_sel_stmnt = ls_sel_stmnt + ", rap_device_codes where " + & "(rap_metrDAT*hic_maps.source_code = '@' or " + & "rap_metric_maps.source_code = '" + source_code + "') and " + & "(rap_device_codes.metric_map_code = rap_metric_maps.device_code) and " + & "(rap_metric_maps.code = '" + metric_code + "') and " + & "(rap_device_codes.code = '" + device_code + "')" case 'PRO' ls_sel_stmnt = ls_sel_stmnt + ", rap_process_codes where " + & "(rap_metric_maps.device_code = '@' or " + & "rap_metric_maps.device_code = '" + device_code + "') and " + & "(rDAT*jap_metric_maps.source_code = '@' or " + & "rap_metric_maps.source_code = '" + source_code + "') and " + & "(rap_process_codes.metric_map_code = rap_metric_maps.process_code) and " + & "(rap_metric_maps.code = '" + metric_code + "') and " + & "(rap_process_codes.code = '" + process_code + "')" case 'STR' ls_sel_stmnt = ls_sel_stmnt + ", rap_stream_codes where " + & "((rap_metric_maps.material_code is not null and " + & "(rap_metric_maps.material_code = '@' or " + & DAT*l"rap_metric_maps.material_code = '" + ls_material_code + "')) or " + & "rap_metric_maps.material_code is null) and " + & "(rap_metric_maps.process_code = '@' or " + & "rap_metric_maps.process_code = '" + process_code + "') and " + & "(rap_metric_maps.device_code = '@' or " + & "rap_metric_maps.device_code = '" + device_code + "') and " + & "(rap_metric_maps.source_code = '@' or " + & "rap_metric_maps.source_code = '" + source_code + "') and " + & "(rap_stream_codes.DAT*nmetric_map_code = rap_metric_maps.stream_code) and " + & "(rap_metric_maps.code = '" + metric_code + "') and " + & "(rap_stream_codes.code = '" + stream_code + "')" end choose ls_sel_stmnt = ls_sel_stmnt + ' order by source_code desc, ' + & 'device_code desc, process_code desc, stream_code desc, ' + & 'material_code desc' DECLARE metricMapCursor DYNAMIC CURSOR FOR SQLSA; if f_db_error(SQLCA, "Fail on declaring dynamic cursor " + & "~nContact your technical support.") = 1 thenDAT*p return FALSE end if PREPARE SQLSA FROM :ls_sel_stmnt; if f_db_error(SQLCA, "Fail on preparing sqlsa" + & "~nContact your technical support.") = 1 then return FALSE end if OPEN DYNAMIC metricMapCursor; if f_db_error(SQLCA, "Fail on open dynamic cursor " + & "~nContact your technical support.") = 1 then return FALSE end if FETCH metricMapCursor INTO :ls_src_code, :ls_dev_code, :ls_pro_code, :ls_str_code, :ls_mat_code, :ldec_max_amt, :ldec_min_amt, :ls_required_flag, :DAT*rls_unit_code, :ls_metric_map_code; if sqlca.sqlcode = -1 then f_db_error(SQLCA, "Error selecting from rap_metric_maps" + & " table.~nContact your technical support.") CLOSE metricMapCursor; return FALSE end if // If not found, print error massage if sqlca.sqlcode = 100 then choose case level_type case 'SRC' err_msg = "Source Code '" + source_code + "' Metric Code '" + & metric_code + "' not found in rap_metric_maps or " + & "rap_source_codes table" CLOSEDAT*t metricMapCursor; return FALSE case 'DEV' err_msg = "Source Code '" + source_code + "' Device Code '" + & device_code + "' Metric Code '" + & metric_code + "' not found in rap_metric_maps or " + & "rap_device_codes table" CLOSE metricMapCursor; return FALSE case 'PRO' err_msg = "Source Code '" + source_code + "' Device Code '" + & device_code + "' Process Code '" + process_code + & "' Metric Code '" + metric_code + & "' not found in rap_metDAT*vric_maps or rap_process_codes table" CLOSE metricMapCursor; return FALSE case 'STR' err_msg = "Source Code '" + source_code + "' Device Code '" + & device_code + "' Process Code '" + process_code + & "' Stream Code '" + stream_code + & "' Metric Code '" + metric_code + & "' not found in rap_metric_maps or rap_stream_codes table" CLOSE metricMapCursor; return FALSE end choose end if close metricMapCursor; if f_db_error(SQLCA, "Fail on close dynaDAT*xmic cursor " + & "~nContact your technical support.") = 1 then return FALSE end if // Check to see if value data is required if ls_required_flag = 'Y' then if IsNull(act_value) then err_msg = 'Sorry! Value is required' return FALSE end if end if // Check to see if the unit conversion is needed if unit_code <> ls_unit_code then // Get unit conversion factor select rap_units_a.conversion_factor_amt, rap_units_b.conversion_factor_amt into :ldec_default_unit_fDAT*zactor, :ldec_user_unit_factor from rap_units rap_units_a, rap_units rap_units_b, rap_metrics where ( rap_units_a.code = :ls_unit_code ) and ( rap_metrics.meas_code = rap_units_a.meas_code ) and ( rap_metrics.meas_code = rap_units_b.meas_code ) and ( rap_metrics.code = :ls_metric_map_code ) and ( rap_units_b.code = :unit_code ); if f_db_error(SQLCA, "Fail on selecting unit conversion factor from " + & "rap_unit tablDAT*|e. Contact your technical support.") = 1 then return FALSE end if ldec_max_amt = ldec_max_amt * ldec_default_unit_factor / ldec_user_unit_factor ldec_min_amt = ldec_min_amt * ldec_default_unit_factor / ldec_user_unit_factor end if // Check to see if the value is within the valid range ldec_act_value = Dec(act_value) if Not (IsNull(ldec_max_amt) or IsNull(ldec_min_amt)) then if (ldec_act_value < ldec_min_amt) or (ldec_act_value > ldec_max_amt) then err_msg = 'Sorry! VaDAT*~lue must be between ' + & String(ldec_min_amt) + ' and ' + String(ldec_max_amt) + ' ' + & unit_code return FALSE end if elseif Not IsNull(ldec_max_amt) then if ldec_act_value > ldec_max_amt then err_msg = 'Sorry! Value must be not greater than ' + & String(ldec_max_amt) + ' ' + unit_code return FALSE end if elseif Not IsNull(ldec_min_amt) then if ldec_act_value < ldec_min_amt then err_msg = 'Sorry! Value must be not less than ' + & String(ldec_min_amt) + ' ' +DAT*` unit_code return FALSE end if end if // Pass QC check return TRUE end function DAT*  2 ) f_del_contact_reasonsf_db_error( onectac2  !,DAT*1u-X-$1!l- -$1-$1- $1d!-8(081"&*8X\`l"#$'d- nparentridtransbdeletencountnindd !(DAT*: f_del_Connections    2 % f_del_connectionsf_db_error(2  !,DAT*@ v@@ @- 10an@ 14u80F80,-,(-@$1l, d-H$1 u8<1 R-P$1!:- -X$1h1DAT*Rn-`$1-h$1d!-8p081,-80804FTn"#$%* ,*-.1:3h6l78;<>dO nparentridtransbdeletencountnindnridszselectionsqlsacur_calcs !(sa-l2DAT* >@ D>0 Select Rid from Rap_Calculation_Protocols where Rid = ?f_del_Cal_Protocolf_del_Cal_Protocol - Close failed@ H P X ` h 2 ; f_del_cal_protocolf_del_method_metricsf_db_errorP002  !,DAT*n@ 14u80F8>0,,p$1r, Xx$1u8081R$1!@, $1n1Rn$1$1dDAT*!8081,80804FTn "#$(*0.@0n3r4589;dP nparentridtransbdeletencountnindll_ridls_sqlsqlsaapp_cursqlca j@!(@-4 q;@ q@A>J@DAT* 0 select rid from rap_applications where source_rid = ?select rid from rap_applications where rid = ?appf_del_appf_del_app - Close failedp x     2 ' f_del_appf_del_docf_db_errorP2  !,DAT*Function to check if activity value is within the valid range for alphanumeric data typeglobal type f_qc_act_data_3 from function_object end type forward prototypes global function boolean f_qc_act_data_3 (string lookup_name, string act_value, string metric_code, ref string err_msg) end prototypes global function boolean f_qc_act_data_3 (string lookup_name, string act_value, string metric_code, ref string err_msg);///////////////////////////////////////////////////////////////////////////DAT* // // Function: f_qc_act_data_3 // // Purpose: // // Function f_qc_act_data_3 is to qc activity record before saving the // record into the database. The validation information is selected // from rap_metric table and the lookup table for the current metric // code. This function checks to see if value field is within the // valid range specified in the lookup table. The lookup table name // is stored in the lookup_name field of the rap_metrics table. // If any of the fielDAT*ds does not pass the validation check, the // function then returns FALSE; otherwise, it returns TRUE. // // Arguments: // lookup_name : string (lookup_name from rap_metrics, // contains the name of the lookup table) // act_value : string (value from rap_activities) // metric_code : string (metric_code from rap_activities) // err_msg : string (validation error message, pass by // reference) // // Returns : boolean // // DATE NAME REVISIDAT*ON // ---- ------------------------------------------------------------ // 7/20/94 SWJ INITIAL VERSION ///////////////////////////////////////////////////////////////////////// // Local variable declaration string ls_value, ls_value_list, ls_sql boolean lb_print=TRUE // Do not allow any null values for the following codes if IsNull(metric_code) then err_msg = 'Metric Code is null' return FALSE end if // Execute the sql statement based on the lookup_name field in the // rapDAT*_metrics table if lookup_name = "rap_metric_lookups" then // Check to see if value is valid declare valueCursor cursor for select valid_value_name from rap_metric_lookups where metric_code = :metric_code; open valueCursor; fetch valueCursor into :ls_value; // If metric_code not found in the rap_metric_lookups, print error msg if sqlca.sqlcode = 100 then err_msg = "Invalid Metric Code.~nMetric Code '" + metric_code + & "' not found in rap_metric_lookups table" DAT* close valueCursor; return FALSE elseif sqlca.sqlcode = -1 then f_db_error(SQLCA, "Fail on selecting valid_value_name on " + & "rap_metric_lookups table. Contact your technical support.") close valueCursor; return FALSE else do while sqlca.sqlcode = 0 // Concatenate all valid values into a list if IsNull(ls_value) then ls_value = 'none' end if ls_value_list = ls_value_list + ls_value + ' ' // If act_value is matched ls_value, this means the value DAT*is valid. // Do not print error message if act_value = ls_value then lb_print = FALSE exit end if fetch valueCursor into :ls_value; loop // If act_value not found in the list of valid values, print error msg if lb_print then err_msg = 'Sorry! Not a valid value.~nThe valid values are:~n' + & ls_value_list close valueCursor; return FALSE end if end if close valueCursor; elseif lookup_name = "rap_sic_codes" then // Construct sqlDAT* statement ls_sql = "select code from " + lookup_name + " where code = '" + & act_value + "'" declare codeCursor dynamic cursor for sqlsa; if f_db_error(SQLCA, "Fail on declaring dynamic cursor codeCursor. " + & "Contact your technical support.") = 1 then return FALSE end if prepare sqlsa from :ls_sql; if f_db_error(SQLCA, "Fail on preparing sqlsa. " + & "Contact your technical support.") = 1 then return FALSE end if open dynamic codeCursor; if f_db_error(SQLDAT*CA, "Fail on opening dynamic cursor codeCursor. " + & "Contact your technical support.") = 1 then return FALSE end if fetch codeCursor into :ls_value; // Check to see if value is valid if sqlca.sqlcode = 100 then err_msg = 'Sorry! Not a valid value' close codeCursor; return FALSE else if f_db_error(SQLCA, "Fail on fetching codeCursor cursor. " + & "Contact your technical support.") = 1 then close codeCursor; return FALSE end if end if close codeDAT*Cursor; if f_db_error(SQLCA, "Fail on closing dynamic cursor codeCursor. " + & "Contact your technical support.") = 1 then return FALSE end if end if // Pass QC check return TRUE end function DAT* a list of all the datawindow objects in the detail band. // Ls_detail_list[] will contain the name of all objects on datawindow // detail band. Note that these are returned in creation order, not // by position on the datawindow. li_detail_count = f_listobjects(pdw_obj, ls_detail_list, "*", "detail") //// Get the boundary of the arrays //li_str_count = UpperBound(pstr_record.string_arg) //li_long_count = UpperBound(pstr_record.long_arg) //li_date_count = UppperBound(pstr_record.date_arDAT*g) //li_dt_count = UpperBound(pstr_record.datetime_arg) //li_time_count = UpperBound(pstr_record.time_arg) //li_dec_count = UpperBound(pstr_record.decimal_arg) // For each object for li_cur_obj = 1 to li_detail_count // For each object, get the type of the object ls_obj_type = pdw_obj.Describe(ls_detail_list[li_cur_obj] + ".type") // For each object, get the type of the object ls_obj_type = pdw_obj.Describe(ls_detail_list[li_cur_obj] + ".type") // Only set the value when tDAT*he object type is column if ls_obj_type = 'column' then ls_data_type = & Left(pdw_obj.Describe(ls_detail_list[li_cur_obj] + & ".coltype"), 5) // Get the data value of the object and store it in a instance // structure choose case ls_data_type case 'char(' pdw_obj.SetItem(ll_cur_row, ls_detail_list[li_cur_obj], & pstr_record.string_arg[li_str_count]) li_str_count = li_str_count + 1 case 'decim' // 1/3/95-JNS-modified to handle inDAT*teger copy for those // numeric values declared as decimal, but 0 significant // digits // 3/98 -mlk changed int to long to handle big numbers // 10/02-MDY-modified to correctly read the number of decimal places. // previously, only the first digit was being read. //grab everything right of "decimal(" - MDY ls_tmp_data = Mid( pdw_obj.Describe(ls_detail_list[li_cur_obj] + ".coltype"), 9) //Mid( pdw_obj.Describe(ls_dDAT*etail_list[li_cur_obj] + ".coltype"), 9,1) //removed-MDY //strip the ")" - MDY ls_tmp_data = left(ls_tmp_data, len(ls_tmp_data) - 1) if ls_tmp_data = '0' then ll_dec_data = pstr_record.decimal_arg[li_dec_count] pdw_obj.SetItem(ll_cur_row, ls_detail_list[li_cur_obj], & ll_dec_data) else ls_dec_data = String(pstr_record.decimal_arg[li_dec_count]) ls_dec_data = Left(ls_dec_data, & Pos(ls_dec_data, '.') + Integer(ls_tmp_dDAT*Retrieves the valid values for any code DropDownDataWindow (used in PowerBuilder 3 source detail report only)global type f_retrieve_codes from function_object end type forward prototypes global subroutine f_retrieve_codes (string win_title, datawindow dw_obj, string fld_name, string dw_fld_name) end prototypes global subroutine f_retrieve_codes (string win_title, datawindow dw_obj, string fld_name, string dw_fld_name);// This function retrieves the valid values for any code DropDownDataWiDAT*ndow // 06/10/94, JBWilcox, Added rowcount function DataWindowChild dwc if dw_obj.GetChild(fld_name, dwc) = -1 then MessageBox(win_title, "Application Error:~n" + fld_name + " - " + & "Not a DataWindowChild.~nContact your technical support.") return end if // If the first value for code is 0 (the dddw has not been retrieved yet), // retrieve a list of valid codes for this dddw if dwc.rowcount() <> 0 then if dwc.GetItemString(1, dw_fld_name) = '0' then dwc.SetTransObjecDAT*ut(SQLCA) dwc.Retrieve() end if else dwc.SetTransObject(SQLCA) dwc.Retrieve() end if end subroutine DAT*ata)) pdw_obj.SetItem(ll_cur_row, ls_detail_list[li_cur_obj], & Dec(ls_dec_data)) end if li_dec_count = li_dec_count + 1 case 'real' // 3/98-mlk added real data types- store data in decimal_arg array pdw_obj.SetItem(ll_cur_row, ls_detail_list[li_cur_obj], & pstr_record.decimal_arg[li_dec_count]) li_dec_count = li_dec_count + 1 case 'numbe' pdw_obj.SetItem(ll_cur_row, ls_detail_list[li_cur_obj], & pstr_recorDAT*d.long_arg[li_long_count]) li_long_count = li_long_count + 1 case 'date' pdw_obj.SetItem(ll_cur_row, ls_detail_list[li_cur_obj], & pstr_record.date_arg[li_date_count]) li_date_count = li_date_count + 1 case 'datet' pdw_obj.SetItem(ll_cur_row, ls_detail_list[li_cur_obj], & pstr_record.datetime_arg[li_dt_count]) li_dt_count = li_dt_count + 1 case 'time' pdw_obj.SetItem(ll_cur_row, ls_detail_list[li_cur_obj], & pstr_record.time_arg[DAT*li_time_count]) li_time_count = li_time_count + 1 case else pdw_obj.SetItem(ll_cur_row, ls_detail_list[li_cur_obj], & pstr_record.string_arg[li_other_count]) li_other_count = li_other_count + 1 if IsNull(ls_data_type) then ls_data_type = 'none' end if MessageBox("Paste Record", "Date type '" + ls_data_type + & "' of column " + ls_detail_list[li_cur_obj] + & "not included in the program.~n" + & "The value of the column not copied")DAT* 14u80F890,-,$-h$1N, `-p$111R-x$1!- -$1J1Rn-$1-$1d!-808DAT*1,-80804FTn"#$%*, -13J6N78;<>dM nparentridtransbdeletencountnindnridszselectionsqlsaact_cur j@!(@-2 A>@ q@D>0 Select Rid from Rap_Activities whDAT*ere Ref_Rid = ?Select Rid from Rap_Activities where Rid = ?unf_del_Activitiesf_del_Activities - Close failedh p x    2 $ f_del_activitiesf_db_error<2  !,DAT*-"$%.'(),-/568:9>:N>j@vdH dw_parentdw_childcolnameselectedrowfiltfound_rownum_chars   #/ ,4h>|0 gettextLower()>=""find&getitemstring[4scrolltorowLselectrowA`` , D X l t 2 DAT*Function to retrieve connection information from rap_connections table and fills out the d_connect datawindow bufferglobal type f_retrieve_connections from function_object end type forward prototypes global subroutine f_retrieve_connections (long devicerid, datawindow dwname) end prototypes global subroutine f_retrieve_connections (long devicerid, datawindow dwname);// This function retrieve connection information from rap_connections table // and fills out the d_connect datawindow buffeDAT*r long fromDevRid, toDevRid, capture, counter string name // Fill out datawindow buffer for input device id declare fromConnectCursor cursor for select from_device_rid, capture_efficiency_perc, name from rap_connections where to_device_rid = :deviceRid; open fromConnectCursor; fetch fromConnectCursor into :fromDevRid, :capture, :name; counter = 1 do while sqlca.sqlcode = 0 dwName.SetItem(counter, "io", "I") dwName.SetItem(counter, "device_rid", fromDevRid) dwName.DAT*SetItem(counter, "name", name) dwName.SetItem(counter, "capture_efficiency_perc", capture) counter = counter + 1 fetch fromConnectCursor into :fromDevRid, :capture, :name; loop close fromConnectCursor; // Fill out datawindow buffer for output device id declare toConnectCursor cursor for select to_device_rid, capture_efficiency_perc, name from rap_connections where from_device_rid = :deviceRid; open toConnectCursor; fetch toConnectCursor into :toDevRid, :capture, :nameDAT*; counter = 1 do while sqlca.sqlcode = 0 dwName.SetItem(counter, "io", "O") dwName.SetItem(counter, "device_rid", toDevRid) dwName.SetItem(counter, "name", name) dwName.SetItem(counter, "capture_efficiency_perc", capture) counter = counter + 1 fetch toConnectCursor into :toDevRid, :capture, :name; loop close toConnectCursor; //// If there is a database error (return value = 1), stop the system; //if f_db_error(SQLCA, "Fail on selecting maximun value of rid from " + &DAT*m // " rid_storage table.~nContact your technical support.") = 1 then // halt //end if end subroutine DAT*{ f_dddw_search2  /8DAT*$z&88z&8z%$z&88z&8z%$z&88z&8z% $z&88z&8z%0$z&88z&88z%T$8z(88z&8\z%x$z&88z&@8,8$81 !*".#D$%&'0(b)*DAT*+,<.n014dF at_error_objectas_error_msgls_stringw_db_errorgs_databased  % v/@ de:@`  Transaction Error Code :  Database Error Code : DBMS : Database : %User ID : (DBParm : Login ID : ServerDAT*Name : lAutoCommit : d Database Error Message : ORACLE  0 X |      0 T x  2 ; f_db_errorf_boolean_to_stringf_oracle_connection<'2  % DAT* ( ( .end_date_time IS NULL OR .end_date_time >= ) AND ( .start_date_time <= ) )2 ) f_date_rangef_compare_date_time<2  &,DAT*Function to retrieves the valid values for any code DropDownDataWindowglobal type f_retrieve_county_city from function_object end type forward prototypes global subroutine f_retrieve_county_city (string win_title, datawindow dw_obj, string fld_name, string dw_fld_name) end prototypes global subroutine f_retrieve_county_city (string win_title, datawindow dw_obj, string fld_name, string dw_fld_name);// This function retrieves the valid values for any code DropDownDataWindow DataWindowChiDAT*ld dwc if dw_obj.GetChild(fld_name, dwc) = -1 then MessageBox(win_title, "Application Error:~n" + fld_name + " - " + & "Not a DataWindowChild.~nContact your technical support.") return end if // If the first value for code is 0 (the dddw has not been retrieved yet), // retrieve a list of valid codes for this dddw if dwc.GetItemNumber(1, dw_fld_name) = 0 then dwc.SetTransObject(SQLCA) dwc.Retrieve() end if end subroutine DAT*REATE VIEW Fail on creating view . Contact your technical support2 ! f_create_viewf_db_error(2  " DAT*81p8080@818080@81}(<=8z%) 988$<=8z%)$981o@o9868,-4$< <=)L81<R}$8TDAT*-\$ < <=Jt8  1<R}$8|-$ < <=J8  1<R}$8t-$ < <=)8  1<R}$8-$ < <=)8  1<R}$8d-DAT*$ < <=)8  1<R}$8- $ < <=J8  1<R}$-$< 8$01<R}+./40N1h236<?@.A>BfClDEILOP(V|XY[]^``b|ceghjTlpmoqrtDv`xxz|$dl8 pdwDAT*Used in select statement to substitute today's date for null values in a datetime columnglobal type f_retrieve_date from function_object end type forward prototypes global function string f_retrieve_date (transaction p_trans, string ps_datetime_column) end prototypes global function string f_retrieve_date (transaction p_trans, string ps_datetime_column);// This function returns a string that is used in a SELECT clause to substitute // today's date for NULL values in a datetime column. DDAT*one so that // data can be sorted in descending order by the datetime column. This function is // DBMS dependent. string s_result if gs_database = 'ORACLE' then s_result = 'nvl( ' + ps_datetime_column + ', sysdate )' else if gs_database = 'ODBC' then s_result = 'IsNull( ' + ps_datetime_column + ', now(*), ' + ps_datetime_column + ' )' else s_result = ps_datetime_column end if end if RETURN s_result end function DAT*_objpstr_recordls_empty  ls_detail_list ls_obj_typels_data_typeli_detail_countli_cur_objli_str_countli_long_countli_date_countli_dt_countli_time_countli_dec_countli_other_countll_cur_rowll_emptyld_empty ldt_empty lt_empty ldec_empty> case86(D(@X  (-D4-PDAT* \ iy-- (-@4- XL>-d % string_arglong_argdate_arg0 datetime_arg Dtime_arg\ decimal_argpdw_data_objecDAT*global type f_arraystring from function_object end type forward prototypes global function string f_arraystring (string as_stringarray[]) end prototypes global function string f_arraystring (string as_stringarray[]); //converts a string array into a comma delimited list of quoted strings //primary usage is for IN expressions for SQL, find and filter functions //MDY May 2001 integer li_i integer li_ub string ls_arrayString li_ub = upperbound(as_stringArray) for li_i = 1 to li_uDAT*b ls_arrayString += "'" + as_stringArray[li_i] + "'" if li_i < li_ub then ls_arrayString += "," end if next return ls_arrayString end function DAT*Function to retrieve data for group type dddwglobal type f_retrieve_group_types from function_object end type forward prototypes global subroutine f_retrieve_group_types (window p_win, datawindow p_dw, string p_metric_level) end prototypes global subroutine f_retrieve_group_types (window p_win, datawindow p_dw, string p_metric_level);DataWindowChild dwc if p_dw.GetChild("group_type", dwc) = -1 then MessageBox(p_win.Title, "Application Error:~nGroup Type - " + & "Not a DataWindowChDAT*ild.~nContact your technical support.") return end if dwc.SetTransObject(SQLCA) dwc.Retrieve(p_metric_level) end subroutine DAT*t_*detailgetrowCopy RecordNo row is currentError - GetRow() in wf_copy_record.typedescribejcolumn.coltypejchar(getitemstring<decimpgetitemnumber dnumbe ddate0 getitemdatedatetDgetitemdatetimetime\ getitemtimerealp d ( < T h |      $ 4 LDAT*global type f_arraysearch from function_object end type forward prototypes global function integer f_arraysearch (string as_comparestring, string as_stringArray[]) end prototypes global function integer f_arraysearch (string as_comparestring, string as_stringArray[]);integer li_index, li_indexcount as_compareString = upper(as_compareString) li_indexcount = upperbound(as_stringArray) //loop through the array until match is found if li_indexcount > 0 then for li_index = 1 to lDAT*i_indexcount if upper(as_stringArray[li_index]) = as_compareString then return li_index end if next end if return 0 end function DAT* \ t             2 $ f_copy_recordf_listobjects( rclicas2   DAT*m:ssORACLEto_date('', 'yyyy-mm-dd hh24:mi:ss')'2  f_compare_date_time+N2   DAT*1<8l08u8z%8z&@811 "0fv!%'(d- pl_material_ridli_group_countsqlca<Q'@ Fail on counting group member records on rap_group_members table. Contact your technical support.MaterialCan not delete the current record until related records are first deleted. No changes made DAT*to database.2 ' f_check_matrl_groupf_db_error(2  DAT* 8J8 1   "!8088'z%8az&@89  1 99> b t d pdw_objpl_ridps_levelldt_startldt_endls_metricls_value_typels_materialls_datals_refll_cur_rowll_ridll_act_rid  tct en de* ag2DAT*Function to retrieve some location related dddws in contact user objectglobal type f_retrieve_locations from function_object end type forward prototypes global subroutine f_retrieve_locations (window p_win, datawindow p_dw, string p_column, string p_sql, long p_city, long p_state, long p_nation) end prototypes global subroutine f_retrieve_locations (window p_win, datawindow p_dw, string p_column, string p_sql, long p_city, long p_state, long p_nation);DataWindowChild dwc string ls_meas_cDAT*ode, ls_err, ls_old_sql string ls_sql = "DataWindow.Table.Select=~"" string ls_sort_criteria ls_old_sql = ls_sql if p_sql <> "error" then if p_dw.GetChild(p_column, dwc) = -1 then MessageBox(p_win.title, "Application Error:~n" + p_column + " - " + & "Not a DataWindowChild.~nContact your technical support.") return end if ls_sql = ls_sql + p_sql ls_sort_criteria = "" if p_column = "mail_city_rid" then // JNS - THE FOLLOWING CODE WAS UPDATED TO INCREASE PERFORMANCE DAT* - 10/25/94 // if not isnull(p_state) then // ls_sql = ls_sql + " and rap_geographic_locations_c.rid = " + string(p_state) // end if // if not isnull(p_nation) then // ls_sql = ls_sql + " and rap_geographic_locations_d.rid = " + string(p_nation ) // end if // ls_sql = ls_sql + " order by 1,2,3 " if not isnull(p_state) then ls_sql = ls_sql + " and State.rid = " + string(p_State) + & " and County.parent_rid = State.rid " + & DAT*  " and City.parent_rid = County.rid" else if not isnull(p_nation) then ls_sql = ls_sql + " and Nation.rid = " + string(p_nation) + & " and State.parent_rid = Nation.rid " + & " and County.parent_rid = State.rid " + & " and City.parent_rid = County.rid" end if end if //ls_sort_criteria = "rap_geographic_locations_city A" // JNS - SORTING IS KILLING PERFORMANCE - OMIT SORT - 10/25/94 // lDAT*s_sql = ls_sql + " order by 1,2,3 " elseif p_column = "mail_state_rid" then // JNS - THE FOLLOWING CODE WAS UPDATED TO INCREASE PERFORMANCE - 10/25/94 // if not isnull(p_city) then // ls_sql = ls_sql + " and rap_geographic_locations_a.rid = " + string(p_city) // end if // if not isnull(p_nation) then // ls_sql = ls_sql + " and rap_geographic_locations_d.rid = " + string(p_nation) // end if // ls_sql = ls_sql + " order by 1,2 " // if not isnull(p_city) then // ls_sql DAT*= ls_sql + " and State.rid = " + string(p_city) + & // " and Nation.rid = City.parent_rid " + & // " and State.rid = County.parent_rid" // end if if not isnull(p_nation) then ls_sql = ls_sql + " and State.parent_rid = " + string(p_nation) end if ls_sort_criteria = "rap_geographic_locations_nation A, rap_geographic_locations_state A" // ls_sql = ls_sql + " order by 1,2 " elseif p_column = "mail_country_rid" then // JNS - THE FOLLOWDAT*ING CODE WAS UPDATED TO INCREASE PERFORMANCE - 10/25/94 // if not isnull(p_city) then // ls_sql = ls_sql + " and rap_geographic_locations_a.rid = " + string(p_city) // end if // if not isnull(p_state) then // ls_sql = ls_sql + " and rap_geographic_locations_c.rid = " + string(p_state) // end if // ls_sql = ls_sql + " order by 1 " if not isnull(p_state) then ls_sql = ls_sql + " and rap_geographic_locations.rid = (Select parent_rid from rap_geographic_locations where typeDAT* = 'STATE' and rid = " + string(p_state) + ")" else if not isnull(p_city) then ls_sql = ls_sql + " and rap_geographic_locations.rid = (Select parent_rid from rap_geographic_locations where type = 'STATE' and " + & "rid = (Select parent_rid from rap_geographic_locations where type = 'COUNTY' and " + & "rid = (Select parent_rid from rap_geographic_locations where type = 'CITYDAT*' and " + & "rid = " + string(p_city) + ")))" end if end if ls_sort_criteria = "rap_geographic_locations_nation A" // ls_sql = ls_sql + " order by 1 " end if ls_sql = ls_sql + "~"" //messagebox("debug", ls_sql) ls_err = dwc.Modify(ls_sql) if ls_err <> "" then MessageBox("Modify Failed", ls_err) return end if end if dwc.SetTransObject(SQLCA) dwc.Retrieve() if ls_sort_criteria <> "" then dwc.SetSDAT*Bort(ls_sort_criteria) dwc.Sort() end if end subroutine DAT* li< wiJ pV do^ roepwH getrowstart_date_timegetitemdatetime(end_date_timeSN(metric_codegetitemstring@dvalue_typeidmaterial_codeerddata_codepedreference_codeodridgetitemnumber ActivityStart Date Time, End Date Time, Metric Code, Value Type, Material Code, Data Code, and RefereDAT**nce Code must be unique in table rap_activities 8 P t      2 + f_check_dup_actf_get_activity_rid(2  ,DAT* z%z&8jz&:)@@8)89"#8T08z%z&:)@@8)899,X  b!z#$%&'*dg fcurdwcur_rowfirst_datesecond_datefirst_textsecond_textbdateedatedate1_typedate2_type  " DAT*q end choose end if next // next object // Paste record successfully return TRUE end function DAT*". 9 E K Q \ 0 .ColTypedescribejjDATETIMEgetitemdate55Error must exist if existsscrolltorow?r must be before ?r $ D L   2 ' f_check_dates_ntf_check_dates(2  EPDAT*DAT*&Retrieves the valid values for metric code DropDownDataWindowglobal type f_retrieve_metric_codes from function_object end type forward prototypes global subroutine f_retrieve_metric_codes (window win_obj, datawindow dw_obj, string level_type, string source, string device, string process, string stream) end prototypes global subroutine f_retrieve_metric_codes (window win_obj, datawindow dw_obj, string level_type, string source, string device, string process, string stream);// This functionDAT*( retrieves the valid values for metric code DropDownDataWindow DataWindowChild dwc if dw_obj.GetChild("metric_code", dwc) = -1 then MessageBox(win_obj.Title, "Application Error:~nMetric Code - " + & "Not a DataWindowChild.~nContact your technical support.") return end if // If the first value for code is 0 (the dddw has not been retrieved yet), // retrieve a list of valid codes for this dddw if dwc.GetItemString(1, "code") = '0' then // Get handle to dddw for the new DatDAT**aObject if dw_obj.GetChild("metric_code", dwc) = -1 then MessageBox(win_obj.Title, "Application Error:~nMetric Code - " + & "Not a DataWindowChild.~nContact your technical support.") return end if // Set the transaction object to the child dwc.SetTransObject(SQLCA) // Perform the retrieve if level_type = 'GEO' then dwc.Retrieve(level_type) elseif level_type = 'LEG' then dwc.Retrieve(level_type) elseif level_type = "SRC" then dwc.Retrieve(souDAT*rce) elseif level_type = "DEV" then dwc.Retrieve(device, source) elseif level_type = "PRO" then dwc.Retrieve(process, source, device) elseif level_type = "STR" then dwc.Retrieve(stream, source, device, process) end if end if end subroutine DAT*.z&8jz&:)@@8)89"#8T08z%z&:)@@8)899,X  b!z#$%&'*dg fcurdwcur_rowfirst_datesecond_datefirst_textsecond_textbdateedatedate1_typedate2_type  caur vi" sc.DAT* e9 stE teK owQ on\ 0 .ColTypedescribejjDATEgetitemdatetime11Error must exist if existsscrolltorow?r must be before ?r $ D L   2 ' f_check_datesf_check_dates_nt(2  EPDAT*21<R@81Vz%z&f66!&"B#n$~&'(*,.,/Z123458"96:R;V>f@jd[ origwidthls_crlfls_tokenls_resultls_curr_chrli_curr_posli_ascii_valli_posi   $ . :FSDAT* 2  f_block_text 2   DAT*6"p$66808* 4d; dw_objwin_objlevelcode_valuels_col_namecase5x  P v ( 4  getcolumnname^@codematerial_codevalue_unit_codeprimary_material_codeweekly_schedule_codedaily_schedule_codedata_code method_typevalue_typemode_typereference_typDAT*e type   2 - f_act_dddw_retrievef_retrieve_codes<2  (8DAT*:Function to retrieve unit code dddwglobal type f_retrieve_unit_codes from function_object end type forward prototypes global function long f_retrieve_unit_codes (window p_win, datawindow p_dw, string p_sql, string p_metric_code) end prototypes global function long f_retrieve_unit_codes (window p_win, datawindow p_dw, string p_sql, string p_metric_code);// Function: f_retrieve_unit_codes // // Returns: long - the number of the rows retrieved for the child dw; // 0 if no rows retriDAT*<eved; // -1 if an error occurs. // Log: // When Who What // -------- ----- ---------------------------- // 8/27/96 SWJ Added return value DataWindowChild dwc string ls_meas_code, ls_err string ls_sql = "DataWindow.Table.Select=~"" if p_sql <> "error" then if p_dw.GetChild("value_unit_code", dwc) = -1 then if p_dw.GetChild("unit_code", dwc) = -1 then MessageBox(p_win.title, "Application Error:~n" + "Value Unit Code - " + & "Not a DataWindowChild.~nContactDAT*> your technical support.") return -1 end if end if if isnull(p_metric_code) or len(trim(p_metric_code)) = 0 then ls_sql = ls_sql + p_sql + "~"" else select meas_code into :ls_meas_code from rap_metrics where code = :p_metric_code; if isnull(ls_meas_code) then // ls_sql = ls_sql + p_sql + "~"" // Do not populate unit code dddw if measurement code is null dwc.Reset() return 0 else ls_sql = ls_sql + p_sql + " where DAT*meas_code = " + "'" + ls_meas_code + "'" + "~"" end if end if ls_err = dwc.Modify(ls_sql) if ls_err <> "" then MessageBox("Modify Failed", ls_err) return -1 end if end if dwc.SetTransObject(SQLCA) return dwc.Retrieve() end function DAT*; #DAT*carch2  7 DAT*F"#$&d al_blocklimitaa_inarrayaa_outarrayll_inindll_inicll_outindll_segmentla_segmentla_clearvie$<|$-<0-HQYc|n-- 2 % f_array_breakarrayintoblocksDAT*G2  H,DAT*J80808}1}n<=8z%)98<=8z%)988<=8z%)981o@o9868<=-$ <=6)8  1<R}8<=8DAT*Lz%)981 @981Yo@o88- $<C<=)(8-0$<C2(@(888@86e@e8<Ro@o8<=6%@%8i)<81<R}8DP<=-DAT*NL$<C2)T81<R}8\<=-l$ <=)t8  1<R}8|@<=-$ <=3)8  1<R}8<=-$ <=5)8  1<R}84<=-$ <DAT*P=4)8  1<R}<=-$<=6)81<R}808(08z%8z&<=z&8z&8,z&@8d9#&'@(h,r-./012 9DNG|JMNTTVdWxY[dgFhtijlmnppsuwy0{L|d~ <T04zDAT*Rd pdw_objpstr_recordls_detail_list ls_obj_typels_data_typels_tmp_datals_dec_datali_detail_countli_cur_objli_str_countli_long_countli_date_countli_dt_countli_time_countli_dec_countli_other_countll_cur_rowll_dec_datacase84,|  ,-vi8 scD eQ st] teiowyonnaDAT*Targloras O dw_data_objectPaste RecordNothing to paste fromgetrowKNo row is currentError - GetRow() in wf_copy_record*detail.typedescribejjcolumn.coltypejchar(string_argsetitemPdecim8j0decimal_argO.ODAT*VrealOnumbelong_argbOdatedate_arg Odatetdatetime_argOtimetime_arg! OPnoneDate type '' of column not included in the program. The value of the column not copied  T         ( 0 < L T l t         2 % f_pDAT*aste_recordf_listobjects(2   DAT*Z 8.08>08} 8.08F08}+}1}X1<`6}16<| }*8M)h8e@e8} 16<D | }*8p)8e@e8} 16< | }*8)8e@e8} 1DAT*|6<  | }*8)8e@e8}}11}+*<<R<b<18011:@:@99@ 8 <1@8-1<R}<8-(@(8z'11x@8<@8+1} 1}   , <DAT*^Creates a configuration file used to initialize SASglobal type f_sas_config from function_object end type forward prototypes global function boolean f_sas_config (string ps_mode, string ps_output_file, string ps_log_file, string ps_name, string ps_geinidir, ref string ps_newconfig, ref string ps_sasdir, ref string ps_userdir, ref string ps_sasexe, ref string ps_key) end prototypes global function boolean f_sas_config (string ps_mode, string ps_output_file, string ps_log_file, string ps_naDAT*`me, string ps_geinidir, ref string ps_newconfig, ref string ps_sasdir, ref string ps_userdir, ref string ps_sasexe, ref string ps_key);// f_sas_config // // parameters // 1: ps_mode = SAS execution mode, Batch or Interactive (string) // 2: ps_output_file = name of SAS output report file (string) // 3: ps_log_file = name of SAS log file (string) // 4: ps_name = name of new SAS config file (no directory) (string) // 5: ps_geinidir = Main directory where GEINI programs are stored (stDAT*bring) // 6: ps_newconfig = Name of newly created SAS config file (string) // 7: ps_sasdir = SAS application directory name (string) // 8: ps_userdir = SAS user profile directory name (string) // 9: ps_sasexe = Directory where sas.exe resides (string) // 10: ps_key = name of parameter missing from the rapids.ini file (string) // // creates a SAS configuration file and // returns boolean true or false, true = config file was created properly // and if false, returns the name of theDAT*d missing parameter from rapids.ini // string ls_print, ls_log, ls_change_config, ls_file, ls_write_line, ls_b, & ls_configfile, ls_charset, ls_formchar, & ls_ini = gs_iniFile, & ls_sas = "sas", & ls_not_found = "not found" integer li_file_num, li_fnum, li_loops, li long ll_flen, ll_bytes_read, ll_new_pos // Get the values of all of the parameters from sas section in rapids.ini ps_key = "sasdir" ps_sasdir = ProfileString(ls_ini, ls_sas, ps_key, ls_not_found) if ps_sasdir = lDAT*fs_not_found or ps_sasdir = '' then return FALSE end if ps_key = "sasexe" ps_sasexe = ProfileString(ls_ini, ls_sas, ps_key, ls_not_found) if ps_sasexe = ls_not_found or ps_sasexe = '' then return FALSE end if ps_key = "userdir" ps_userdir = ProfileString(ls_ini, ls_sas, ps_key, ls_not_found) if ps_userdir = ls_not_found or ps_userdir = '' then return FALSE end if ps_key = "config" ls_configfile = ProfileString(ls_ini, ls_sas, ps_key, ls_not_found) if ls_configfile = ls_not_fDAT*hound or ls_configfile = '' then return FALSE end if ps_key = "charset" ls_charset = ProfileString(ls_ini, ls_sas, ps_key, ls_not_found) if ls_charset = ls_not_found or ls_charset = '' then return FALSE end if ps_key = "formchar" ls_formchar = ProfileString(ls_ini, ls_sas, ps_key, ls_not_found) if ls_formchar = ls_not_found or ls_formchar = '' then return FALSE end if ps_key = '' // create the name of the new config file (return parameter) ps_newconfig = ps_userdir + '\' +DAT*j ps_name // Config varies according to the mode: batch or interactive if ps_mode = 'Batch' then ls_print = '-print' ls_log = '-log' else ls_print = '-altprint' ls_log = '-altlog' end if // Check to see if the standard config SAS file exists. If it does not // exist, processing cannot continue. if not FileExists(ls_configfile) then MessageBox(Upper(ls_configfile), "File does not exist.", StopSign!) return FALSE end if // Check to see if the new config file already DAT*lexists. If it exists, // overwrite the file if FileExists(ps_newconfig) then li_file_num = FileOpen(ps_newconfig, LineMode!, Write!, LockReadWrite!, & Replace!) // Otherwise, create the file else li_file_num = FileOpen(ps_newconfig, LineMode!, Write!, LockReadWrite!, & Append!) end if // Error checking if li_file_num = -1 then MessageBox(Upper(ps_newconfig), "Error opening file.", StopSign!) return FALSE end if // Now copy the contents of the standard SAS config fileDAT*n to the new config file ll_flen = FileLength(ls_configfile) if ll_flen = -1 then MessageBox(Upper(ls_configfile), "Error opening the file.", StopSign!) FileClose(li_file_num) return FALSE end if li_fnum = FileOpen(ls_configfile, streammode!, read!, lockreadwrite!) if li_fnum = -1 then MessageBox(Upper(ls_configfile), "Error opening the file.", StopSign!) FileClose(li_file_num) return FALSE end if if ll_flen > 0 then // Determine how many FileRead calls are needed to readDAT*p the // entire file. IF ll_flen > 32765 THEN IF Mod(ll_flen, 32765) = 0 THEN li_loops = ll_flen/32765 ELSE li_loops = (ll_flen/32765) + 1 END IF ELSE li_loops = 1 END IF FOR li = 1 to li_loops ll_bytes_read = FileRead(li_fnum, ls_b) if ll_bytes_read = -1 then MessageBox(Upper(ls_configfile), "Error reading file", StopSign!) FileClose(li_fnum) FileClose(li_file_num) return FALSE end if if ll_bytes_read > 0 then // check for end of fiDAT*rle. substitute with a new line if found. if right(ls_b, 1) = char(26) then if ll_bytes_read > 1 then ls_b = left(ls_b, ll_bytes_read - 1) + '~n' else ls_b = '~n' end if end if if FileWrite(li_file_num, ls_b) = -1 then MessageBox(Upper(ps_newconfig), "Error writing file", StopSign!) FileClose(li_fnum) FileClose(li_file_num) return FALSE end if end if ll_new_pos = ll_new_pos + ll_bytes_read FileSeek(li_fnum, ll_new_pos, FromBegDAT*tinning!) NEXT end if // Write the parameters to the end of the file ls_write_line = '-SET DCDIR ' + ps_geinidir if FileWrite(li_file_num, ls_write_line) = -1 then MessageBox(Upper(ps_newconfig), "Error writing~n" + ls_write_line + & "~n to the file", StopSign!) FileClose(li_file_num) return FALSE end if ls_write_line = '-SET USERDIR ' + ps_userdir if FileWrite(li_file_num, ls_write_line) = -1 then MessageBox(Upper(ps_newconfig), "Error writing~n" + ls_write_line + & "~DAT*vn to the file", StopSign!) FileClose(li_file_num) return FALSE end if ls_write_line = ls_print + ' ' + ps_output_file if FileWrite(li_file_num, ls_write_line) = -1 then MessageBox(Upper(ps_newconfig), "Error writing~n" + ls_write_line + & "~n to the file", StopSign!) FileClose(li_file_num) return FALSE end if ls_write_line = ls_log + ' ' + ps_log_file if FileWrite(li_file_num, ls_write_line) = -1 then MessageBox(Upper(ps_newconfig), "Error writing~n" + ls_write_line + & DAT*x "~n to the file", StopSign!) FileClose(li_file_num) return FALSE end if ls_write_line = '-sasuser ' + ps_userdir if FileWrite(li_file_num, ls_write_line) = -1 then MessageBox(Upper(ps_newconfig), "Error writing~n" + ls_write_line + & "~n to the file", StopSign!) FileClose(li_file_num) return FALSE end if ls_write_line = '-wincharset ' + ls_charset if FileWrite(li_file_num, ls_write_line) = -1 then MessageBox(Upper(ps_newconfig), "Error writing~n" + ls_write_line + & "~DAT*zn to the file", StopSign!) FileClose(li_file_num) return FALSE end if ls_write_line = '-formchar ' + ls_formchar if FileWrite(li_file_num, ls_write_line) = -1 then MessageBox(Upper(ps_newconfig), "Error writing~n" + ls_write_line + & "~n to the file", StopSign!) FileClose(li_file_num) return FALSE end if ls_write_line = '-echoauto' if FileWrite(li_file_num, ls_write_line) = -1 then MessageBox(Upper(ps_newconfig), "Error writing~n" + ls_write_line + & "~n to the file",DAT* StopSign!) FileClose(li_file_num) return FALSE end if // Close the file if FileClose(li_fnum) = -1 then MessageBox(Upper(ls_configfile), "Error closing file", StopSign!) FileClose(li_file_num) end if if FileClose(li_file_num) = -1 then MessageBox(Upper(ps_newconfig), "Error closing file", StopSign!) end if // function was successful! return TRUE end function DAT*~=8z%)98 <=8z%)98e@e8} <=8 z%)98e@e8}( <=8z%) 98e@e8}' <=8(z%)098e@e8}5 <=88z%)D98<<R}+<<R} <=8Lz%)X98DAT* <=8`z%)p98 <=8xz%)98 <=8z%)98 <=8z%)98 <=8z%)98  <=8z%)98#6e@e8<}##1<`}7687j!:@$ 87!:@$DAT* 8,7!:@$ 87!:@$ 87 !:@$ 87$ !:@8688Z ":@ 88 ":@ 8,8 ":@8 $9} $9} 8 %9} %9}<16#6e@e8"!$%@ 8 <1@8DAT* <=8z%)988* <1 <Y1 <Y'1<R(1 @89689  <=8 z%)98)<6@8}:568: ')<<Y<<R}V 8,:V ')<<Y5 Ik<<R}<6@DAT*88(98/9"8(  <=87z%)@981o@o98l  <=8Hz%)P981o@o98;68X; < <=)l88t;f2 <=8zz%)98< <=J8;26)@)88;DAT*2 <=8zz%)98< <=)826)@)88;2 <=8zz%)98< <=)826)@)88;>2 <=8zz%)98< <=J8;26)@)88;2 <DAT*Saves the toolbar attribute setting into application ini fileglobal type f_save_toolbar_profile from function_object end type forward prototypes global subroutine f_save_toolbar_profile (string window_name, window window_parm) end prototypes global subroutine f_save_toolbar_profile (string window_name, window window_parm);string bar_visible, bar_align, bar_showtext int bar_x, bar_y, bar_width, bar_height if window_parm.toolbarvisible then bar_visible = "yes" else bar_visible = "no"DAT* end if if window_parm.toolbaralignment = alignatbottom! then bar_align = "bottom" elseif window_parm.toolbaralignment = alignatleft! then bar_align = "left" elseif window_parm.toolbaralignment = alignatright! then bar_align = "right" elseif window_parm.toolbaralignment = alignattop! then bar_align = "top" elseif window_parm.toolbaralignment = floating! then // Floating toolbar will cause a window USER.EXE stack fault error when // w_mdi_main is redrawed (w_mdi_main.setredraw(true)DAT*) in f_menu_behave // function. So, the temporary fix is not to use setredraw in // f_menu_behave function. But, this will cause w_rapids_info not painted // when the application is first running next time. Therefore, the // program always saves toolbar to top style when user picks floating // style. 6/30/94 swj // bar_align = "floating" // bar_x = window_parm.toolbarx // bar_y = window_parm.toolbary // bar_width = window_parm.toolbarwidth // bar_height = window_parm.toolbarheight DAT* bar_align = "top" end if SetProfileString (gs_iniFile,window_name,"toolbarvisible",bar_visible) SetProfileString (gs_iniFile,window_name,"toolbaralignment",bar_align) SetProfileString (gs_iniFile,window_name,"toolbarx",string(bar_x)) SetProfileString (gs_iniFile,window_name,"toolbary",string(bar_y)) SetProfileString (gs_iniFile,window_name,"toolbarwidth",string(bar_width)) SetProfileString (gs_iniFile,window_name,"toolbarheight",string(bar_height)) // For a floating toolbar, the titleDAT* of the floating window was set // to be the same as the title of the frame window. Reset it now so // the title will default to "FrameBar" so no other windows will // accidentally use this windows title. rapids.toolbarframetitle = "FrameBar" return end subroutine DAT*=8zz%)98< <=)$826)@)88,0)<6@8}<568<n')<<Y<<R}8,<')<<Y50Ik<<R}<6@8889, <=8=z%)D98e@e8<<R}DAT*- <=8Lz%)P98e@e8}. <=8Xz%)\98e@e8<<R}/ <=8dz%)h98e@e8}0 <=8pz%)|98e@e8}<,-+<<R./+<<R0@8/}(0}89& <=8z%)98DAT*<&6'(@8890 <=8pz%)98e@e8}<'(0@889J4 <=8z%)98e@e8}3 <=8z%)98e@e8}0 <=8pz%)98e@e8}<'(430@8DAT*890 <=8pz%)98e@e8}<'(0@8(<<R1<1(<<R}D@D$x++*<<R}D@D$N1+*<<Y<RAB C4KDL~MNQ,X8YlZx[\]^_`bc@dXehftghijn qt*vJxyz{4|Pb\(FdDAT*Grants select on all rapids objects to an Oracle userglobal type f_security_grant from function_object end type forward prototypes global function boolean f_security_grant (string ps_object_name, string ps_user_name) end prototypes global function boolean f_security_grant (string ps_object_name, string ps_user_name);// part of rapids security - grants SELECT on all rapids objects to a specified user. // necessary because the Oracle ODBC driver does not recognize the use of roles, // andDAT*( we need the SELECT grant to be able to access the rapids tables from // non-rapids accounts in SAS. string ls_sql2 ls_sql2 = "grant select on " + ps_object_name + " to " + ps_user_name execute immediate :ls_sql2 using sqlca; gf_db_message(sqlca, "grant") return TRUE end function DAT* D|4DXf~ $ 4 H V n |  ^ * : N   V   l | bzN:R&:j  \LR !#$0%z&')F*^+0145(8,FJG\M`d( dwprintjobstartpospagesiDAT*zeleftmargincur_rowpage_numobjlist header_list detail_list footer_list summary_list countijbandheader_countdetail_countfooter_countsummary_countx_coordy_coordcoltypedatatypetemp_textspecial_textfontfacefontheightfontfamilyfontpitchfontweightfontitalicfontunderlinefamilytypepitchfontsizeisitalicisunderlinefile_bitmapobj_widthobj_heighttext_widthbandheightnewheightline_x1line_y1line_x2line_y2lineDAT*_widthbottom_yformatellipse_heightellipse_widthaligncase89case158case174case211case217case235case259Ld|  j@&@19LB-q@dX-|p---DAT*mgsce se d! ck+ s_8 seA gsL gW va ill wiw tw syh_ DAT*Revokes select on all rapids objects from an Oracle userglobal type f_security_revoke from function_object end type forward prototypes global function boolean f_security_revoke (string ps_object_name, string ps_user_name) end prototypes global function boolean f_security_revoke (string ps_object_name, string ps_user_name);// part of rapids security - revokes SELECT on all rapids objects to a specified user. // necessary because the Oracle ODBC driver does not recognize the use of roles, DAT*> // and we need the SELECT revoke to be able to remove access of the rapids tables from // non-rapids accounts in SAS. string ls_sql2 ls_sql2 = "revoke select on " + ps_object_name + " from " + ps_user_name execute immediate :ls_sql2 using sqlca; gf_db_message(sqlca, "revoke") return TRUE end function DAT*p@ um 6) 0?M S[ ed Rm v < @  p datawindow.unitsdescribej2*headerdetailsummaryfooterdatawindow.header.heightjdataDAT*window.detail.heightjdatawindow.summary.heightjdatawindow.footer.heightjMS Sans SerifPage .typej.xj.yj.heightj.widthj.alignmentj.Font.Facej.Font.Familyj.Font.Height6j.Font.Weightj.Font.Pitchj.Font.Italicj.Font.Underlinej01345.Borderjtext.Textj@columncompute.coltypej.tagjchar(getitemstrinDAT*g^decim.formatjgetitemnumber} datejgetitemdatedatetjgetitemdatetimenumbej timejgetitemtime@@line.X1j.Y1j.X2j.Y2j.Pen.Widthjbitmap.filenamejoval1jroundrectangle.ellipsewidth j.ellipseheightjjrectanglej$ h         0 DDAT* X p         @ P l          $ 0D P \ h |       2 ( f_print_master_dwf_listobjectsd j_recaistbj_ta_ls_s_2  B\DAT*Function to set value for value_amt field in rap_activities tableglobal type f_set_value_amt from function_object end type forward prototypes global function boolean f_set_value_amt (datawindow dw_obj, string val, string val_fld, string val_amt_fld, long row_num) end prototypes global function boolean f_set_value_amt (datawindow dw_obj, string val, string val_fld, string val_amt_fld, long row_num);boolean lb_rtn_value string ls_null decimal ldec_value lb_rtn_value = FALSE //ls_valueDAT* = dw_obj.GetItemString(row_num, val_fld) if IsNumber(val) then ldec_value = Dec(val) if dw_obj.SetItem(row_num, "value_amt", ldec_value) = 1 then lb_rtn_value = TRUE else MessageBox("f_set_value_amt", & "Could not set value for " + val_amt_fld) end if //else // SetNull(ls_null) // if dw_obj.SetItem(row_num, "value_amt", ls_null) = 1 then // lb_rtn_value = TRUE // else // MessageBox("f_set_value_amt", & // "Could not set value to null for " + val_amt_fld) // DAT*7end if end if return lb_rtn_value end function DAT*DAT* 8B08R08} 8B08Z08}*}1}1<6}16<| }01)8a)|8e@e8}x16<| }0)8)8)8e@e8}x16< | }01)DAT*8)8e@e8}x16<x | }01)8)8e@e8} 1} 0 <11} 1}    <=8z%)98 <=8z%) 98e@e8} <=8z%)98e@e8}' <=8DAT* z%)(98e@e8}& <=80z%)898e@e8}5 <=8@z%)L98<<R}*<<R} <=8Tz%)`98 <=8hz%)x98 <=8z%)98 <=8z%)98 <=8z%)DAT*Function to perform shift-highlight operationglobal type f_shift_highlight from function_object end type forward prototypes global subroutine f_shift_highlight (long clicked_row, datawindow dw_object, long last_clicked_row) end prototypes global subroutine f_shift_highlight (long clicked_row, datawindow dw_object, long last_clicked_row);// Purpose: This function will verify that there is a prior selected row // and then hightlight all rows between the two. If there is no // previDAT*ously selected row then it will highlight only the row // clicked. This function will not unhighlight any ohter rows // to allow for a mix of shift and control key inter mingling. // This will have to be aware of the relation between the rows // to know which way to highlight. // The argument passed will be the currently clicked row. This // function will use the existing datawindow and the parameter // variable last_clicked_row to perform it's scrolling integer liDAT*d_idx if last_clicked_row = 0 then dw_object.SelectRow(clicked_row, TRUE) end if if last_clicked_row > clicked_row then for li_idx = last_clicked_row to clicked_row step -1 dw_object.SelectRow(li_idx, TRUE) next else for li_idx = last_clicked_row to clicked_row dw_object.SelectRow(li_idx, TRUE) next end if end subroutine DAT*98 <=8z%)98 <=8z%)98"6e@e8<}""1<`}7687 :@~87 :@~8@7 :@~876 :@~87\ :@~87~ :@8688!:@8DAT*8!:@8@8!:@8 #9}, #9}8P $9}\ $9}<16"6e@e8! #$@ 8 <1@8 <=8z%)988 <1 <Y1 <Y&1<R'1 @89689 DAT* <=8z%)98(<6@8}:568:b &(<<Y<<R} 8@: &(<<Y5(Ik<<R}<6@82809879"F80r  <=8?z%)H981o@o98  <=8Pz%)X981DAT*o@o98;68`;  < <=)t8F8|; 2 <=8z%)98 < <=J8;26)@)8F8;\2 <=8z%)98 < <=)826)@)8F8;2 <=8z%)9DAT*8 < <=)826)@)8F8;2 <=8z%)98 < <=J8;26)@)8F8;42 <=8z%)98 < <=),826)@)8F840(<6@8}<568<DAT*&(<<Y<<R}8@<&(<<Y58Ik<<R}<6@828@9`+ <=8Ez%)L98e@e8<<R}, <=8Tz%)X98e@e8}- <=8`z%)d98e@e8<<R}. <=8lz%)p9DAT*8e@e8}/ <=8xz%)98e@e8}<+,*<<R-.*<<R/@8.}'/}289% <=8z%)98<%6&'@8289v/ <=8xz%)98e@e8}<&'/@8289DAT*4 <=8z%)98e@e8}3 <=8z%)98e@e8}/ <=8xz%)98e@e8}<&'43/@82892/ <=8xz%) 98e@e8}<&'/@8'<<R1<p1'<<R}D@DAT*Performs validation check on activity datawindowglobal type f_validate_act from function_object end type forward prototypes global function boolean f_validate_act (datawindow dw_obj, long row_num, string level_type, string source_code, string device_code, string process_code, string stream_code) end prototypes global function boolean f_validate_act (datawindow dw_obj, long row_num, string level_type, string source_code, string device_code, string process_code, string stream_code);string lDAT*s_value, ls_metric_code, ls_value_type, ls_material_code, & ls_value_unit_code, ls_err_msg, ls_field_name if IsNull(dw_obj.GetItemDateTime(row_num, "start_date_time")) then MessageBox("DataWindow Error", "Sorry! Start Date Time is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("start_date_time") dw_obj.ScrollToRow(row_num) return FALSE end if ls_metric_code = dw_obj.GetItemString(row_num, "metric_code") if IsNull(ls_metric_code) or DAT*ls_metric_code = '' then MessageBox("DataWindow Error", "Sorry! Metric Code is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("metric_code") dw_obj.ScrollToRow(row_num) return FALSE end if // Value column has been changed to nullable in the database //if IsNull(dw_obj.GetItemString(row_num, "value")) or & // dw_obj.GetItemString(row_num, "value") = '' then // MessageBox("DataWindow Error", "Sorry! Value is required", Information!) // DAT*dw_obj.SetRow(row_num) // dw_obj.SetColumn("value") // dw_obj.ScrollToRow(row_num) // return FALSE //end if if not f_check_dates(dw_obj, row_num, "start_date_time", "end_date_time", "Start Date Time", "End Date Time") then return false end if //if Not IsNull(dw_obj.GetItemString(row_num, "value")) then // SetNull(ls_value) //end if ls_value = dw_obj.GetItemString(row_num, "value") ls_value_type = dw_obj.GetItemString(row_num, "value_type") ls_material_code = dw_obj.GetItemStDAT*ring(row_num, "material_code") ls_value_unit_code = dw_obj.GetItemString(row_num, "value_unit_code") ls_err_msg = '' if Not f_qc_act_data_1(ls_value, ls_metric_code, ls_value_type, & ls_material_code, ls_value_unit_code, level_type, source_code, & device_code, process_code, stream_code, ls_err_msg, ls_field_name) then MessageBox("DataWindow Error", ls_err_msg, Information!) dw_obj.SetRow(row_num) dw_obj.SetColumn(ls_field_name) dw_obj.ScrollToRow(row_num) return FALSE end ifDAT*# return TRUE end function DAT*D$**)<<R}*<18011:@:@99@ 8 <1@8-1<R}<8"-(@(8z'11x@8<@8*1}D@D$D@D$v1*)<<Y<R?CD:E\MlNOPSTZ`[\]^_`ab(cDAT*8eDg^hijklmno,p8qFuxx{~"lJ.fFr $2JXp~  , @ L P \   . ^ v   n r  4 l Xp D04FpB Z  \DP\tBr !DAT*"h$%&+2,R/p0368: ;0<L=>ABDEKd( dwprintjobstartpospagesizeleftmarginpage_numobjlist$ header_list detail_list footer_list summary_listh@ countijbandheader_countdetail_countfooter_countsummary_countx_coordy_coordcoltypedatatypetemp_textspecial_textfontfacefontheightfontfamilyfontpitchfontweightfontitalicfontunderlinefamilytypepitchfontsiDAT*zeisitalicisunderlinefile_bitmapobj_widthobj_heighttext_widthbandheightnewheightline_x1line_y1line_x2line_y2line_widthnumrowsbottom_yformatellipse_heightellipse_widthaligncase91case153case169case206case212case230case254D\t &1D:-\P-th--DAT*-mgs ce se d# ck0 s_9 seD gsO gY vd ilo wi} twsyh_DAT*nt ede@entm li ) 0?M S[ ed Rm v < @DAT*Function to check to see if code exists in the lookup tableglobal type f_validate_code from function_object end type forward prototypes global function boolean f_validate_code (string code, string attr_name, string tab_name) end prototypes global function boolean f_validate_code (string code, string attr_name, string tab_name);//********************************************************************** // Global Boolean Function f_validate_code (string code) // // Checks if code exists as DAT*a code in the rap_source_codes table // by issuing an SQL SELECT statement // // 5/6/94 Modified by Scott Evans/Radian // changed the function to use dynamic SQL with the code, column // name (attr_name) and table name (tab_name) being passed in // // added tests to check for attr_name and tab_name = NULL // // changed the string passed to the function f_db_error so that // it includes tab_name // 5/6/94 End Modification Notes // 5/16/94, JBWilcox, Moved close cursor stmt inDAT*to If stmt so that // sqlcode is tested before cursor is closed. // 5/21/94, JBWilcox, Changed to allow null argument for code since // a code field can be null/empty. // 5/23/94, SWJ, Remove input parameter option from dynamic sql statement // // Returns TRUE if code is found; otherwise, returns FALSE // // Assumes that sqlca has been initialized and connected //********************************************************************** string ls_code, sql_statement if IsNull(coDAT*de) or code = "" or len(lefttrim(code)) < 1 then //MessageBox ("f_validate_code", "NULL argument received", Exclamation!) return true end if if IsNull(attr_name) then MessageBox ("f_validate_code", "NULL argument received", Exclamation!) return FALSE end if if IsNull(tab_name) then MessageBox ("f_validate_code", "NULL argument received", Exclamation!) return FALSE end if //old select used before dynamic SQL was added //SELECT code // INTO :ls_code // FROM rap_sourceDAT*_codes // WHERE code = :code; DECLARE cursor1 DYNAMIC CURSOR FOR SQLSA; sql_statement = "SELECT " + attr_name + " FROM " + tab_name + & " WHERE " + attr_name + " = ?" PREPARE SQLSA FROM :sql_statement; OPEN DYNAMIC cursor1 using :code; FETCH cursor1 INTO :ls_code; if sqlca.sqlcode < 0 then f_db_error(SQLCA, "Error selecting code from " + tab_name + & " table.~nContact your technical support.") CLOSE cursor1; return FALSE elseif sqlca.sqlcode = 100 then CLOSE cursor1DAT*S; return FALSE else CLOSE cursor1; return TRUE end if end function DAT* ( rowcountw.u4datawindow.unitsdescribedj-2*headerdetailsummaryfooterdatawindow.header.heightj-4datawindow.detail.height8j-datawindow.summary.heightinj-datawindow.footer.heightj-.typej-.xj-.yj-.heightj-.widthj-.alignmentj-.Font.Facej-.Font.Familyj-.Font.Heightj-.Font.Weightj-.Font.Pitchj-.Font.Italicj-.Font.UndDAT*erlinej-01345.Borderj-text.Textj-e@columncompute.coltypej-.tagj-char(getitemstringfdecim.format)j-getitemnumber8 datej-getitemdatedatetj-getitemdatetimenumbej- timej-getitemtime @line.X1j-.Y1j-.X2j-.Y2j-.Pen.Widthj-bitmap.filenamej-ovalj-roundrectangle.ellipsewidthjDAT* -.ellipseheight@j-j-rectanglej-MS Sans SerifPage  8 |         ( 8 L ` x        (H X t          , 8L X d p         2 f_printdwf_lDAT*istobjectsd_l2  :PDAT*X2  DAT* Performs validation check on device or process datawindowglobal type f_validate_dev_pro from function_object end type forward prototypes global function boolean f_validate_dev_pro (datawindow dw_obj, long row_num) end prototypes global function boolean f_validate_dev_pro (datawindow dw_obj, long row_num);string ls_id, ls_code ls_id = dw_obj.GetItemString(row_num, "id") if IsNull(ls_id) or ls_id = '' then MessageBox("DataWindow Error", "Sorry! Id is required", Information!) dw_obDAT*j.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("id") dw_obj.ScrollToRow(row_num) return FALSE end if ls_code = dw_obj.GetItemString(row_num, "code") if IsNull(ls_code) or ls_code = '' then MessageBox("DataWindow Error", "Sorry! Code is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("code") dw_obj.ScrollToRow(row_num) return FALSE end if return TRUE end function DAT* SRS x function_objectf_qc_act_data_1structuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjecttransaction on@ectllsst(il@pien2en@ilfi@io@ilmeLwi@chil`it@reevlnn@onin|je@indo fa@fon @ @ @ DAT* `P & 809  ,,$1d 8$z%8Gz&9,h$1,8p8z%89 80, , l,$1d# 8z%,9 8z%80z&,DAT* 9,P$1*,8X8sz%8,9,$1`80z%8z&9}, * 8z%,9, 80# 688 666 8#98DAT* 88"# 8z%8!z&98#^ 8<8cz%z&8pz&986666 66666  8 #9<2 8r8z%(@(8z(98~~ 80 8098 80DAT*  809P8P6666 66666  8 #P99./ 06&729><P=j?BCEHOPS(UBVLWXYnZ~\]_`ceg hj&l*mDnNq`t~uvxy|}$4H\*T^r(2FPbt~FDAT* Performs validation check on geographic_location datawindowglobal type f_validate_geo_loc from function_object end type forward prototypes global function boolean f_validate_geo_loc (datawindow dw_obj, long row_num) end prototypes global function boolean f_validate_geo_loc (datawindow dw_obj, long row_num);string ls_type, ls_name ls_type = dw_obj.GetItemString(row_num, "type") if IsNull(ls_type) or ls_type = '' then MessageBox("DataWindow Error", "Sorry! Type is required", InformatDAT*ion!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("type") dw_obj.ScrollToRow(row_num) return FALSE end if ls_name = dw_obj.GetItemString(row_num, "name") if IsNull(ls_name) or ls_name = '' then MessageBox("DataWindow Error", "Sorry! Name is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("name") dw_obj.ScrollToRow(row_num) return FALSE end if return TRUE end function DAT* Pd, act_valuemetric_codevalue_typematerial_codeunit_codelevel_typesource_codedevice_codeprocess_codestream_codeerr_msgfield_namels_format_typels_lookup_namels_material_flagls_meas_codels_value_type_flagls_codels_code_listli_value_length_amtlb_printsqlcacodecursorcase141 u ] ) Q7 A L X d DAT* q }         @ 0># ( Metric Code is nullInvalid Metric Code. Metric Code '' not found in rap_metrics tableFail on selecting data on rap_metrics table. Contact your technical support.value_DAT* unit_codeUnit Code should be null for Metric Code 'Invalid Measurement Code. Measurement Code '' not found in rap_units tableFail on selecting code on rap_units table. Contact your technical support.etinone Sorry! Not a unit code. The valid unit codes are: valueCGEOLYNSorry! The valid value for metric '' is Y for yes or N for noSorry! Numeric data value is expected for metric ''Sorry! The value field length can not exceed material_codeSorry! MaterDAT*ial Code is requiredvalue_typeSorry! Value Type is required h  P  2 C f_qc_act_data_1f_db_errorf_qc_act_data_3f_qc_act_data_2x/#3@3@2   DAT*& R\hrBSSSSSSSSSRS x function_objectf_qc_act_data_2structuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdynamicstagingareatransaction on@ectsture(en@viro2fi@scri@me@edaLil@stvi`ev@temlin@ower|aw@wfo on@chDAT*" Validates the legal entity relationship tableglobal type f_validate_legal_relation from function_object end type forward prototypes global function boolean f_validate_legal_relation (datawindow dw_obj, long row_num) end prototypes global function boolean f_validate_legal_relation (datawindow dw_obj, long row_num);string ls_code date ld_begin_date ls_code = dw_obj.GetItemString(row_num, "code") if IsNull(ls_code) or ls_code = '' then MessageBox("DataWindow Error", "Sorry! Code is rDAT*$ equired", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("code") dw_obj.ScrollToRow(row_num) return FALSE end if ld_begin_date = dw_obj.GetItemDate(row_num, "begin_relation_date") if IsNull(ld_begin_date) then MessageBox("DataWindow Error", "Sorry! Begin Relation Date is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("begin_relation_date") dw_obj.ScrollToRow(row_num) return FALSE end if return TRDAT*UE end function DAT*( o @ @ @nd xc@  ] & 809L 809r 8009 8D09 8Y098m06 8n8z%8z&68  8z%88z&8~DAT** z&z&8z&8z&z&8z&8&  8z%8z&8z&z&8z&8#z&8~z&z&8z&8iz&z&8z&8  8z%8z&8z&z&8z&8z&8z&z&8z&8z&8~z&z&8z&82z&z&8z&8N  8Rz%8lz&8z&8z&z&8z&8z&8z&DAT*, 8Dz&z&8z&8z&8z&z&8z&8z&8z&z&8z&8ez&8~z&z&8z&8z&z&8z&  8z%8z&8z&,8.8Pz%81<d9, ,,8q8Pz%81<9,<,88Pz%81<9   , DAT*.  ,$1,88z%8,9,$1d68: 8z%8z&z&8&z&8Iz&,98 8z%8`z&z&8z&z&8&z&8pz&,98B 8z%8`z&z&8z&z&8z&z&8z&,9DAT*0 8N 8z%8`z&z&8z&z&8z&z&8z&z&8z&,9,,88Pz%81<(9 89bb 8;09    ,`,8T8z%81<9MMbMiMMbMi6%@%8MDAT*2 M"# MMMM"  8M2(@(8z'8z&M2(@(8z(8z&z&9 M#0 MM,  8M2(@(8z'8z&z&9 M# MM  8M2(@(8z'8z&z&9912 35&607B9L:V;h=r>|?ABCEFGHLPQ R4VW]"^:fgw|$~ZDAT*4 dr$F`,6N$4>V(<FXbt| ( < V " , < J d level_typesource_codedevice_codeprocess_codestream_codematerial_codeact_valuemetric_codeunit_codeerr_msgls_sel_stmntls_required_flagls_unit_codels_metric_map_codels_src_codels_dev_codels_pro_codels_str_codels_mat_codelDAT*6 s_material_codeldec_max_amtldec_min_amtldec_act_valueldec_default_unit_factorldec_user_unit_factorcase80sqlsametricmapcursorsqlcacase154X   + 8 eD stR \ h r z ar gl or as   DAT*8    > > > .> G> ] e@ E=k>od|@ ap % Metric Code is nullSource Code is nullDevice Code is nullProcess Code is nullStream Code is nullselect source_code, device_code, process_code, stream_code, material_code, maximum_amt, minimum_amt, required_flag, unit_code, rap_mDAT*V etric_maps.code from rap_metric_maps SRC, rap_source_codes where (rap_source_codes.metric_map_code = rap_metric_maps.source_code) and (rap_metric_maps.code = '') and (rap_source_codes.code = '')DEV, rap_device_codes where (rap_metric_maps.source_code = '@' or rap_metric_maps.source_code = '(rap_device_codes.metric_map_code = rap_metric_maps.device_code) and (rap_device_codes.code = 'PRO, rap_process_codes where (rap_metric_maps.device_code = '@' or rap_metric_maps.device_code = 'DAT*< ( State.parent_rid (+) = Nation.rid ) and " + & " ( County.parent_rid (+) = State.rid ) and " + & " ( City.parent_rid (+) = County.rid )" else // ls_sql = "SELECT DISTINCT rap_geographic_locations_d.name " + & // "FROM {oj rap_geographic_locations rap_geographic_locations_b LEFT OUTER JOIN rap_geographic_locations rap_geographic_locations_a ON rap_geographic_locations_b.rid = rap_geographic_locations_a.parent_rid}, " + & // "{oj rap_geographic_locations rap_geograpDAT*> hic_locations_c LEFT OUTER JOIN rap_geographic_locations rap_geographic_locations_b ON rap_geographic_locations_c.rid = rap_geographic_locations_b.parent_rid}, " + & // "{oj rap_geographic_locations rap_geographic_locations_d LEFT OUTER JOIN rap_geographic_locations rap_geographic_locations_c ON rap_geographic_locations_d.rid = rap_geographic_locations_c.parent_rid} " ls_sql = "SELECT DISTINCT Nation.name " + & "FROM rap_geographic_locations City, " + & " rap_geographic_locDAT*@ ations County, " + & " rap_geographic_locations State, " + & " rap_geographic_locations Nation " + & "WHERE ( Nation.rid = State.parent_rid ) and " + & " ( State.rid = County.parent_rid ) and " + & " ( County.rid = City.parent_rid )" end if DECLARE cursor1 DYNAMIC CURSOR FOR SQLSA; setnull(ls_var1) setnull(ls_var2) if p_column = "mail_city_rid" then // if sqlca.dbms = "ODBC" then // ls_sql = ls_sql + " where rap_geographic_locations_a.typDAT*B e = 'CITY' " // ls_sql = ls_sql + " where City.type = 'CITY' " // else // ls_sql = ls_sql + " and rap_geographic_locations_a.type = 'CITY' " ls_sql = ls_sql + " and City.type = 'CITY' " // end if // ls_sql = ls_sql + " and rap_geographic_locations_a.rid = ?" ls_sql = ls_sql + " and City.rid = ?" if not isnull(p_state) then // ls_sql = ls_sql + " and rap_geographic_locations_c.rid = ?" ls_sql = ls_sql + " and State.rid = ?" ls_var1 = p_state end if if noDAT*D t isnull(p_nation) then // ls_sql = ls_sql + " and rap_geographic_locations_d.rid = ?" ls_sql = ls_sql + " and Nation.rid = ?" if isnull(ls_var1) then ls_var1 = p_nation else ls_var2 = p_nation end if end if elseif p_column = "mail_state_rid" then // if sqlca.dbms = "ODBC" then // ls_sql = ls_sql + " where rap_geographic_locations_c.type = 'STATE' " // ls_sql = ls_sql + " where State.type = 'STATE' " // else // ls_sql = ls_sql + " and raDAT*F p_geographic_locations_c.type = 'STATE' " ls_sql = ls_sql + " and State.type = 'STATE' " // end if // ls_sql = ls_sql + " and rap_geographic_locations_c.rid = ?" ls_sql = ls_sql + " and State.rid = ?" if not isnull(p_city) then // ls_sql = ls_sql + " and rap_geographic_locations_a.rid = ?" ls_sql = ls_sql + " and City.rid = ?" ls_var1 = p_city end if if not isnull(p_nation) then // ls_sql = ls_sql + " and rap_geographic_locations_d.rid = ?" ls_sql = ls_DAT*H sql + " and Nation.rid = ?" if isnull(ls_var1) then ls_var1 = p_nation else ls_var2 = p_nation end if end if elseif p_column = "mail_country_rid" then // if sqlca.dbms = "ODBC" then // ls_sql = ls_sql + " where rap_geographic_locations_d.type = 'NATION' " // ls_sql = ls_sql + " where Nation.type = 'NATION' " // else // ls_sql = ls_sql + " and rap_geographic_locations_d.type = 'NATION' " ls_sql = ls_sql + " and Nation.type = 'NATION' " DAT*J // end if // ls_sql = ls_sql + " and rap_geographic_locations_d.rid = ?" ls_sql = ls_sql + " and Nation.rid = ?" if not isnull(p_city) then // ls_sql = ls_sql + " and rap_geographic_locations_a.rid = ?" ls_sql = ls_sql + " and City.rid = ?" ls_var1 = p_city end if if not isnull(p_state) then // ls_sql = ls_sql + " and rap_geographic_locations_c.rid = ?" ls_sql = ls_sql + " and State.rid = ?" if isnull(ls_var1) then ls_var1 = p_state else DAT*L  ls_var2 = p_state end if end if end if PREPARE SQLSA FROM :ls_sql; if not isnull(ls_var1) and not isnull(ls_var2) then OPEN DYNAMIC cursor1 using :p_value, :ls_var1, :ls_var2; elseif not isnull(ls_var1) then OPEN DYNAMIC cursor1 using :p_value, :ls_var1; else OPEN DYNAMIC cursor1 using :p_value; end if // if an invalid value is entered the database returns this errorcode. This happens // where the display value type is string and the data value type is long. So usDAT*N e // this check to find invalid values. if gs_database = 'ODBC' and sqlca.sqldbcode = -157 then close cursor1; return false end if // messagebox("debug", string(sqlca.sqldbcode) + " " + sqlca.sqlerrtext) FETCH cursor1 INTO :ls_name; if sqlca.sqlcode < 0 then f_db_error(SQLCA, "Error selecting from table.~nContact your technical support.") CLOSE cursor1; return FALSE elseif sqlca.sqlcode = 100 then CLOSE cursor1; return FALSE else CLOSE cursor1; return DAT*TRUE end if end function DAT*R , "Sorry! Relative Activity Amount is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("relative_activity_amt") dw_obj.ScrollToRow(row_num) return FALSE end if ls_begin_day = dw_obj.GetItemString(row_num, "begin_day_date_code") ls_begin_hr = dw_obj.GetItemString(row_num, "begin_hour_no") ls_end_day = dw_obj.GetItemString(row_num, "end_day_date_code") ls_end_hr = dw_obj.GetItemString(row_num, "end_hour_no") if integer( ls_begin_month DAT*T ) = integer( ls_end_month ) then if integer( ls_begin_day ) = integer( ls_end_day ) then if integer( ls_begin_hr ) > integer( ls_end_hr ) then MessageBox("Error", "Begin Hour <= End Hour!", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("end_hour_no") dw_obj.ScrollToRow(row_num) return FALSE end if elseif integer( ls_begin_day ) > integer( ls_end_day ) then MessageBox("Error", "Begin DDAT*j ay <= End Day!", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("end_day_date_code") dw_obj.ScrollToRow(row_num) return FALSE end if elseif integer( ls_begin_month ) > integer( ls_end_month ) then MessageBox("Error", "Start Month <= End Month!", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("end_month_no") dw_obj.ScrollToRow(row_num) return FALSE else // otherwise, valid data eDAT*X (rap_process_codes.metric_map_code = rap_metric_maps.process_code) and (rap_process_codes.code = 'STR, rap_stream_codes where ((rap_metric_maps.material_code is not null and (rap_metric_maps.material_code = '@' or rap_metric_maps.material_code = '')) or rap_metric_maps.material_code is null) and (rap_metric_maps.process_code = '@' or rap_metric_maps.process_code = '(rap_stream_codes.metric_map_code = rap_metric_maps.stream_code) and (rap_stream_codes.code = ' order by source_code descDAT*Z , device_code desc, process_code desc, stream_code desc, material_code descFail on declaring dynamic cursor Contact your technical support.Fail on preparing sqlsaFail on open dynamic cursor Error selecting from rap_metric_maps table. Contact your technical support.Source Code '' Metric Code '' not found in rap_metric_maps or rap_source_codes table' Device Code 'rap_device_codes table' Process Code '' not found in rap_metric_maps or rap_process_codes table' StDAT*\ ream Code '' not found in rap_metric_maps or rap_stream_codes tableFail on close dynamic cursor YSorry! Value is requiredFail on selecting unit conversion factor from rap_unit table. Contact your technical support.Sorry! Value must be between and Sorry! Value must be not greater than Sorry! Value must be not less than   2 # f_qc_act_data_2f_db_errorEDAT*vL2  z DAT*` @!Aj@(k@@L2@m@a@@@L@@`@^@qljt@s@| @ @o @@ @ @nd xc@ F4&8098 ,  , p,0$1dDAT*b 88z%8[z& ,9,$1(,88z%8 ,9,$1^80z%8z&9} , (8z% ,9 ,68168?z%8Qz&z&8az&,8c8z%81<DAT*d 9,,,88z%81<9 ,X,88z%81<29 , ,$1d80 ,9,88z%81< ,9 ,,8>8z%81<699$% &+&3:4V7p8:;<=DAT*f ? @A$C(EBFLH^K|LMOPSTVW\^aeNgjkmpqs(v2yLzf{x|}~,6d~ lookup_nameact_valuemetric_codeerr_msgls_valuels_value_listls_sqllb_printsqlcavaluecursorsqlsacodecursor q \@ * a2 j@; I P@Y@ _4>DAT*h l@ @r >j Metric Code is nullrap_metric_lookupsInvalid Metric Code. Metric Code '' not found in rap_metric_lookups tableFail on selecting valid_value_name on rap_metric_lookups table. Contact your technical support.none Sorry! Not a valid value. The valid values are: rap_sic_codesselect code from where code = ''Fail on declaring dynamic cursor codeCursor. Contact your technical support.Fail on preparing sqDAT*lsa. Fail on opening dynamic cursor codeCursor. Sorry! Not a valid valueFail on fetching codeCursor cursor. Fail on closing dynamic cursor codeCursor. 0    2 # f_qc_act_data_3f_db_errorEL2  28DAT*&nd if return TRUE end function DAT*n d8 win_titledw_objfld_namedw_fld_namedwcsqlcax   " . s 2@ 8 getchildmeoApplication Error: - Not a DataWindowChild. Contact your technical support.rowcountkgetitemstringow[|0settransobjectommretrieveose|| t      2 DAT* f_retrieve_codes2  .8DAT*r cipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatawindowtransaction@j@/k@@M9@m@G@@S@@g@^@s @n@q@@ @i n@on @ @nd xc@ DAT*x , , 1,$12880) 88()488<6)D88L)d81R, L, ,  , 1,l$1t88t0)x88()8DAT*v Performs validation check on source datawindowglobal type f_validate_src from function_object end type forward prototypes global function boolean f_validate_src (datawindow dw_obj, long row_num) end prototypes global function boolean f_validate_src (datawindow dw_obj, long row_num);string ls_id, ls_code, ls_name, ls_type ls_id = dw_obj.GetItemString(row_num, "id") if IsNull(ls_id) or ls_id = '' then MessageBox("DataWindow Error", "Sorry! Id is required", Information!) dw_obj.SetDAT* Focus() dw_obj.SetRow(row_num) dw_obj.SetColumn("id") dw_obj.ScrollToRow(row_num) return FALSE end if ls_code = dw_obj.GetItemString(row_num, "code") if IsNull(ls_code) or ls_code = '' then MessageBox("DataWindow Error", "Sorry! Code is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("code") dw_obj.ScrollToRow(row_num) return FALSE end if ls_name = dw_obj.GetItemString(row_num, "name") if IsNull(ls_name) or ls_name = '' theDAT*z 8<6)88L)81R , 8 , >Lf .2"B#^%&'()*+:,N-p/tdl deviceriddwnamefromdevridtodevridcapturecounternamesqlcafromconnectcursortoconnectcursor ca urvi$sc-e5stDAT*= teB@ owHl>on[>P ioIsetitempplPdevice_ridOnameue_Pcapture_efficiency_percOOPOPO  4 D d l x    2  f_retrieve_connections2   DAT*~ edwcsqlcax   " . 2@ ( getchilddwoApplication Error: - Not a DataWindowChild. Contact your technical support.getitemnumberSWk^@settransobjectretrieve| |   2  f_retrieve_county_city 2  .8DAT* DAT*ODBCIsNull( , now(*), )2  f_retrieve_date2  # DAT*   " &@ group_typegetchildo Application Error: Group Type - Not a DataWindowChild. Contact your technical support.settransobjectretrieveh@} $   2  f_retrieve_group_types2  ",DAT* 08#.  8z%(@(8z(8z&8z&#  8z%(@(8z(8 z&8z&8z&81#  8@z%(@(8z( 8Y08#P  8z%(@(8z(8#z&#  8%z%8z&8z&89z&(@(8z(8@z&DAT* n MessageBox("DataWindow Error", "Sorry! Name is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("name") dw_obj.ScrollToRow(row_num) return FALSE end if ls_type = dw_obj.GetItemString(row_num, "type") if IsNull(ls_type) or ls_type = '' then MessageBox("DataWindow Error", "Sorry! Type is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("type") dw_obj.ScrollToRow(row_num) return FALSE end iDAT*Lf if IsNull(dw_obj.GetItemNumber(row_num, "geographic_county_rid")) then MessageBox("DataWindow Error", "Sorry! County is required", Information!) dw_obj.SetFocus() dw_obj.SetRow(row_num) dw_obj.SetColumn("geographic_county_rid") dw_obj.ScrollToRow(row_num) return FALSE end if return TRUE end function DAT*  8D0  8fz%  )p8 8:8x0 6@8,)8)8 8 )8)8 $ R "*#.$:/>?ADNOPLQPR\X]acde4j:kRlfmznd{ p_winp_dwp_columnp_sqlp_cityp_statep_nationdwcls_meas_codels_errls_old_sqlls_sqllsDAT* _sort_criteriasqlca  ur vi sc"e)st1te: ow> onK naR ar]gld oru@8 DataWindow.Table.Select="errorgetchildoo( Application Error: - Not a DataWindowChild. Contact your technical support.mail_city_rid and State.rid = and CountyDAT* .parent_rid = State.rid and City.parent_rid = County.rid and Nation.rid = and State.parent_rid = Nation.rid mail_state_rid and State.parent_rid = rap_geographic_locations_nation A, rap_geographic_locations_state Amail_country_rid and rap_geographic_locations.rid = (Select parent_rid from rap_geographic_locations where type = 'STATE' and rid = ) and rap_geographic_locations.rid = (Select parent_rid from rap_geographic_locations where type = 'STATE' and rid = (Select parent_rid from raDAT*p_geographic_locations where type = 'COUNTY' and rid = (Select parent_rid from rap_geographic_locations where type = 'CITY' and rid = )))rap_geographic_locations_nation A"modify@hModify Failedsettransobjectp@retrieve`|setsortsort(4 < p     2  f_retrieve_locations2  :\DAT* 81<$6808Rz%@8,)88R6)886)886)8866)88 :666)886666)80flDAT* 2Nf !"#$ %6&NdI win_objdw_objlevel_typesourcedeviceprocessstreamdwcsqlca  v " n) 0 8 ? C@$` metric_codegetchildo Application Error: Metric Code - Not a DataWindowChild. Contact your technical support.codegetitemstring[0h@oDAT*i settransobject@GEOretrieve}LEG}SRC}DEV}PRO}STR} (           2 f_retrieve_metric_codes2  ?\DAT* 81<8L)X81<`$68h8|z%8z&@811"z%8z&,PF)81z%8z&8z&z&8z&8z&)88806@81,) 8)48DAT* Cleans gl_geo_rid, gl_source_rid, gl_device_rid, gl_process_rid before the window is closedglobal type f_window_close from function_object end type forward prototypes global subroutine f_window_close (string win_name) end prototypes global subroutine f_window_close (string win_name);choose case win_name case 'geo' gi_geo_num = gi_geo_num - 1 case 'source' if gi_geo_num > 0 then gi_geo_num = gi_geo_num - 1 end if gi_source_num = gi_source_num - 1 case 'device' gi_sDAT* ource_num = gi_source_num - 1 gi_device_num = gi_device_num - 1 case 'process' gi_source_num = gi_source_num - 1 gi_device_num = gi_device_num - 1 gi_process_num = gi_process_num - 1 case 'connection' gi_source_num = gi_source_num - 1 gi_device_num = gi_device_num - 1 case 'stream' gi_source_num = gi_source_num - 1 gi_device_num = gi_device_num - 1 gi_process_num = gi_process_num - 1 // gi_stream_num = gi_stream_num - 1 end choose if gi_geo_num = 0 then gl_DAT*4cur_row = 0 gl_geo_rid = 0 end if if gi_source_num = 0 then gl_cur_row = 0 gl_source_rid = 0 end if if gi_device_num = 0 then gl_cur_row = 0 gl_device_rid = 0 end if if gi_process_num = 0 then gd_process_rid = 0 end if //if gi_stream_num = 0 then // //end if end subroutine DAT* Dt""#6$B%F)+,-12dL p_winp_dwp_sqlp_metric_codedwcls_meas_codels_errls_sqlsqlca    ' + 8 ?F@<8 DataWindow.Table.Select="errorvalue_unit_codegetchild: Mo8unit_codebo8 Application Error: Value DAT*Unit Code - Not a DataWindowChild. Contact your technical support."reseth@z where meas_code = 'modifyModify Failedsettransobjectretrieve pr|(D X `     4 2  f_retrieve_unit_codes2  '8DAT* - 66@8--8"n9 8-066- 66@88"9 84066- 66@88"b9 8<066- 66@88"9 80-8Ez%z&DAT* 8GH 8M0 8T0l 8Y0 8c063@38#8k0:)@@89-63@38-6:@:@:@:]@:@:8}X-6:@:@:@:]@:@:8}1<-80:)@@8964@481"80:)@@8DAT* /@/896:@:@:@9@98}1<80:)@@8/@/89118115Ik}45Ik5V}J1}1}j=@=8<180:)@@8/@/8DAT* /@/891X1@81 @ 811Yo@o88z&806A@A81<X-80:)@@8/@/8/@/89R:K@?@?8`8z%6A@A81<0 -8z%8 zDAT* writes a single line to a tab-delimited fileglobal type f_write_line from function_object end type forward prototypes global function boolean f_write_line (int pi_file_num, string ps_file, string ps_header, string ps_text) end prototypes global function boolean f_write_line (int pi_file_num, string ps_file, string ps_header, string ps_text);// This function writes a single line to a tab-delimited file and displays // an error message if the file cannot be written to. The format of the DAT*line is: // header text string ls_write_line ls_write_line = ps_header + '~t' if not (IsNull(ps_text) or ps_text = '') then ls_write_line = ls_write_line + ps_text end if if FileWrite(pi_file_num, ls_write_line) = -1 then MessageBox(Upper(ps_file), "Error writing~n" + ls_write_line + & "~n to the file", StopSign!) return FALSE else return TRUE end if end function DAT* &:)@@8/@/898-z%6A@A81< -8z%8 z&:)@@8/@/89 8'z%z&6A@A81<x -8z%8 z&:)@@8/@/89 8'z%z&6A@A81< -8z%8 z&:DAT* )@@8/@/898)-z%6A@A81< -8z%8 z&:)@@8/@/8983z%6A@A81<` -8z%8 z&:)@@8/@/898@z%6A@A81< -8z%8 z&:)@@8DAT* /@/898K06A@A81< -8z%8 z&:)@@8/@/89/@/81<8U0:)@@8/@/8/@/81<X-8U0:)@@89 !L"p%z&'(+,-@.d1n2347894:X=b>t?@CFI DAT* J K2LDMHNZTlUV[\`afXglhmnopqt"uVvjwx{~ 48Jx(jz6NXj & 0 F t  V n x  6 d  > V ` v  @ z ,Xd: ps_modeps_output_fileps_log_fileps_nameps_geinidirps_newconfigps_sasdirpDAT* s_userdirps_sasexeps_keyls_printls_logls_change_configls_filels_write_linels_bls_configfilels_charsetls_formcharls_inigs_inifilels_sasls_not_foundli_file_numli_fnumli_loopslill_flenll_bytes_readll_new_posX  le lu ld+ od3 ?  L NV lda hnk ser  m{ fy y DAT*  ec en    h @  E=od!ap/s sasnot foundsasdirsasexeuserdirconfigcharsetformchar\Batch-print-log-altprint-altlogFile does not exist.Error opening file.Error opening the fDAT*kile.@@@@?Error reading file Error writing file-SET DCDIR Error writing to the file-SET USERDIR -sasuser -wincharset -formchar -echoautoError closing filerapids.ini2  f_sas_config/2  r DAT* @8,668k06@8,668|0(@(8@8,6680(@(8@8,6680(@(8@8,6680(@(8@8,80$(: T f  &!\"#$%^+,dv window_naDAT* mewindow_parmbar_visiblebar_alignbar_showtextbar_xbar_ybar_widthbar_heightgs_inifilerapids   P, 6 CIOYd@o@ 8 yesnoU@bottomU@left1U@rightU@topU@toolbarvisibletoolbaralignmenttoolbarxtoolbarytoolbarwidthtoolbarheighttoDAT*olbarframetitledFrameBar  ( 8 H T  2  f_save_toolbar_profile/2  DAT*d2  $ DAT* Build the fatal error message for halting applicationglobal type gf_build_fatal_message from function_object end type forward prototypes global function string gf_build_fatal_message (transaction p_transaction_object) end prototypes global function string gf_build_fatal_message (transaction p_transaction_object);// Build a fatal error message string to pass to the fatal error message string ls_error_message ls_error_message="DBMS: " + p_transaction_object.dbms & +" DaDAT* tabase: " + p_transaction_object.database & +" Userid: " + p_transaction_object.userid & +" DBParm: " + p_transaction_object.dbparm & +" Lock: " + p_transaction_object.lock & +" Logid: " + p_transaction_object.logid & +" Servername: " + p_transaction_object.servername & +" SQLCode: " + string(p_transaction_object.sqlcode) & +" SQLNrows: " + string(p_transaction_object.sqlnrows) & DAT*  +" SQLDBCode: " + string(p_transaction_object.sqldbcode) & +" SQLERRText: " + p_transaction_object.sqlerrtext & +" SQLReturnData: " + p_transaction_object.sqlreturndata return ls_error_message end function DAT*l2  $ DAT*Q vi sc'e/st< teD> M value_amtsetitemOf_set_value_amtCould not set value for  2  f_set_value_amt2  /DDAT* ec/, selectrowo@@@  $ 2  f_shift_highlight 2  /,DAT* 080:)@@8)8)88)8) 8980808"08208#98@)H8 8P)\8 8d)t8 8|)8 8066 6 6 666666   8 DAT* #x800 6:)@@8)8 )8)899"Pd| &:Rl!"()*(+L,p-01&2>3V4n7xd dw_objrow_numlevel_typesource_codedevice_codeprocess_codestream_codels_valuels_metric_codels_value_typels_material_codels_value_unit_codels_err_msgls_field_name DAT*  " . : G S \ k y     start_date_timegetitemdatetimeDataWindow ErrorSorry! Start Date Time is requiredsetfocusIDSdsetrowQxsetcolumn.Hscrolltorow?metric_codegetitemstringSorry! Metric Code is requireddQDAT* xH?end_date_timeStart Date TimeEnd Date Timevalue@value_typematerial_codevalue_unit_codeQxH?( p          H \ t     2 5 f_validate_actf_check_datesf_qc_act_data_1<%2  S\DAT* tion_object.sqlcode = 100 then return 100 elseif p_transaction_object.sqlcode = -1 then gs_error_message=gf_build_fatal_message(p_transaction_object) open(w_error_message) end if case "exec insert" if p_transaction_object.sqlcode = 100 then messagebox("Database Error","Insert failed, perhaps because of disabled primary key") elseif p_transaction_object.sqldbcode = 1 then messagebox("Database Error","User already has this role",exclamaDAT* tion!) return 1 end if case "set role" if p_transaction_object.sqlcode <> 0 then gs_error_message=gf_build_fatal_message(p_transaction_object) open(w_error_message) end if case "revoke" if p_transaction_object.sqlcode <> 0 and p_transaction_object.sqldbcode <> 1917 then gs_error_message=gf_build_fatal_message(p_transaction_object) open(w_error_message) end if case else if p_transaction_object.sqlcode <> 0 then DAT* messagebox("Fatal Error", "Error type not explicitly handled by gf_db_message", exclamation!) gs_error_message=gf_build_fatal_message(p_transaction_object) open(w_error_message) end if end choose return 0 end function DAT*DAT* <9~8 080:)@@898 080:)@@8980z%88z&z&8?z&z&8Gz&,,,(, d,L$1,8Tz%8oz&8,9,$1d,9,9 2#<$F%t(~)*DAT* 4678,:F;`=>?@ABCDdK codeattr_nametab_namels_codesql_statementsqlsacursor1sqlca  ic at de _c( oc6@ de<>eE@  f_validate_codeNULL argument receivedSELECT FROM WHERE = ?Error selecting code from table. Contact your technical support.L  2 DAT*# f_validate_codef_db_error(2  ,NOD*B 8ENT*0600KAf_del_method_metrics.funENT*0600Z-b?f_del_method_metrics.srfENT*0600 KA$f_del_process_specific_schedule.funDAT* 9$@n DXpd% dw_objrow_numls_idls_codeP q\@  P idgetitemstring1/3 DataWindow ErrorSorry! Id is requiredsetfocusapLsetrownQ`setcolumnHpscrolltorow?code Sorry! Code is requiredLQ`Hp? X h |   DAT*    2  f_validate_dev_pro 2   DAT* 9$@n DXpd' dw_objrow_numls_typels_nameP   P typegetitemstring3 DataWindow ErrorSorry! Type is requiredsetfocuspNsetrownQ`setcolumnHpscrolltorow?name Sorry! Name is requiredNQ`Hp? X h |  DAT*     2  f_validate_geo_loc2   DAT* 99$@n 2F^xd- dw_objrow_numls_codeld_begin_dateP   P codegetitemstring3 DataWindow ErrorSorry! Code is requiredsetfocuspNsetrownQ`setcolumnHpscrolltorow?begin_relation_dategetitemdateSorry! Begin Relation Date is requiredNQ`Hp?DAT* X h |       2 " f_validate_legal_relation2   DAT*  @@ @@ontach@ A1"*9, 888,z%8Qz&8uz&8z&8z&8z&8z&88,z%8Qz&8uz&8z&8Bz&8pz&8z&@8@888z%8DAT* z%#8z%#8z%L88*z%8z%#J8z%#8z%L8FL8Wz%8z%#8z%#L8z%@L,DAT* ,##! ,8# ,p ,, 8u,|$1c!$ ,9 , ,$1,808 ,9,$1d ,9 ,9 *>#/01"76:L;b=n>@BCDEFIDAT* ORSU(V>XJZV[l\v]^agjkmnprs&t0u<v@{L|Z}p~ $>Xzdu p_valuep_columnp_cityp_statep_nationls_sqlls_var1ls_var2ls_namecntgs_databasesqlsacursor1sqlca   (1 8@H PDAT* T @`@ f>o@  ORACLESELECT DISTINCT Nation.name FROM rap_geographic_locations City, rap_geographic_locations County, rap_geographic_locations State, rap_geographic_locations Nation WHERE ( State.parent_rid (+) = Nation.rid ) and ( County.parent_rid (+) = State.rid ) and ( City.parent_rid (+) = County.rid )WHERE ( Nation.rid = State.parent_rid ) and ( State.rid = County.parent_rid ) anDAT* d ( County.rid = City.parent_rid )mail_city_rid and City.type = 'CITY' and City.rid = ? and State.rid = ? and Nation.rid = ?mail_state_rid and State.type = 'STATE' mail_country_rid and Nation.type = 'NATION' ODBC Error selecting from table. Contact your technical support.|   2 ' f_validate_locationf_db_error(2  1DDAT* DAT* 898)88$"8%080:)@@8)(8)088)88)@898HJl8:8%08t0:)@@8)8)88H)8)898)88)8DAT* 8)88)86e@e86e@e86e@e86e@e86e@e86e@e88$08*0:)@@8)D8)L88)T8)\896e@e86e@e88$08d0:)@@8)|DAT* 8)88)8)896e@e86e@e88$080:)@@8)8)88)8)899$@n DXp.F`x"#$%&'(0+:,^-.012>3x45678DAT* :;L<z=>?@BC DNEbFzGHIMdi dw_objrow_numls_yearls_begin_monthls_end_monthls_begin_dayls_end_dayls_begin_hrls_end_hr q\@  a. j@; H S @_   yeargetitemstring DataWindow ErrorSorry! Year is requiredsetfocusNsetrow@Q`setcolumnHDAT* pscrolltorow?begin_month_no Sorry! Start Month is requiredNQ`Hp?end_month_no@  Sorry! End Month is requiredNQ`Hp?relative_activity_amtgetitemnumber ^Sorry! Relative Activity Amount is requiredNQ`Hp?begin_day_date_code begin_hour_no end_day_date_code: end_hour_no ErrorBegin Hour <= End Hour!NQ`Hp?Begin Day <= End DAT* Day!NQ`Hp?Start Month <= End Month!tNQ`Hp? X h |        ( 0 8 @ l         D L T \ |        2 f_validate_pro_schedule2   DAT*DAT* 8)88$"8%080:)@@8)8)88)8) 898()088$"X8%0880:)@@8)P8)X88()`8)h898pJ88%080:)@@8DAT* )8)88p)8)899$@n DXp.F`x!"#$%&'6(N+X,z-./014d5 dw_objrow_numls_idls_codels_namels_typex   % -  idgetitemstringDAT*"  DataWindow ErrorSorry! Id is requiredsetfocus:Lsetrow@Q`setcolumnHpscrolltorow?code Sorry! Code is requiredLQ`Hp?name Sorry! Name is requiredLQ`Hp?type Sorry! Type is requiredLQ`Hp?geographic_county_ridgetitemnumber Sorry! County is requiredLQ`Hp? X h |    DAT*         0 P X ` h      2  f_validate_src2   DAT*& },1<Y},1<Y}8",1<Y},1<Y}8-,1<Y},1<Y},1<Y}, 1<L11,1<|11,1<11,1<1G$@Xl (D`xDAT*( 0>L `!n$|%&)*d win_namecase1gi_geo_numgi_source_numgi_device_numgi_process_numgl_cur_rowgl_geo_ridgl_source_ridgl_device_ridgd_process_rid   @#@1@?@N@Y@d@r@~4 geosourcedeviceprocessconnectionstreamDAT*2  f_window_close2  DAT*, <R}8-,1<R},1<R},1<R}$@Xl (D`xdN win_namecase1gi_geo_numgi_source_numgi_device_numgi_process_numx   @#@1@?@4 geosourcedeviceprocessconnectionstream2 DAT*| f_window_count2  DAT*e file2  f_write_line2  .8DAT*2 d. p_transaction_objectls_error_message(  ` DBMS:  Database:  Userid:  DBParm:  Lock:  Logid:  Servername:  SQLCode:  SQLNrows:  SQLDBCode:   SQLERRText: ba  SQLReturnData:  $ 8 L \ p       2  DAT*vgf_build_fatal_message2  DAT*6 )@@81v8@88r8w"$18@888"$1dL1d$18@888"8"b$1d 1dDAT*8 ^$1^8@88$1d8080@8,$180840:)@@818OX$18@88`h$1p$1}!8@DAT*: 8x$18080:)@@88@81Zt (8<Zv8Hf !"#$$%B'^(v)*+,/0,1F2d5678;<=">P?nBdR p_transaction_objectp_error_typecase3gs_error_messagew_error_messaged  DAT*< * 1@B@ p disconnectrollbackcommitselect_oneseconnect Connection ErrorInvalid Passwordopenclosegfetchselect,insertupdatedeleteexec insertDatabase ErrorInsert failed, perhaps because of disabled primary key User already has this roleset rolerevoke Fatal ErrorError type not explicitly handled by gf_db_mDAT*essage0 @ H       , X h p x 2 - gf_db_messagegf_build_fatal_messageEL2  * DAT*@ global type f_array_breakarrayintoblocks from function_object end type forward prototypes global function long f_array_breakarrayintoblocks (long al_blocklimit, any aa_inarray[], ref any aa_outarray[]) end prototypes global function long f_array_breakarrayintoblocks (long al_blocklimit, any aa_inarray[], ref any aa_outarray[]);//************************************************************ // Object : of_array_breakdown // Method: (event) // Arg : (none) // Return : (none) // Desc : DAT*B  // Note : //************************************************************ //Modifications: //Date Author Comments //------------------------------------------------------------ //4/2/2004 Michael Colombo Initial Version //************************************************************ //************************************************************ long ll_inind, ll_inic, ll_outind, ll_segment any la_segment[], la_clear[] //set variables ll_outind = 1 ll_segment = 1 ll_inic = uppDAT*yerbound(aa_inarray) if ll_inic <= 0 then return 0 for ll_inind = 1 to ll_inic if mod(ll_inind, al_blocklimit ) = 0 then ll_segment = 1 aa_outarray[ll_outind] = la_segment la_segment = la_clear ll_outind++ end if la_segment[ll_segment] = aa_inarray[ll_inind] ll_segment++ next aa_outarray[ll_outind] = la_segment return ll_outind end function